@langchain/google-common 0.2.18 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/LICENSE +6 -6
- package/dist/_virtual/rolldown_runtime.cjs +25 -0
- package/dist/auth.cjs +82 -116
- package/dist/auth.cjs.map +1 -0
- package/dist/auth.d.cts +46 -0
- package/dist/auth.d.cts.map +1 -0
- package/dist/auth.d.ts +41 -36
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +80 -110
- package/dist/auth.js.map +1 -0
- package/dist/chat_models.cjs +251 -466
- package/dist/chat_models.cjs.map +1 -0
- package/dist/chat_models.d.cts +98 -0
- package/dist/chat_models.d.cts.map +1 -0
- package/dist/chat_models.d.ts +87 -73
- package/dist/chat_models.d.ts.map +1 -0
- package/dist/chat_models.js +245 -457
- package/dist/chat_models.js.map +1 -0
- package/dist/connection.cjs +321 -466
- package/dist/connection.cjs.map +1 -0
- package/dist/connection.d.cts +109 -0
- package/dist/connection.d.cts.map +1 -0
- package/dist/connection.d.ts +98 -91
- package/dist/connection.d.ts.map +1 -0
- package/dist/connection.js +317 -459
- package/dist/connection.js.map +1 -0
- package/dist/embeddings.cjs +135 -186
- package/dist/embeddings.cjs.map +1 -0
- package/dist/embeddings.d.cts +44 -0
- package/dist/embeddings.d.cts.map +1 -0
- package/dist/embeddings.d.ts +38 -32
- package/dist/embeddings.d.ts.map +1 -0
- package/dist/embeddings.js +133 -181
- package/dist/embeddings.js.map +1 -0
- package/dist/experimental/media.cjs +380 -482
- package/dist/experimental/media.cjs.map +1 -0
- package/dist/experimental/media.d.cts +198 -0
- package/dist/experimental/media.d.cts.map +1 -0
- package/dist/experimental/media.d.ts +190 -202
- package/dist/experimental/media.d.ts.map +1 -0
- package/dist/experimental/media.js +369 -468
- package/dist/experimental/media.js.map +1 -0
- package/dist/experimental/utils/media_core.cjs +403 -517
- package/dist/experimental/utils/media_core.cjs.map +1 -0
- package/dist/experimental/utils/media_core.d.cts +215 -0
- package/dist/experimental/utils/media_core.d.cts.map +1 -0
- package/dist/experimental/utils/media_core.d.ts +171 -165
- package/dist/experimental/utils/media_core.d.ts.map +1 -0
- package/dist/experimental/utils/media_core.js +395 -506
- package/dist/experimental/utils/media_core.js.map +1 -0
- package/dist/index.cjs +58 -27
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -11
- package/dist/index.js +13 -11
- package/dist/llms.cjs +157 -244
- package/dist/llms.cjs.map +1 -0
- package/dist/llms.d.cts +72 -0
- package/dist/llms.d.cts.map +1 -0
- package/dist/llms.d.ts +64 -54
- package/dist/llms.d.ts.map +1 -0
- package/dist/llms.js +154 -238
- package/dist/llms.js.map +1 -0
- package/dist/output_parsers.cjs +148 -173
- package/dist/output_parsers.cjs.map +1 -0
- package/dist/output_parsers.d.cts +53 -0
- package/dist/output_parsers.d.cts.map +1 -0
- package/dist/output_parsers.d.ts +46 -42
- package/dist/output_parsers.d.ts.map +1 -0
- package/dist/output_parsers.js +146 -168
- package/dist/output_parsers.js.map +1 -0
- package/dist/types-anthropic.d.cts +229 -0
- package/dist/types-anthropic.d.cts.map +1 -0
- package/dist/types-anthropic.d.ts +221 -215
- package/dist/types-anthropic.d.ts.map +1 -0
- package/dist/types.cjs +51 -62
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +748 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.ts +669 -656
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +46 -45
- package/dist/types.js.map +1 -0
- package/dist/utils/anthropic.cjs +598 -821
- package/dist/utils/anthropic.cjs.map +1 -0
- package/dist/utils/anthropic.js +597 -818
- package/dist/utils/anthropic.js.map +1 -0
- package/dist/utils/common.cjs +130 -211
- package/dist/utils/common.cjs.map +1 -0
- package/dist/utils/common.d.cts +13 -0
- package/dist/utils/common.d.cts.map +1 -0
- package/dist/utils/common.d.ts +12 -7
- package/dist/utils/common.d.ts.map +1 -0
- package/dist/utils/common.js +128 -207
- package/dist/utils/common.js.map +1 -0
- package/dist/utils/failed_handler.cjs +28 -30
- package/dist/utils/failed_handler.cjs.map +1 -0
- package/dist/utils/failed_handler.d.cts +9 -0
- package/dist/utils/failed_handler.d.cts.map +1 -0
- package/dist/utils/failed_handler.d.ts +8 -2
- package/dist/utils/failed_handler.d.ts.map +1 -0
- package/dist/utils/failed_handler.js +28 -28
- package/dist/utils/failed_handler.js.map +1 -0
- package/dist/utils/gemini.cjs +1020 -1488
- package/dist/utils/gemini.cjs.map +1 -0
- package/dist/utils/gemini.d.cts +51 -0
- package/dist/utils/gemini.d.cts.map +1 -0
- package/dist/utils/gemini.d.ts +51 -48
- package/dist/utils/gemini.d.ts.map +1 -0
- package/dist/utils/gemini.js +1015 -1479
- package/dist/utils/gemini.js.map +1 -0
- package/dist/utils/index.cjs +38 -23
- package/dist/utils/index.d.cts +8 -0
- package/dist/utils/index.d.ts +8 -7
- package/dist/utils/index.js +8 -7
- package/dist/utils/palm.d.cts +11 -0
- package/dist/utils/palm.d.cts.map +1 -0
- package/dist/utils/palm.d.ts +9 -4
- package/dist/utils/palm.d.ts.map +1 -0
- package/dist/utils/safety.cjs +13 -22
- package/dist/utils/safety.cjs.map +1 -0
- package/dist/utils/safety.d.cts +12 -0
- package/dist/utils/safety.d.cts.map +1 -0
- package/dist/utils/safety.d.ts +10 -4
- package/dist/utils/safety.d.ts.map +1 -0
- package/dist/utils/safety.js +13 -19
- package/dist/utils/safety.js.map +1 -0
- package/dist/utils/stream.cjs +296 -475
- package/dist/utils/stream.cjs.map +1 -0
- package/dist/utils/stream.d.cts +165 -0
- package/dist/utils/stream.d.cts.map +1 -0
- package/dist/utils/stream.d.ts +156 -131
- package/dist/utils/stream.d.ts.map +1 -0
- package/dist/utils/stream.js +293 -469
- package/dist/utils/stream.js.map +1 -0
- package/dist/utils/zod_to_gemini_parameters.cjs +43 -81
- package/dist/utils/zod_to_gemini_parameters.cjs.map +1 -0
- package/dist/utils/zod_to_gemini_parameters.d.cts +22 -0
- package/dist/utils/zod_to_gemini_parameters.d.cts.map +1 -0
- package/dist/utils/zod_to_gemini_parameters.d.ts +21 -6
- package/dist/utils/zod_to_gemini_parameters.d.ts.map +1 -0
- package/dist/utils/zod_to_gemini_parameters.js +40 -76
- package/dist/utils/zod_to_gemini_parameters.js.map +1 -0
- package/package.json +69 -85
- package/dist/types-anthropic.cjs +0 -2
- package/dist/types-anthropic.js +0 -1
- package/dist/utils/anthropic.d.ts +0 -4
- package/dist/utils/palm.cjs +0 -2
- package/dist/utils/palm.js +0 -1
- package/experimental/media.cjs +0 -1
- package/experimental/media.d.cts +0 -1
- package/experimental/media.d.ts +0 -1
- package/experimental/media.js +0 -1
- package/experimental/utils/media_core.cjs +0 -1
- package/experimental/utils/media_core.d.cts +0 -1
- package/experimental/utils/media_core.d.ts +0 -1
- package/experimental/utils/media_core.js +0 -1
- package/index.cjs +0 -1
- package/index.d.cts +0 -1
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/types.cjs +0 -1
- package/types.d.cts +0 -1
- package/types.d.ts +0 -1
- package/types.js +0 -1
- package/utils.cjs +0 -1
- package/utils.d.cts +0 -1
- package/utils.d.ts +0 -1
- package/utils.js +0 -1
|
@@ -1,223 +1,229 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/types-anthropic.d.ts
|
|
2
|
+
interface AnthropicCacheControl {
|
|
3
|
+
type: "ephemeral" | string;
|
|
3
4
|
}
|
|
4
5
|
interface AnthropicMessageContentBase {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
type: string;
|
|
7
|
+
cache_control?: AnthropicCacheControl | null;
|
|
8
|
+
}
|
|
9
|
+
interface AnthropicMessageContentText extends AnthropicMessageContentBase {
|
|
10
|
+
type: "text";
|
|
11
|
+
text: string;
|
|
12
|
+
}
|
|
13
|
+
interface AnthropicMessageContentImage extends AnthropicMessageContentBase {
|
|
14
|
+
type: "image";
|
|
15
|
+
source: {
|
|
16
|
+
type: "base64" | string;
|
|
17
|
+
media_type?: string;
|
|
18
|
+
data: string;
|
|
19
|
+
} | {
|
|
20
|
+
type: "url" | string;
|
|
21
|
+
url: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
interface AnthropicMessageContentThinking extends AnthropicMessageContentBase {
|
|
25
|
+
type: "thinking";
|
|
26
|
+
thinking: string;
|
|
27
|
+
signature: string;
|
|
28
|
+
}
|
|
29
|
+
interface AnthropicMessageContentDocument extends AnthropicMessageContentBase {
|
|
30
|
+
type: "document";
|
|
31
|
+
source: {
|
|
32
|
+
type: "base64" | "text" | string;
|
|
33
|
+
media_type?: "application/pdf" | "text/plain" | string;
|
|
34
|
+
data: string;
|
|
35
|
+
} | {
|
|
36
|
+
type: "url" | string;
|
|
37
|
+
url: string;
|
|
38
|
+
} | {
|
|
39
|
+
type: "content" | string;
|
|
40
|
+
content: {
|
|
41
|
+
type: "image" | string;
|
|
42
|
+
source: {
|
|
15
43
|
type: "base64" | string;
|
|
16
|
-
media_type?: string;
|
|
17
|
-
data: string;
|
|
18
|
-
} | {
|
|
19
|
-
type: "url" | string;
|
|
20
|
-
url: string;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export interface AnthropicMessageContentThinking extends AnthropicMessageContentBase {
|
|
24
|
-
type: "thinking";
|
|
25
|
-
thinking: string;
|
|
26
|
-
signature: string;
|
|
27
|
-
}
|
|
28
|
-
export interface AnthropicMessageContentDocument extends AnthropicMessageContentBase {
|
|
29
|
-
type: "document";
|
|
30
|
-
source: {
|
|
31
|
-
type: "base64" | "text" | string;
|
|
32
|
-
media_type?: "application/pdf" | "text/plain" | string;
|
|
33
44
|
data: string;
|
|
34
|
-
|
|
45
|
+
media_type?: "image/jpeg" | "image/png" | "image/gif" | "image/webp" | string;
|
|
46
|
+
} | {
|
|
35
47
|
type: "url" | string;
|
|
36
48
|
url: string;
|
|
37
|
-
|
|
38
|
-
type: "
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
is_error?: boolean;
|
|
76
|
-
content: string | AnthropicMessageContentToolResultContent[];
|
|
77
|
-
}
|
|
78
|
-
export type AnthropicMessageContent = AnthropicMessageContentText | AnthropicMessageContentImage | AnthropicMessageContentToolUse | AnthropicMessageContentToolResult | AnthropicMessageContentThinking | AnthropicMessageContentRedactedThinking;
|
|
79
|
-
export interface AnthropicMessage {
|
|
80
|
-
role: string;
|
|
81
|
-
content: string | AnthropicMessageContent[];
|
|
82
|
-
}
|
|
83
|
-
export interface AnthropicMetadata {
|
|
84
|
-
user_id?: string | null;
|
|
49
|
+
} | {
|
|
50
|
+
type: "text" | string;
|
|
51
|
+
text: string;
|
|
52
|
+
};
|
|
53
|
+
}[];
|
|
54
|
+
};
|
|
55
|
+
citations?: {
|
|
56
|
+
enabled?: boolean;
|
|
57
|
+
};
|
|
58
|
+
context?: string;
|
|
59
|
+
title?: string;
|
|
60
|
+
}
|
|
61
|
+
interface AnthropicMessageContentRedactedThinking extends AnthropicMessageContentBase {
|
|
62
|
+
type: "redacted_thinking";
|
|
63
|
+
data: string;
|
|
64
|
+
}
|
|
65
|
+
// TODO: Define this
|
|
66
|
+
type AnthropicMessageContentToolUseInput = object;
|
|
67
|
+
interface AnthropicMessageContentToolUse extends AnthropicMessageContentBase {
|
|
68
|
+
type: "tool_use";
|
|
69
|
+
id: string;
|
|
70
|
+
name: string;
|
|
71
|
+
input: AnthropicMessageContentToolUseInput;
|
|
72
|
+
}
|
|
73
|
+
type AnthropicMessageContentToolResultContent = AnthropicMessageContentText | AnthropicMessageContentImage;
|
|
74
|
+
interface AnthropicMessageContentToolResult extends AnthropicMessageContentBase {
|
|
75
|
+
type: "tool_result";
|
|
76
|
+
tool_use_id: string;
|
|
77
|
+
is_error?: boolean;
|
|
78
|
+
content: string | AnthropicMessageContentToolResultContent[];
|
|
79
|
+
}
|
|
80
|
+
type AnthropicMessageContent = AnthropicMessageContentText | AnthropicMessageContentImage | AnthropicMessageContentToolUse | AnthropicMessageContentToolResult | AnthropicMessageContentThinking | AnthropicMessageContentRedactedThinking;
|
|
81
|
+
interface AnthropicMessage {
|
|
82
|
+
role: string;
|
|
83
|
+
content: string | AnthropicMessageContent[];
|
|
84
|
+
}
|
|
85
|
+
interface AnthropicMetadata {
|
|
86
|
+
user_id?: string | null;
|
|
85
87
|
}
|
|
86
88
|
interface AnthropicToolChoiceBase {
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
89
|
+
type: string;
|
|
90
|
+
}
|
|
91
|
+
interface AnthropicToolChoiceAuto extends AnthropicToolChoiceBase {
|
|
92
|
+
type: "auto";
|
|
93
|
+
}
|
|
94
|
+
interface AnthropicToolChoiceAny extends AnthropicToolChoiceBase {
|
|
95
|
+
type: "any";
|
|
96
|
+
}
|
|
97
|
+
interface AnthropicToolChoiceTool extends AnthropicToolChoiceBase {
|
|
98
|
+
type: "tool";
|
|
99
|
+
name: string;
|
|
100
|
+
}
|
|
101
|
+
type AnthropicToolChoice = AnthropicToolChoiceAuto | AnthropicToolChoiceAny | AnthropicToolChoiceTool;
|
|
102
|
+
// TODO: Define this
|
|
103
|
+
type AnthropicToolInputSchema = object;
|
|
104
|
+
interface AnthropicTool {
|
|
105
|
+
type?: string; // Just available on tools 20241022 and later?
|
|
106
|
+
name: string;
|
|
107
|
+
description?: string;
|
|
108
|
+
cache_control?: AnthropicCacheControl;
|
|
109
|
+
input_schema: AnthropicToolInputSchema;
|
|
110
|
+
}
|
|
111
|
+
interface AnthropicThinkingEnabled {
|
|
112
|
+
type: "enabled";
|
|
113
|
+
budget_tokens: number;
|
|
114
|
+
}
|
|
115
|
+
interface AnthropicThinkingDisabled {
|
|
116
|
+
type: "disabled";
|
|
117
|
+
}
|
|
118
|
+
type AnthropicThinking = AnthropicThinkingEnabled | AnthropicThinkingDisabled;
|
|
119
|
+
interface AnthropicRequest {
|
|
120
|
+
anthropic_version: string;
|
|
121
|
+
messages: AnthropicMessage[];
|
|
122
|
+
system?: string;
|
|
123
|
+
stream?: boolean;
|
|
124
|
+
max_tokens: number;
|
|
125
|
+
temperature?: number;
|
|
126
|
+
top_k?: number;
|
|
127
|
+
top_p?: number;
|
|
128
|
+
stop_sequences?: string[];
|
|
129
|
+
metadata?: AnthropicMetadata;
|
|
130
|
+
tool_choice?: AnthropicToolChoice;
|
|
131
|
+
tools?: AnthropicTool[];
|
|
132
|
+
thinking?: AnthropicThinking;
|
|
133
|
+
}
|
|
134
|
+
type AnthropicRequestSettings = Pick<AnthropicRequest, "max_tokens" | "temperature" | "top_k" | "top_p" | "stop_sequences" | "stream">;
|
|
135
|
+
interface AnthropicContentText {
|
|
136
|
+
type: "text";
|
|
137
|
+
text: string;
|
|
138
|
+
}
|
|
139
|
+
interface AnthropicContentToolUse {
|
|
140
|
+
type: "tool_use";
|
|
141
|
+
id: string;
|
|
142
|
+
name: string;
|
|
143
|
+
input: object;
|
|
144
|
+
}
|
|
145
|
+
interface AnthropicContentThinking {
|
|
146
|
+
type: "thinking";
|
|
147
|
+
thinking: string;
|
|
148
|
+
signature: string;
|
|
149
|
+
}
|
|
150
|
+
interface AnthropicContentRedactedThinking {
|
|
151
|
+
type: "redacted_thinking";
|
|
152
|
+
data: string;
|
|
153
|
+
}
|
|
154
|
+
type AnthropicContent = AnthropicContentText | AnthropicContentToolUse | AnthropicContentThinking | AnthropicContentRedactedThinking;
|
|
155
|
+
interface AnthropicUsage {
|
|
156
|
+
input_tokens: number;
|
|
157
|
+
output_tokens: number;
|
|
158
|
+
cache_creation_input_tokens: number | null;
|
|
159
|
+
cache_creation_output_tokens: number | null;
|
|
160
|
+
cache_read_input_tokens: number | null;
|
|
161
|
+
}
|
|
162
|
+
type AnthropicResponseData = AnthropicResponseMessage | AnthropicStreamBaseEvent;
|
|
163
|
+
interface AnthropicResponseMessage {
|
|
164
|
+
id: string;
|
|
165
|
+
type: string;
|
|
166
|
+
role: string;
|
|
167
|
+
content: AnthropicContent[];
|
|
168
|
+
model: string;
|
|
169
|
+
stop_reason: string | null;
|
|
170
|
+
stop_sequence: string | null;
|
|
171
|
+
usage: AnthropicUsage;
|
|
172
|
+
}
|
|
173
|
+
interface AnthropicAPIConfig {
|
|
174
|
+
version?: string;
|
|
175
|
+
thinking?: AnthropicThinking;
|
|
176
|
+
}
|
|
177
|
+
type AnthropicStreamEventType = "message_start" | "content_block_start" | "content_block_delta" | "content_block_stop" | "message_delta" | "message_stop" | "ping" | "error";
|
|
178
|
+
type AnthropicStreamDeltaType = "text_delta" | "input_json_delta";
|
|
179
|
+
interface AnthropicStreamBaseEvent {
|
|
180
|
+
type: AnthropicStreamEventType;
|
|
181
|
+
}
|
|
182
|
+
interface AnthropicStreamMessageStartEvent extends AnthropicStreamBaseEvent {
|
|
183
|
+
type: "message_start";
|
|
184
|
+
message: AnthropicResponseMessage;
|
|
185
|
+
}
|
|
186
|
+
interface AnthropicStreamContentBlockStartEvent extends AnthropicStreamBaseEvent {
|
|
187
|
+
type: "content_block_start";
|
|
188
|
+
index: number;
|
|
189
|
+
content_block: AnthropicContent;
|
|
190
|
+
}
|
|
191
|
+
interface AnthropicStreamBaseDelta {
|
|
192
|
+
type: AnthropicStreamDeltaType;
|
|
193
|
+
}
|
|
194
|
+
interface AnthropicStreamTextDelta extends AnthropicStreamBaseDelta {
|
|
195
|
+
type: "text_delta";
|
|
196
|
+
text: string;
|
|
197
|
+
}
|
|
198
|
+
interface AnthropicStreamInputJsonDelta extends AnthropicStreamBaseDelta {
|
|
199
|
+
type: "input_json_delta";
|
|
200
|
+
partial_json: string;
|
|
201
|
+
}
|
|
202
|
+
type AnthropicStreamDelta = AnthropicStreamTextDelta | AnthropicStreamInputJsonDelta;
|
|
203
|
+
interface AnthropicStreamContentBlockDeltaEvent extends AnthropicStreamBaseEvent {
|
|
204
|
+
type: "content_block_delta";
|
|
205
|
+
index: number;
|
|
206
|
+
delta: AnthropicStreamDelta;
|
|
207
|
+
}
|
|
208
|
+
interface AnthropicStreamContentBlockStopEvent extends AnthropicStreamBaseEvent {
|
|
209
|
+
type: "content_block_stop";
|
|
210
|
+
index: number;
|
|
211
|
+
}
|
|
212
|
+
interface AnthropicStreamMessageDeltaEvent extends AnthropicStreamBaseEvent {
|
|
213
|
+
type: "message_delta";
|
|
214
|
+
delta: Partial<AnthropicResponseMessage>;
|
|
215
|
+
}
|
|
216
|
+
interface AnthropicStreamMessageStopEvent extends AnthropicStreamBaseEvent {
|
|
217
|
+
type: "message_stop";
|
|
218
|
+
}
|
|
219
|
+
interface AnthropicStreamPingEvent extends AnthropicStreamBaseEvent {
|
|
220
|
+
type: "ping";
|
|
221
|
+
}
|
|
222
|
+
interface AnthropicStreamErrorEvent extends AnthropicStreamBaseEvent {
|
|
223
|
+
type: "error";
|
|
224
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
225
|
+
error: any;
|
|
226
|
+
}
|
|
227
|
+
//#endregion
|
|
228
|
+
export { AnthropicAPIConfig, AnthropicCacheControl, AnthropicContent, AnthropicContentRedactedThinking, AnthropicContentText, AnthropicContentThinking, AnthropicContentToolUse, AnthropicMessage, AnthropicMessageContent, AnthropicMessageContentDocument, AnthropicMessageContentImage, AnthropicMessageContentRedactedThinking, AnthropicMessageContentText, AnthropicMessageContentThinking, AnthropicMessageContentToolResult, AnthropicMessageContentToolResultContent, AnthropicMessageContentToolUse, AnthropicMessageContentToolUseInput, AnthropicMetadata, AnthropicRequest, AnthropicRequestSettings, AnthropicResponseData, AnthropicResponseMessage, AnthropicStreamBaseDelta, AnthropicStreamBaseEvent, AnthropicStreamContentBlockDeltaEvent, AnthropicStreamContentBlockStartEvent, AnthropicStreamContentBlockStopEvent, AnthropicStreamDelta, AnthropicStreamDeltaType, AnthropicStreamErrorEvent, AnthropicStreamEventType, AnthropicStreamInputJsonDelta, AnthropicStreamMessageDeltaEvent, AnthropicStreamMessageStartEvent, AnthropicStreamMessageStopEvent, AnthropicStreamPingEvent, AnthropicStreamTextDelta, AnthropicThinking, AnthropicThinkingDisabled, AnthropicThinkingEnabled, AnthropicTool, AnthropicToolChoice, AnthropicToolChoiceAny, AnthropicToolChoiceAuto, AnthropicToolChoiceTool, AnthropicToolInputSchema, AnthropicUsage };
|
|
229
|
+
//# sourceMappingURL=types-anthropic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-anthropic.d.ts","names":["AnthropicCacheControl","AnthropicMessageContentBase","AnthropicMessageContentText","AnthropicMessageContentImage","AnthropicMessageContentThinking","AnthropicMessageContentDocument","AnthropicMessageContentRedactedThinking","AnthropicMessageContentToolUseInput","AnthropicMessageContentToolUse","AnthropicMessageContentToolResultContent","AnthropicMessageContentToolResult","AnthropicMessageContent","AnthropicMessage","AnthropicMetadata","AnthropicToolChoiceBase","AnthropicToolChoiceAuto","AnthropicToolChoiceAny","AnthropicToolChoiceTool","AnthropicToolChoice","AnthropicToolInputSchema","AnthropicTool","AnthropicThinkingEnabled","AnthropicThinkingDisabled","AnthropicThinking","AnthropicRequest","AnthropicRequestSettings","Pick","AnthropicContentText","AnthropicContentToolUse","AnthropicContentThinking","AnthropicContentRedactedThinking","AnthropicContent","AnthropicUsage","AnthropicResponseData","AnthropicResponseMessage","AnthropicStreamBaseEvent","AnthropicAPIConfig","AnthropicStreamEventType","AnthropicStreamDeltaType","AnthropicStreamMessageStartEvent","AnthropicStreamContentBlockStartEvent","AnthropicStreamBaseDelta","AnthropicStreamTextDelta","AnthropicStreamInputJsonDelta","AnthropicStreamDelta","AnthropicStreamContentBlockDeltaEvent","AnthropicStreamContentBlockStopEvent","AnthropicStreamMessageDeltaEvent","Partial","AnthropicStreamMessageStopEvent","AnthropicStreamPingEvent","AnthropicStreamErrorEvent"],"sources":["../src/types-anthropic.d.ts"],"sourcesContent":["export interface AnthropicCacheControl {\n type: \"ephemeral\" | string;\n}\ninterface AnthropicMessageContentBase {\n type: string;\n cache_control?: AnthropicCacheControl | null;\n}\nexport interface AnthropicMessageContentText extends AnthropicMessageContentBase {\n type: \"text\";\n text: string;\n}\nexport interface AnthropicMessageContentImage extends AnthropicMessageContentBase {\n type: \"image\";\n source: {\n type: \"base64\" | string;\n media_type?: string;\n data: string;\n } | {\n type: \"url\" | string;\n url: string;\n };\n}\nexport interface AnthropicMessageContentThinking extends AnthropicMessageContentBase {\n type: \"thinking\";\n thinking: string;\n signature: string;\n}\nexport interface AnthropicMessageContentDocument extends AnthropicMessageContentBase {\n type: \"document\";\n source: {\n type: \"base64\" | \"text\" | string;\n media_type?: \"application/pdf\" | \"text/plain\" | string;\n data: string;\n } | {\n type: \"url\" | string;\n url: string;\n } | {\n type: \"content\" | string;\n content: {\n type: \"image\" | string;\n source: {\n type: \"base64\" | string;\n data: string;\n media_type?: \"image/jpeg\" | \"image/png\" | \"image/gif\" | \"image/webp\" | string;\n } | {\n type: \"url\" | string;\n url: string;\n } | {\n type: \"text\" | string;\n text: string;\n };\n }[];\n };\n citations?: {\n enabled?: boolean;\n };\n context?: string;\n title?: string;\n}\nexport interface AnthropicMessageContentRedactedThinking extends AnthropicMessageContentBase {\n type: \"redacted_thinking\";\n data: string;\n}\n// TODO: Define this\nexport type AnthropicMessageContentToolUseInput = object;\nexport interface AnthropicMessageContentToolUse extends AnthropicMessageContentBase {\n type: \"tool_use\";\n id: string;\n name: string;\n input: AnthropicMessageContentToolUseInput;\n}\nexport type AnthropicMessageContentToolResultContent = AnthropicMessageContentText | AnthropicMessageContentImage;\nexport interface AnthropicMessageContentToolResult extends AnthropicMessageContentBase {\n type: \"tool_result\";\n tool_use_id: string;\n is_error?: boolean;\n content: string | AnthropicMessageContentToolResultContent[];\n}\nexport type AnthropicMessageContent = AnthropicMessageContentText | AnthropicMessageContentImage | AnthropicMessageContentToolUse | AnthropicMessageContentToolResult | AnthropicMessageContentThinking | AnthropicMessageContentRedactedThinking;\nexport interface AnthropicMessage {\n role: string;\n content: string | AnthropicMessageContent[];\n}\nexport interface AnthropicMetadata {\n user_id?: string | null;\n}\ninterface AnthropicToolChoiceBase {\n type: string;\n}\nexport interface AnthropicToolChoiceAuto extends AnthropicToolChoiceBase {\n type: \"auto\";\n}\nexport interface AnthropicToolChoiceAny extends AnthropicToolChoiceBase {\n type: \"any\";\n}\nexport interface AnthropicToolChoiceTool extends AnthropicToolChoiceBase {\n type: \"tool\";\n name: string;\n}\nexport type AnthropicToolChoice = AnthropicToolChoiceAuto | AnthropicToolChoiceAny | AnthropicToolChoiceTool;\n// TODO: Define this\nexport type AnthropicToolInputSchema = object;\nexport interface AnthropicTool {\n type?: string; // Just available on tools 20241022 and later?\n name: string;\n description?: string;\n cache_control?: AnthropicCacheControl;\n input_schema: AnthropicToolInputSchema;\n}\nexport interface AnthropicThinkingEnabled {\n type: \"enabled\";\n budget_tokens: number;\n}\nexport interface AnthropicThinkingDisabled {\n type: \"disabled\";\n}\nexport type AnthropicThinking = AnthropicThinkingEnabled | AnthropicThinkingDisabled;\nexport interface AnthropicRequest {\n anthropic_version: string;\n messages: AnthropicMessage[];\n system?: string;\n stream?: boolean;\n max_tokens: number;\n temperature?: number;\n top_k?: number;\n top_p?: number;\n stop_sequences?: string[];\n metadata?: AnthropicMetadata;\n tool_choice?: AnthropicToolChoice;\n tools?: AnthropicTool[];\n thinking?: AnthropicThinking;\n}\nexport type AnthropicRequestSettings = Pick<AnthropicRequest, \"max_tokens\" | \"temperature\" | \"top_k\" | \"top_p\" | \"stop_sequences\" | \"stream\">;\nexport interface AnthropicContentText {\n type: \"text\";\n text: string;\n}\nexport interface AnthropicContentToolUse {\n type: \"tool_use\";\n id: string;\n name: string;\n input: object;\n}\nexport interface AnthropicContentThinking {\n type: \"thinking\";\n thinking: string;\n signature: string;\n}\nexport interface AnthropicContentRedactedThinking {\n type: \"redacted_thinking\";\n data: string;\n}\nexport type AnthropicContent = AnthropicContentText | AnthropicContentToolUse | AnthropicContentThinking | AnthropicContentRedactedThinking;\nexport interface AnthropicUsage {\n input_tokens: number;\n output_tokens: number;\n cache_creation_input_tokens: number | null;\n cache_creation_output_tokens: number | null;\n cache_read_input_tokens: number | null;\n}\nexport type AnthropicResponseData = AnthropicResponseMessage | AnthropicStreamBaseEvent;\nexport interface AnthropicResponseMessage {\n id: string;\n type: string;\n role: string;\n content: AnthropicContent[];\n model: string;\n stop_reason: string | null;\n stop_sequence: string | null;\n usage: AnthropicUsage;\n}\nexport interface AnthropicAPIConfig {\n version?: string;\n thinking?: AnthropicThinking;\n}\nexport type AnthropicStreamEventType = \"message_start\" | \"content_block_start\" | \"content_block_delta\" | \"content_block_stop\" | \"message_delta\" | \"message_stop\" | \"ping\" | \"error\";\nexport type AnthropicStreamDeltaType = \"text_delta\" | \"input_json_delta\";\nexport interface AnthropicStreamBaseEvent {\n type: AnthropicStreamEventType;\n}\nexport interface AnthropicStreamMessageStartEvent extends AnthropicStreamBaseEvent {\n type: \"message_start\";\n message: AnthropicResponseMessage;\n}\nexport interface AnthropicStreamContentBlockStartEvent extends AnthropicStreamBaseEvent {\n type: \"content_block_start\";\n index: number;\n content_block: AnthropicContent;\n}\nexport interface AnthropicStreamBaseDelta {\n type: AnthropicStreamDeltaType;\n}\nexport interface AnthropicStreamTextDelta extends AnthropicStreamBaseDelta {\n type: \"text_delta\";\n text: string;\n}\nexport interface AnthropicStreamInputJsonDelta extends AnthropicStreamBaseDelta {\n type: \"input_json_delta\";\n partial_json: string;\n}\nexport type AnthropicStreamDelta = AnthropicStreamTextDelta | AnthropicStreamInputJsonDelta;\nexport interface AnthropicStreamContentBlockDeltaEvent extends AnthropicStreamBaseEvent {\n type: \"content_block_delta\";\n index: number;\n delta: AnthropicStreamDelta;\n}\nexport interface AnthropicStreamContentBlockStopEvent extends AnthropicStreamBaseEvent {\n type: \"content_block_stop\";\n index: number;\n}\nexport interface AnthropicStreamMessageDeltaEvent extends AnthropicStreamBaseEvent {\n type: \"message_delta\";\n delta: Partial<AnthropicResponseMessage>;\n}\nexport interface AnthropicStreamMessageStopEvent extends AnthropicStreamBaseEvent {\n type: \"message_stop\";\n}\nexport interface AnthropicStreamPingEvent extends AnthropicStreamBaseEvent {\n type: \"ping\";\n}\nexport interface AnthropicStreamErrorEvent extends AnthropicStreamBaseEvent {\n type: \"error\";\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n error: any;\n}\nexport {};\n"],"mappings":";UAAiBA,qBAAAA;EAAAA,IAAAA,EAAAA,WAAAA,GAAAA,MAAqB;AAErC;AAKD,UAJUC,2BAAAA,CAIkC;EAI3BE,IAAAA,EAAAA,MAAAA;EAWAC,aAAAA,CAAAA,EAjBGJ,qBAiB4B,GAAA,IAAA;AAKhD;AAgCiBM,UApDAJ,2BAAAA,SAAoCD,2BAoDYA,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ment: "HARM_CATEGORY_HARASSMENT",
|
|
5
|
+
HARASSMENT: "HARM_CATEGORY_HARASSMENT",
|
|
6
|
+
HARM_CATEGORY_HARASSMENT: "HARM_CATEGORY_HARASSMENT",
|
|
7
|
+
HateSpeech: "HARM_CATEGORY_HATE_SPEECH",
|
|
8
|
+
HATE_SPEECH: "HARM_CATEGORY_HATE_SPEECH",
|
|
9
|
+
HARM_CATEGORY_HATE_SPEECH: "HARM_CATEGORY_HATE_SPEECH",
|
|
10
|
+
SexuallyExplicit: "HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
|
11
|
+
SEXUALLY_EXPLICIT: "HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
|
12
|
+
HARM_CATEGORY_SEXUALLY_EXPLICIT: "HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
|
13
|
+
Dangerous: "HARM_CATEGORY_DANGEROUS",
|
|
14
|
+
DANGEROUS: "HARM_CATEGORY_DANGEROUS",
|
|
15
|
+
HARM_CATEGORY_DANGEROUS: "HARM_CATEGORY_DANGEROUS",
|
|
16
|
+
CivicIntegrity: "HARM_CATEGORY_CIVIC_INTEGRITY",
|
|
17
|
+
CIVIC_INTEGRITY: "HARM_CATEGORY_CIVIC_INTEGRITY",
|
|
18
|
+
HARM_CATEGORY_CIVIC_INTEGRITY: "HARM_CATEGORY_CIVIC_INTEGRITY"
|
|
15
19
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
CivicIntegrity: "HARM_CATEGORY_CIVIC_INTEGRITY",
|
|
33
|
-
CIVIC_INTEGRITY: "HARM_CATEGORY_CIVIC_INTEGRITY",
|
|
34
|
-
HARM_CATEGORY_CIVIC_INTEGRITY: "HARM_CATEGORY_CIVIC_INTEGRITY",
|
|
20
|
+
const GoogleAISafetyThreshold = {
|
|
21
|
+
None: "BLOCK_NONE",
|
|
22
|
+
NONE: "BLOCK_NONE",
|
|
23
|
+
BLOCK_NONE: "BLOCK_NONE",
|
|
24
|
+
Few: "BLOCK_ONLY_HIGH",
|
|
25
|
+
FEW: "BLOCK_ONLY_HIGH",
|
|
26
|
+
BLOCK_ONLY_HIGH: "BLOCK_ONLY_HIGH",
|
|
27
|
+
Some: "BLOCK_MEDIUM_AND_ABOVE",
|
|
28
|
+
SOME: "BLOCK_MEDIUM_AND_ABOVE",
|
|
29
|
+
BLOCK_MEDIUM_AND_ABOVE: "BLOCK_MEDIUM_AND_ABOVE",
|
|
30
|
+
Most: "BLOCK_LOW_AND_ABOVE",
|
|
31
|
+
MOST: "BLOCK_LOW_AND_ABOVE",
|
|
32
|
+
BLOCK_LOW_AND_ABOVE: "BLOCK_LOW_AND_ABOVE",
|
|
33
|
+
Off: "OFF",
|
|
34
|
+
OFF: "OFF",
|
|
35
|
+
BLOCK_OFF: "OFF"
|
|
35
36
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
BLOCK_NONE: "BLOCK_NONE",
|
|
40
|
-
Few: "BLOCK_ONLY_HIGH",
|
|
41
|
-
FEW: "BLOCK_ONLY_HIGH",
|
|
42
|
-
BLOCK_ONLY_HIGH: "BLOCK_ONLY_HIGH",
|
|
43
|
-
Some: "BLOCK_MEDIUM_AND_ABOVE",
|
|
44
|
-
SOME: "BLOCK_MEDIUM_AND_ABOVE",
|
|
45
|
-
BLOCK_MEDIUM_AND_ABOVE: "BLOCK_MEDIUM_AND_ABOVE",
|
|
46
|
-
Most: "BLOCK_LOW_AND_ABOVE",
|
|
47
|
-
MOST: "BLOCK_LOW_AND_ABOVE",
|
|
48
|
-
BLOCK_LOW_AND_ABOVE: "BLOCK_LOW_AND_ABOVE",
|
|
49
|
-
Off: "OFF",
|
|
50
|
-
OFF: "OFF",
|
|
51
|
-
BLOCK_OFF: "OFF",
|
|
37
|
+
const GoogleAISafetyMethod = {
|
|
38
|
+
Severity: "SEVERITY",
|
|
39
|
+
Probability: "PROBABILITY"
|
|
52
40
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"googleSearch",
|
|
60
|
-
];
|
|
61
|
-
exports.GeminiToolAttributes = [
|
|
62
|
-
"functionDeclaration",
|
|
63
|
-
"retrieval",
|
|
64
|
-
"urlContext",
|
|
65
|
-
...exports.GeminiSearchToolAttributes,
|
|
41
|
+
const GeminiSearchToolAttributes = ["googleSearchRetrieval", "googleSearch"];
|
|
42
|
+
const GeminiToolAttributes = [
|
|
43
|
+
"functionDeclaration",
|
|
44
|
+
"retrieval",
|
|
45
|
+
"urlContext",
|
|
46
|
+
...GeminiSearchToolAttributes
|
|
66
47
|
];
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
exports.GeminiSearchToolAttributes = GeminiSearchToolAttributes;
|
|
51
|
+
exports.GeminiToolAttributes = GeminiToolAttributes;
|
|
52
|
+
exports.GoogleAISafetyCategory = GoogleAISafetyCategory;
|
|
53
|
+
exports.GoogleAISafetyMethod = GoogleAISafetyMethod;
|
|
54
|
+
exports.GoogleAISafetyThreshold = GoogleAISafetyThreshold;
|
|
55
|
+
//# sourceMappingURL=types.cjs.map
|