在 function_call 为空时不在流中返回

This commit is contained in:
glzjin 2023-08-17 23:00:03 +08:00 committed by GitHub
parent 6b19dbba1f
commit 64217d1f50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,10 +34,6 @@ type Function struct {
Parameters Parameter `json:"parameters"`
}
type FunctionCall struct {
Name string `json:"name"`
}
const (
RelayModeUnknown = iota
RelayModeChatCompletions
@ -145,13 +141,15 @@ type ImageResponse struct {
}
}
type FunctionCall struct {
Name string `json:"name,omitempty"`
Arguments string `json:"arguments,omitempty"`
}
type ChatCompletionsStreamResponseChoice struct {
Delta struct {
Content string `json:"content"`
FunctionCall struct {
Name string `json:"name"`
Arguments string `json:"arguments"`
} `json:"function_call"`
Content string `json:"content"`
FunctionCall *FunctionCall `json:"function_call,omitempty"`
} `json:"delta"`
FinishReason *string `json:"finish_reason"`
}