feat: support stream_options (#736)
* feat: support stream_options * fix lint * fix lint
This commit is contained in:
10
chat.go
10
chat.go
@@ -216,6 +216,16 @@ type ChatCompletionRequest struct {
|
||||
Tools []Tool `json:"tools,omitempty"`
|
||||
// This can be either a string or an ToolChoice object.
|
||||
ToolChoice any `json:"tool_choice,omitempty"`
|
||||
// Options for streaming response. Only set this when you set stream: true.
|
||||
StreamOptions *StreamOptions `json:"stream_options,omitempty"`
|
||||
}
|
||||
|
||||
type StreamOptions struct {
|
||||
// If set, an additional chunk will be streamed before the data: [DONE] message.
|
||||
// The usage field on this chunk shows the token usage statistics for the entire request,
|
||||
// and the choices field will always be an empty array.
|
||||
// All other chunks will also include a usage field, but with a null value.
|
||||
IncludeUsage bool `json:"include_usage,omitempty"`
|
||||
}
|
||||
|
||||
type ToolType string
|
||||
|
||||
Reference in New Issue
Block a user