feat(chat): support function call api (#369)

* feat(chat): support function call api

* rename struct & add const ChatMessageRoleFunction
This commit is contained in:
Ccheers
2023-06-15 16:49:54 +08:00
committed by GitHub
parent 7e76a682a9
commit 2bd65aa720
3 changed files with 75 additions and 6 deletions

View File

@@ -40,7 +40,7 @@ func (c *Client) CreateChatCompletionStream(
ctx context.Context,
request ChatCompletionRequest,
) (stream *ChatCompletionStream, err error) {
urlSuffix := "/chat/completions"
urlSuffix := chatCompletionsSuffix
if !checkEndpointSupportsModel(urlSuffix, request.Model) {
err = ErrChatCompletionInvalidModel
return