File tree Expand file tree Collapse file tree 2 files changed +39
-8
lines changed Expand file tree Collapse file tree 2 files changed +39
-8
lines changed Original file line number Diff line number Diff line change 2121 ErrChatCompletionStreamNotSupported = errors .New ("streaming is not supported with this method, please use CreateChatCompletionStream" ) //nolint:lll
2222)
2323
24+ type Hate struct {
25+ Filtered bool `json:"filtered"`
26+ Severity string `json:"severity,omitempty"`
27+ }
28+ type SelfHarm struct {
29+ Filtered bool `json:"filtered"`
30+ Severity string `json:"severity,omitempty"`
31+ }
32+ type Sexual struct {
33+ Filtered bool `json:"filtered"`
34+ Severity string `json:"severity,omitempty"`
35+ }
36+ type Violence struct {
37+ Filtered bool `json:"filtered"`
38+ Severity string `json:"severity,omitempty"`
39+ }
40+
41+ type ContentFilterResults struct {
42+ Hate Hate `json:"hate,omitempty"`
43+ SelfHarm SelfHarm `json:"self_harm,omitempty"`
44+ Sexual Sexual `json:"sexual,omitempty"`
45+ Violence Violence `json:"violence,omitempty"`
46+ }
47+
48+ type PromptAnnotation struct {
49+ PromptIndex int `json:"prompt_index,omitempty"`
50+ ContentFilterResults ContentFilterResults `json:"content_filter_results,omitempty"`
51+ }
52+
2453type ChatCompletionMessage struct {
2554 Role string `json:"role"`
2655 Content string `json:"content"`
Original file line number Diff line number Diff line change @@ -12,17 +12,19 @@ type ChatCompletionStreamChoiceDelta struct {
1212}
1313
1414type ChatCompletionStreamChoice struct {
15- Index int `json:"index"`
16- Delta ChatCompletionStreamChoiceDelta `json:"delta"`
17- FinishReason FinishReason `json:"finish_reason"`
15+ Index int `json:"index"`
16+ Delta ChatCompletionStreamChoiceDelta `json:"delta"`
17+ FinishReason FinishReason `json:"finish_reason"`
18+ ContentFilterResults ContentFilterResults `json:"content_filter_results,omitempty"`
1819}
1920
2021type ChatCompletionStreamResponse struct {
21- ID string `json:"id"`
22- Object string `json:"object"`
23- Created int64 `json:"created"`
24- Model string `json:"model"`
25- Choices []ChatCompletionStreamChoice `json:"choices"`
22+ ID string `json:"id"`
23+ Object string `json:"object"`
24+ Created int64 `json:"created"`
25+ Model string `json:"model"`
26+ Choices []ChatCompletionStreamChoice `json:"choices"`
27+ PromptAnnotations []PromptAnnotation `json:"prompt_annotations,omitempty"`
2628}
2729
2830// ChatCompletionStream
You can’t perform that action at this time.
0 commit comments