-
Notifications
You must be signed in to change notification settings - Fork 526
/
Copy pathresponseBody.ts
60 lines (51 loc) · 1.12 KB
/
responseBody.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
interface CitationSource {
startIndex?: number;
endIndex?: number;
uri?: string;
license?: string;
}
interface CitationMetadata {
citationSources?: CitationSource[];
}
interface PalmMessage {
content?: string;
author?: string;
citationMetadata?: CitationMetadata;
}
interface ContentFilter {
reason: 'BLOCKED_REASON_UNSPECIFIED' | 'SAFETY' | 'OTHER';
message: string;
}
export interface PalmChatCompleteResponse {
candidates: PalmMessage[];
messages: PalmMessage[];
filters: ContentFilter[];
error?: PalmError;
}
interface PalmTextOutput {
output: string;
safetyRatings: safetyRatings[];
}
interface safetyRatings {
category:
| 'HARM_CATEGORY_DEROGATORY'
| 'HARM_CATEGORY_TOXICITY'
| 'HARM_CATEGORY_VIOLENCE'
| 'HARM_CATEGORY_SEXUAL'
| 'HARM_CATEGORY_MEDICAL'
| 'HARM_CATEGORY_DANGEROUS';
probability: 'NEGLIGIBLE' | 'LOW' | 'HIGH';
}
interface PalmFilter {
reason: 'OTHER';
}
interface PalmError {
code: number;
message: string;
status: string;
}
export interface PalmCompleteResponse {
candidates: PalmTextOutput[];
filters: PalmFilter[];
error?: PalmError;
}