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 21
21
ErrChatCompletionStreamNotSupported = errors .New ("streaming is not supported with this method, please use CreateChatCompletionStream" ) //nolint:lll
22
22
)
23
23
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
+
24
53
type ChatCompletionMessage struct {
25
54
Role string `json:"role"`
26
55
Content string `json:"content"`
Original file line number Diff line number Diff line change @@ -12,17 +12,19 @@ type ChatCompletionStreamChoiceDelta struct {
12
12
}
13
13
14
14
type 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"`
18
19
}
19
20
20
21
type 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"`
26
28
}
27
29
28
30
// ChatCompletionStream
You can’t perform that action at this time.
0 commit comments