@@ -41,11 +41,23 @@ type Violence struct {
41
41
Severity string `json:"severity,omitempty"`
42
42
}
43
43
44
+ type JailBreak struct {
45
+ Filtered bool `json:"filtered"`
46
+ Detected bool `json:"detected"`
47
+ }
48
+
49
+ type Profanity struct {
50
+ Filtered bool `json:"filtered"`
51
+ Detected bool `json:"detected"`
52
+ }
53
+
44
54
type ContentFilterResults struct {
45
- Hate Hate `json:"hate,omitempty"`
46
- SelfHarm SelfHarm `json:"self_harm,omitempty"`
47
- Sexual Sexual `json:"sexual,omitempty"`
48
- Violence Violence `json:"violence,omitempty"`
55
+ Hate Hate `json:"hate,omitempty"`
56
+ SelfHarm SelfHarm `json:"self_harm,omitempty"`
57
+ Sexual Sexual `json:"sexual,omitempty"`
58
+ Violence Violence `json:"violence,omitempty"`
59
+ JailBreak JailBreak `json:"jailbreak,omitempty"`
60
+ Profanity Profanity `json:"profanity,omitempty"`
49
61
}
50
62
51
63
type PromptAnnotation struct {
@@ -338,19 +350,21 @@ type ChatCompletionChoice struct {
338
350
// function_call: The model decided to call a function
339
351
// content_filter: Omitted content due to a flag from our content filters
340
352
// null: API response still in progress or incomplete
341
- FinishReason FinishReason `json:"finish_reason"`
342
- LogProbs * LogProbs `json:"logprobs,omitempty"`
353
+ FinishReason FinishReason `json:"finish_reason"`
354
+ LogProbs * LogProbs `json:"logprobs,omitempty"`
355
+ ContentFilterResults ContentFilterResults `json:"content_filter_results,omitempty"`
343
356
}
344
357
345
358
// ChatCompletionResponse represents a response structure for chat completion API.
346
359
type ChatCompletionResponse struct {
347
- ID string `json:"id"`
348
- Object string `json:"object"`
349
- Created int64 `json:"created"`
350
- Model string `json:"model"`
351
- Choices []ChatCompletionChoice `json:"choices"`
352
- Usage Usage `json:"usage"`
353
- SystemFingerprint string `json:"system_fingerprint"`
360
+ ID string `json:"id"`
361
+ Object string `json:"object"`
362
+ Created int64 `json:"created"`
363
+ Model string `json:"model"`
364
+ Choices []ChatCompletionChoice `json:"choices"`
365
+ Usage Usage `json:"usage"`
366
+ SystemFingerprint string `json:"system_fingerprint"`
367
+ PromptFilterResults []PromptFilterResult `json:"prompt_filter_results,omitempty"`
354
368
355
369
httpHeader
356
370
}
0 commit comments