feat: support stream_options (#736)

* feat: support stream_options

* fix lint

* fix lint
This commit is contained in:
Liu Shuang
2024-05-07 20:42:24 +08:00
committed by GitHub
parent 3334a9c78a
commit 6af32202d1
3 changed files with 137 additions and 0 deletions

View File

@@ -33,6 +33,10 @@ type ChatCompletionStreamResponse struct {
SystemFingerprint string `json:"system_fingerprint"`
PromptAnnotations []PromptAnnotation `json:"prompt_annotations,omitempty"`
PromptFilterResults []PromptFilterResult `json:"prompt_filter_results,omitempty"`
// An optional field that will only be present when you set stream_options: {"include_usage": true} in your request.
// When present, it contains a null value except for the last chunk which contains the token usage statistics
// for the entire request.
Usage *Usage `json:"usage,omitempty"`
}
// ChatCompletionStream