@opencode/ai 2.0.3 → 2.0.4
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/dist/cache-policy.js +10 -2
- package/dist/effort-updates.d.ts +12 -0
- package/dist/effort-updates.js +23 -0
- package/dist/protocols/alibaba-messages.d.ts +4 -1
- package/dist/protocols/alibaba-responses.d.ts +3 -1
- package/dist/protocols/anthropic-messages.d.ts +11 -2
- package/dist/protocols/anthropic-messages.js +48 -17
- package/dist/protocols/bedrock-converse.js +17 -12
- package/dist/protocols/meta-messages.d.ts +4 -1
- package/dist/protocols/meta-responses.d.ts +8 -4
- package/dist/protocols/mistral-chat.js +5 -33
- package/dist/protocols/open-responses-channel.js +4 -0
- package/dist/protocols/open-responses.d.ts +27 -9
- package/dist/protocols/open-responses.js +24 -8
- package/dist/protocols/openai-chat.d.ts +7 -7
- package/dist/protocols/openai-chat.js +10 -4
- package/dist/protocols/openai-compatible-chat.d.ts +1 -1
- package/dist/protocols/openai-compatible-responses.d.ts +4 -2
- package/dist/protocols/openai-responses.d.ts +74 -31
- package/dist/protocols/openai-responses.js +27 -6
- package/dist/protocols/utils/bedrock-media.d.ts +10 -8
- package/dist/protocols/utils/bedrock-media.js +29 -5
- package/dist/protocols/utils/mistral-tool-id.d.ts +5 -0
- package/dist/protocols/utils/mistral-tool-id.js +31 -0
- package/dist/protocols/utils/open-responses-options.d.ts +2 -4
- package/dist/protocols/utils/open-responses-options.js +2 -2
- package/dist/protocols/utils/responses-compaction.js +3 -1
- package/dist/protocols/xai-responses.d.ts +4 -2
- package/dist/protocols/zai-chat.d.ts +1 -1
- package/dist/protocols/zai-messages.d.ts +4 -1
- package/dist/provider-error.js +40 -4
- package/dist/providers/alibaba.d.ts +15 -10
- package/dist/providers/amazon-bedrock-mantle.d.ts +5 -3
- package/dist/providers/anthropic-compatible.d.ts +4 -1
- package/dist/providers/anthropic.d.ts +4 -1
- package/dist/providers/azure.d.ts +19 -5
- package/dist/providers/azure.js +1 -8
- package/dist/providers/baseten.d.ts +2 -2
- package/dist/providers/cerebras.d.ts +2 -2
- package/dist/providers/cerebras.js +1 -1
- package/dist/providers/cloudflare-ai-gateway.d.ts +1024 -13
- package/dist/providers/cloudflare-ai-gateway.js +64 -27
- package/dist/providers/cloudflare-workers-ai.d.ts +3 -3
- package/dist/providers/cloudflare-workers-ai.js +1 -1
- package/dist/providers/deepinfra.d.ts +2 -2
- package/dist/providers/deepinfra.js +1 -1
- package/dist/providers/deepseek.d.ts +2 -2
- package/dist/providers/fireworks.d.ts +2 -2
- package/dist/providers/fireworks.js +1 -1
- package/dist/providers/google-vertex-chat.d.ts +1 -1
- package/dist/providers/google-vertex-messages.d.ts +4 -1
- package/dist/providers/google-vertex-responses.d.ts +4 -2
- package/dist/providers/google-vertex.js +5 -1
- package/dist/providers/groq.d.ts +2 -2
- package/dist/providers/meta.d.ts +9 -4
- package/dist/providers/meta.js +1 -1
- package/dist/providers/minimax.d.ts +9 -4
- package/dist/providers/moonshot.d.ts +9 -4
- package/dist/providers/moonshot.js +1 -0
- package/dist/providers/openai-compatible-responses.d.ts +4 -2
- package/dist/providers/openai-compatible.d.ts +1 -1
- package/dist/providers/openai.d.ts +10 -3
- package/dist/providers/openai.js +4 -1
- package/dist/providers/openrouter.d.ts +4 -4
- package/dist/providers/openrouter.js +1 -1
- package/dist/providers/togetherai.d.ts +2 -2
- package/dist/providers/xai.d.ts +1 -1
- package/dist/providers/zai-coding-plan.d.ts +9 -4
- package/dist/providers/zai.d.ts +1 -1
- package/dist/route/client.d.ts +1 -0
- package/dist/route/client.js +3 -1
- package/dist/route/protocol.d.ts +2 -0
- package/dist/schema/messages.d.ts +22 -3
- package/dist/schema/messages.js +9 -1
- package/dist/schema/options.d.ts +6 -0
- package/dist/schema/options.js +7 -0
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Config, type Redacted } from "effect";
|
|
2
2
|
import type { ProviderPackage } from "../provider-package.js";
|
|
3
3
|
import type { AtLeastOne, ProviderAuthOption } from "../route/auth-options.js";
|
|
4
|
-
import {
|
|
4
|
+
import type { RouteDefaultsInput } from "../route/client.js";
|
|
5
5
|
import { type ModelID } from "../schema/index.js";
|
|
6
6
|
import type { OpenAIProviderOptionsInput } from "./openai-options.js";
|
|
7
7
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
@@ -9,20 +9,529 @@ export declare const authEnvVars: readonly ["CLOUDFLARE_API_TOKEN", "CF_AIG_TOKE
|
|
|
9
9
|
type GatewayURL = AtLeastOne<{
|
|
10
10
|
readonly accountId: string;
|
|
11
11
|
readonly baseURL: string;
|
|
12
|
-
}
|
|
12
|
+
}>;
|
|
13
|
+
type GatewayOptions = {
|
|
13
14
|
readonly gatewayId?: string;
|
|
15
|
+
readonly metadata?: unknown;
|
|
16
|
+
readonly cacheTtl?: number;
|
|
17
|
+
readonly cacheKey?: string;
|
|
18
|
+
readonly skipCache?: boolean;
|
|
19
|
+
readonly collectLog?: boolean;
|
|
14
20
|
};
|
|
15
|
-
export type LanguageModelOptions = GatewayURL & Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
16
|
-
/** Cloudflare AI Gateway authentication token. Sent as `cf-aig-authorization`. */
|
|
21
|
+
export type LanguageModelOptions = GatewayURL & GatewayOptions & Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
17
22
|
readonly gatewayApiKey?: string | Redacted.Redacted | Config.Config<string | Redacted.Redacted>;
|
|
18
23
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
19
24
|
};
|
|
20
|
-
export type Settings = ProviderPackage.Settings & OpenAIProviderOptionsInput & GatewayURL & {
|
|
25
|
+
export type Settings = ProviderPackage.Settings & OpenAIProviderOptionsInput & GatewayURL & GatewayOptions & {
|
|
21
26
|
readonly apiKey?: string;
|
|
22
27
|
readonly gatewayApiKey?: string;
|
|
23
28
|
};
|
|
24
29
|
export declare const baseURL: (input: GatewayURL) => string;
|
|
25
|
-
export declare const
|
|
30
|
+
export declare const responsesRoute: import("../route/client.js").Route<{
|
|
31
|
+
readonly input: readonly ({
|
|
32
|
+
readonly [x: string]: unknown;
|
|
33
|
+
readonly id: string;
|
|
34
|
+
readonly type: "web_search_call";
|
|
35
|
+
readonly status?: string | undefined;
|
|
36
|
+
readonly action?: {
|
|
37
|
+
readonly [x: string]: unknown;
|
|
38
|
+
} | null | undefined;
|
|
39
|
+
} | {
|
|
40
|
+
readonly [x: string]: unknown;
|
|
41
|
+
readonly id: string;
|
|
42
|
+
readonly type: "file_search_call";
|
|
43
|
+
readonly status?: string | undefined;
|
|
44
|
+
readonly queries?: readonly string[] | undefined;
|
|
45
|
+
readonly results?: readonly {
|
|
46
|
+
readonly [x: string]: unknown;
|
|
47
|
+
}[] | null | undefined;
|
|
48
|
+
} | {
|
|
49
|
+
readonly [x: string]: unknown;
|
|
50
|
+
readonly id: string;
|
|
51
|
+
readonly type: "code_interpreter_call";
|
|
52
|
+
readonly status?: string | undefined;
|
|
53
|
+
readonly code?: string | null | undefined;
|
|
54
|
+
readonly container_id?: string | null | undefined;
|
|
55
|
+
readonly outputs?: readonly {
|
|
56
|
+
readonly [x: string]: unknown;
|
|
57
|
+
}[] | null | undefined;
|
|
58
|
+
} | {
|
|
59
|
+
readonly [x: string]: unknown;
|
|
60
|
+
readonly id: string;
|
|
61
|
+
readonly type: "mcp_call";
|
|
62
|
+
readonly status?: string | undefined;
|
|
63
|
+
readonly name?: string | undefined;
|
|
64
|
+
readonly output?: string | null | undefined;
|
|
65
|
+
readonly error?: unknown;
|
|
66
|
+
readonly arguments?: string | undefined;
|
|
67
|
+
readonly server_label?: string | undefined;
|
|
68
|
+
} | {
|
|
69
|
+
readonly type: "configuration_update";
|
|
70
|
+
readonly reasoning: {
|
|
71
|
+
readonly effort: import("../schema/options.js").ReasoningEffort;
|
|
72
|
+
};
|
|
73
|
+
} | {
|
|
74
|
+
readonly type: "reasoning";
|
|
75
|
+
readonly summary: readonly {
|
|
76
|
+
readonly type: "summary_text";
|
|
77
|
+
readonly text: string;
|
|
78
|
+
}[];
|
|
79
|
+
readonly id?: string | undefined;
|
|
80
|
+
readonly encrypted_content?: string | null | undefined;
|
|
81
|
+
} | {
|
|
82
|
+
readonly type: "compaction";
|
|
83
|
+
readonly encrypted_content: string;
|
|
84
|
+
readonly id?: string | null | undefined;
|
|
85
|
+
} | {
|
|
86
|
+
readonly type: "message";
|
|
87
|
+
readonly role: "system";
|
|
88
|
+
readonly content: string;
|
|
89
|
+
} | {
|
|
90
|
+
readonly type: "message";
|
|
91
|
+
readonly role: "developer";
|
|
92
|
+
readonly content: string;
|
|
93
|
+
} | {
|
|
94
|
+
readonly type: "message";
|
|
95
|
+
readonly content: readonly ({
|
|
96
|
+
readonly type: "input_image";
|
|
97
|
+
readonly image_url: string;
|
|
98
|
+
readonly detail?: string | undefined;
|
|
99
|
+
} | {
|
|
100
|
+
readonly type: "input_file";
|
|
101
|
+
readonly filename: string;
|
|
102
|
+
readonly detail?: string | undefined;
|
|
103
|
+
readonly file_data?: string | undefined;
|
|
104
|
+
readonly file_url?: string | undefined;
|
|
105
|
+
} | {
|
|
106
|
+
readonly type: "input_text";
|
|
107
|
+
readonly text: string;
|
|
108
|
+
})[];
|
|
109
|
+
readonly role: "user";
|
|
110
|
+
readonly id?: string | undefined;
|
|
111
|
+
readonly status?: string | undefined;
|
|
112
|
+
} | {
|
|
113
|
+
readonly type: "message";
|
|
114
|
+
readonly content: readonly {
|
|
115
|
+
readonly type: "output_text";
|
|
116
|
+
readonly text: string;
|
|
117
|
+
}[];
|
|
118
|
+
readonly role: "assistant";
|
|
119
|
+
readonly id?: string | undefined;
|
|
120
|
+
readonly status?: string | undefined;
|
|
121
|
+
readonly phase?: "commentary" | "final_answer" | null | undefined;
|
|
122
|
+
} | {
|
|
123
|
+
readonly type: "function_call";
|
|
124
|
+
readonly name: string;
|
|
125
|
+
readonly arguments: string;
|
|
126
|
+
readonly call_id: string;
|
|
127
|
+
readonly id?: string | undefined;
|
|
128
|
+
readonly namespace?: string | undefined;
|
|
129
|
+
} | {
|
|
130
|
+
readonly type: "function_call_output";
|
|
131
|
+
readonly call_id: string;
|
|
132
|
+
readonly output: string | readonly ({
|
|
133
|
+
readonly type: "input_image";
|
|
134
|
+
readonly image_url: string;
|
|
135
|
+
readonly detail?: string | undefined;
|
|
136
|
+
} | {
|
|
137
|
+
readonly type: "input_file";
|
|
138
|
+
readonly filename: string;
|
|
139
|
+
readonly detail?: string | undefined;
|
|
140
|
+
readonly file_data?: string | undefined;
|
|
141
|
+
readonly file_url?: string | undefined;
|
|
142
|
+
} | {
|
|
143
|
+
readonly type: "input_text";
|
|
144
|
+
readonly text: string;
|
|
145
|
+
} | {
|
|
146
|
+
readonly type: "input_video";
|
|
147
|
+
readonly video_url: string;
|
|
148
|
+
})[];
|
|
149
|
+
} | {
|
|
150
|
+
readonly [x: string]: unknown;
|
|
151
|
+
readonly id: string;
|
|
152
|
+
readonly type: "computer_call";
|
|
153
|
+
readonly status?: string | undefined;
|
|
154
|
+
readonly action?: {
|
|
155
|
+
readonly [x: string]: unknown;
|
|
156
|
+
} | null | undefined;
|
|
157
|
+
readonly call_id?: string | undefined;
|
|
158
|
+
readonly pending_safety_checks?: readonly {
|
|
159
|
+
readonly [x: string]: unknown;
|
|
160
|
+
}[] | undefined;
|
|
161
|
+
} | {
|
|
162
|
+
readonly [x: string]: unknown;
|
|
163
|
+
readonly id: string;
|
|
164
|
+
readonly type: "web_search_preview_call";
|
|
165
|
+
readonly status?: string | undefined;
|
|
166
|
+
readonly action?: {
|
|
167
|
+
readonly [x: string]: unknown;
|
|
168
|
+
} | null | undefined;
|
|
169
|
+
} | {
|
|
170
|
+
readonly [x: string]: unknown;
|
|
171
|
+
readonly id: string;
|
|
172
|
+
readonly type: "image_generation_call";
|
|
173
|
+
readonly status?: string | undefined;
|
|
174
|
+
readonly result?: string | null | undefined;
|
|
175
|
+
readonly revised_prompt?: string | null | undefined;
|
|
176
|
+
readonly output_format?: "png" | "jpeg" | "webp" | undefined;
|
|
177
|
+
})[];
|
|
178
|
+
readonly model: string;
|
|
179
|
+
readonly stream: true;
|
|
180
|
+
readonly metadata?: {
|
|
181
|
+
readonly [x: string]: string;
|
|
182
|
+
} | undefined;
|
|
183
|
+
readonly instructions?: string | undefined;
|
|
184
|
+
readonly reasoning?: {
|
|
185
|
+
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
186
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
187
|
+
} | undefined;
|
|
188
|
+
readonly tools?: readonly ({
|
|
189
|
+
readonly type: "function";
|
|
190
|
+
readonly description: string;
|
|
191
|
+
readonly name: string;
|
|
192
|
+
readonly parameters: {
|
|
193
|
+
readonly [x: string]: unknown;
|
|
194
|
+
};
|
|
195
|
+
readonly strict?: boolean | undefined;
|
|
196
|
+
} | {
|
|
197
|
+
readonly type: "image_generation";
|
|
198
|
+
readonly size?: string | undefined;
|
|
199
|
+
readonly action?: "generate" | "auto" | "edit" | undefined;
|
|
200
|
+
readonly output_format?: "png" | "jpeg" | "webp" | undefined;
|
|
201
|
+
readonly quality?: "auto" | "low" | "medium" | "high" | undefined;
|
|
202
|
+
readonly background?: "auto" | "opaque" | "transparent" | undefined;
|
|
203
|
+
readonly output_compression?: number | undefined;
|
|
204
|
+
readonly input_fidelity?: "low" | "high" | undefined;
|
|
205
|
+
readonly partial_images?: number | undefined;
|
|
206
|
+
} | {
|
|
207
|
+
readonly type: "namespace";
|
|
208
|
+
readonly name: string;
|
|
209
|
+
readonly description: string;
|
|
210
|
+
readonly tools: readonly {
|
|
211
|
+
readonly type: "function";
|
|
212
|
+
readonly description: string;
|
|
213
|
+
readonly name: string;
|
|
214
|
+
readonly parameters: {
|
|
215
|
+
readonly [x: string]: unknown;
|
|
216
|
+
};
|
|
217
|
+
readonly strict?: boolean | undefined;
|
|
218
|
+
}[];
|
|
219
|
+
})[] | undefined;
|
|
220
|
+
readonly text?: {
|
|
221
|
+
readonly verbosity?: import("../protocols/utils/open-responses-options.js").TextVerbosity | undefined;
|
|
222
|
+
} | undefined;
|
|
223
|
+
readonly temperature?: number | undefined;
|
|
224
|
+
readonly service_tier?: import("../protocols/utils/open-responses-options.js").ServiceTier | undefined;
|
|
225
|
+
readonly context_management?: readonly {
|
|
226
|
+
readonly type: "compaction";
|
|
227
|
+
readonly compact_threshold?: number | undefined;
|
|
228
|
+
}[] | undefined;
|
|
229
|
+
readonly tool_choice?: "required" | "auto" | "none" | {
|
|
230
|
+
readonly type: "function";
|
|
231
|
+
readonly name: string;
|
|
232
|
+
} | {
|
|
233
|
+
readonly type: "allowed_tools";
|
|
234
|
+
readonly mode: "required" | "auto" | "none";
|
|
235
|
+
readonly tools: readonly {
|
|
236
|
+
readonly type: "function";
|
|
237
|
+
readonly name: string;
|
|
238
|
+
}[];
|
|
239
|
+
} | {
|
|
240
|
+
readonly type: "image_generation";
|
|
241
|
+
} | undefined;
|
|
242
|
+
readonly top_p?: number | undefined;
|
|
243
|
+
readonly frequency_penalty?: number | undefined;
|
|
244
|
+
readonly presence_penalty?: number | undefined;
|
|
245
|
+
readonly prompt_cache_key?: string | undefined;
|
|
246
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
247
|
+
readonly store?: boolean | undefined;
|
|
248
|
+
readonly include?: readonly import("../protocols/utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
249
|
+
readonly truncation?: "auto" | "disabled" | undefined;
|
|
250
|
+
readonly stream_options?: {
|
|
251
|
+
readonly include_obfuscation?: boolean | undefined;
|
|
252
|
+
} | undefined;
|
|
253
|
+
readonly safety_identifier?: string | undefined;
|
|
254
|
+
readonly top_logprobs?: number | undefined;
|
|
255
|
+
readonly max_output_tokens?: number | undefined;
|
|
256
|
+
readonly max_tool_calls?: number | undefined;
|
|
257
|
+
}, import("../protocols/open-responses-channel.js").Prepared, {
|
|
258
|
+
endpoint: import("../route/client.js").CompactOperation;
|
|
259
|
+
trigger: import("../route/client.js").TriggerCompactOperation;
|
|
260
|
+
}>;
|
|
261
|
+
export declare const messagesRoute: import("../route/client.js").Route<{
|
|
262
|
+
readonly max_tokens: number;
|
|
263
|
+
readonly model: string;
|
|
264
|
+
readonly messages: readonly ({
|
|
265
|
+
readonly role: "user";
|
|
266
|
+
readonly content: readonly ({
|
|
267
|
+
readonly type: "text";
|
|
268
|
+
readonly text: string;
|
|
269
|
+
readonly cache_control?: {
|
|
270
|
+
readonly type: "ephemeral";
|
|
271
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
272
|
+
} | undefined;
|
|
273
|
+
} | {
|
|
274
|
+
readonly type: "image";
|
|
275
|
+
readonly source: {
|
|
276
|
+
readonly type: "base64";
|
|
277
|
+
readonly media_type: string;
|
|
278
|
+
readonly data: string;
|
|
279
|
+
} | {
|
|
280
|
+
readonly type: "url";
|
|
281
|
+
readonly url: string;
|
|
282
|
+
} | {
|
|
283
|
+
readonly type: "file";
|
|
284
|
+
readonly file_id: string;
|
|
285
|
+
};
|
|
286
|
+
readonly cache_control?: {
|
|
287
|
+
readonly type: "ephemeral";
|
|
288
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
289
|
+
} | undefined;
|
|
290
|
+
readonly transformations?: {
|
|
291
|
+
readonly oversized_image?: "error" | "downsize" | undefined;
|
|
292
|
+
} | undefined;
|
|
293
|
+
} | {
|
|
294
|
+
readonly type: "document";
|
|
295
|
+
readonly source: {
|
|
296
|
+
readonly type: "base64";
|
|
297
|
+
readonly media_type: "application/pdf";
|
|
298
|
+
readonly data: string;
|
|
299
|
+
} | {
|
|
300
|
+
readonly type: "text";
|
|
301
|
+
readonly media_type: "text/plain";
|
|
302
|
+
readonly data: string;
|
|
303
|
+
} | {
|
|
304
|
+
readonly type: "url";
|
|
305
|
+
readonly url: string;
|
|
306
|
+
} | {
|
|
307
|
+
readonly type: "file";
|
|
308
|
+
readonly file_id: string;
|
|
309
|
+
};
|
|
310
|
+
readonly title?: string | undefined;
|
|
311
|
+
readonly context?: string | undefined;
|
|
312
|
+
readonly cache_control?: {
|
|
313
|
+
readonly type: "ephemeral";
|
|
314
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
315
|
+
} | undefined;
|
|
316
|
+
readonly citations?: {
|
|
317
|
+
readonly enabled: boolean;
|
|
318
|
+
} | undefined;
|
|
319
|
+
} | {
|
|
320
|
+
readonly type: "tool_result";
|
|
321
|
+
readonly content: string | readonly ({
|
|
322
|
+
readonly type: "text";
|
|
323
|
+
readonly text: string;
|
|
324
|
+
readonly cache_control?: {
|
|
325
|
+
readonly type: "ephemeral";
|
|
326
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
327
|
+
} | undefined;
|
|
328
|
+
} | {
|
|
329
|
+
readonly type: "image";
|
|
330
|
+
readonly source: {
|
|
331
|
+
readonly type: "base64";
|
|
332
|
+
readonly media_type: string;
|
|
333
|
+
readonly data: string;
|
|
334
|
+
} | {
|
|
335
|
+
readonly type: "url";
|
|
336
|
+
readonly url: string;
|
|
337
|
+
} | {
|
|
338
|
+
readonly type: "file";
|
|
339
|
+
readonly file_id: string;
|
|
340
|
+
};
|
|
341
|
+
readonly cache_control?: {
|
|
342
|
+
readonly type: "ephemeral";
|
|
343
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
344
|
+
} | undefined;
|
|
345
|
+
readonly transformations?: {
|
|
346
|
+
readonly oversized_image?: "error" | "downsize" | undefined;
|
|
347
|
+
} | undefined;
|
|
348
|
+
} | {
|
|
349
|
+
readonly type: "document";
|
|
350
|
+
readonly source: {
|
|
351
|
+
readonly type: "base64";
|
|
352
|
+
readonly media_type: "application/pdf";
|
|
353
|
+
readonly data: string;
|
|
354
|
+
} | {
|
|
355
|
+
readonly type: "text";
|
|
356
|
+
readonly media_type: "text/plain";
|
|
357
|
+
readonly data: string;
|
|
358
|
+
} | {
|
|
359
|
+
readonly type: "url";
|
|
360
|
+
readonly url: string;
|
|
361
|
+
} | {
|
|
362
|
+
readonly type: "file";
|
|
363
|
+
readonly file_id: string;
|
|
364
|
+
};
|
|
365
|
+
readonly title?: string | undefined;
|
|
366
|
+
readonly context?: string | undefined;
|
|
367
|
+
readonly cache_control?: {
|
|
368
|
+
readonly type: "ephemeral";
|
|
369
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
370
|
+
} | undefined;
|
|
371
|
+
readonly citations?: {
|
|
372
|
+
readonly enabled: boolean;
|
|
373
|
+
} | undefined;
|
|
374
|
+
})[];
|
|
375
|
+
readonly tool_use_id: string;
|
|
376
|
+
readonly cache_control?: {
|
|
377
|
+
readonly type: "ephemeral";
|
|
378
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
379
|
+
} | undefined;
|
|
380
|
+
readonly is_error?: boolean | undefined;
|
|
381
|
+
})[];
|
|
382
|
+
} | {
|
|
383
|
+
readonly role: "assistant";
|
|
384
|
+
readonly content: readonly ({
|
|
385
|
+
readonly type: "text";
|
|
386
|
+
readonly text: string;
|
|
387
|
+
readonly cache_control?: {
|
|
388
|
+
readonly type: "ephemeral";
|
|
389
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
390
|
+
} | undefined;
|
|
391
|
+
} | {
|
|
392
|
+
readonly id: string;
|
|
393
|
+
readonly type: "tool_use";
|
|
394
|
+
readonly name: string;
|
|
395
|
+
readonly input: unknown;
|
|
396
|
+
readonly cache_control?: {
|
|
397
|
+
readonly type: "ephemeral";
|
|
398
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
399
|
+
} | undefined;
|
|
400
|
+
} | {
|
|
401
|
+
readonly id: string;
|
|
402
|
+
readonly type: "server_tool_use";
|
|
403
|
+
readonly name: string;
|
|
404
|
+
readonly input: unknown;
|
|
405
|
+
readonly cache_control?: {
|
|
406
|
+
readonly type: "ephemeral";
|
|
407
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
408
|
+
} | undefined;
|
|
409
|
+
} | {
|
|
410
|
+
readonly type: "web_search_tool_result" | "code_execution_tool_result" | "web_fetch_tool_result";
|
|
411
|
+
readonly content: unknown;
|
|
412
|
+
readonly tool_use_id: string;
|
|
413
|
+
readonly cache_control?: {
|
|
414
|
+
readonly type: "ephemeral";
|
|
415
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
416
|
+
} | undefined;
|
|
417
|
+
} | {
|
|
418
|
+
readonly type: "thinking";
|
|
419
|
+
readonly thinking: string;
|
|
420
|
+
readonly signature: string;
|
|
421
|
+
readonly cache_control?: {
|
|
422
|
+
readonly type: "ephemeral";
|
|
423
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
424
|
+
} | undefined;
|
|
425
|
+
} | {
|
|
426
|
+
readonly data: string;
|
|
427
|
+
readonly type: "redacted_thinking";
|
|
428
|
+
readonly cache_control?: {
|
|
429
|
+
readonly type: "ephemeral";
|
|
430
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
431
|
+
} | undefined;
|
|
432
|
+
} | {
|
|
433
|
+
readonly type: "compaction";
|
|
434
|
+
readonly content: string | null;
|
|
435
|
+
})[];
|
|
436
|
+
} | {
|
|
437
|
+
readonly content: readonly {
|
|
438
|
+
readonly type: "text";
|
|
439
|
+
readonly text: string;
|
|
440
|
+
readonly cache_control?: {
|
|
441
|
+
readonly type: "ephemeral";
|
|
442
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
443
|
+
} | undefined;
|
|
444
|
+
}[];
|
|
445
|
+
readonly role: "system";
|
|
446
|
+
readonly output_config?: {
|
|
447
|
+
readonly effort: string;
|
|
448
|
+
} | undefined;
|
|
449
|
+
})[];
|
|
450
|
+
readonly stream: true;
|
|
451
|
+
readonly metadata?: {
|
|
452
|
+
readonly user_id?: string | null | undefined;
|
|
453
|
+
} | undefined;
|
|
454
|
+
readonly tools?: readonly {
|
|
455
|
+
readonly description: string;
|
|
456
|
+
readonly name: string;
|
|
457
|
+
readonly input_schema: {
|
|
458
|
+
readonly [x: string]: unknown;
|
|
459
|
+
};
|
|
460
|
+
readonly cache_control?: {
|
|
461
|
+
readonly type: "ephemeral";
|
|
462
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
463
|
+
} | undefined;
|
|
464
|
+
}[] | undefined;
|
|
465
|
+
readonly system?: readonly {
|
|
466
|
+
readonly type: "text";
|
|
467
|
+
readonly text: string;
|
|
468
|
+
readonly cache_control?: {
|
|
469
|
+
readonly type: "ephemeral";
|
|
470
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
471
|
+
} | undefined;
|
|
472
|
+
}[] | undefined;
|
|
473
|
+
readonly temperature?: number | undefined;
|
|
474
|
+
readonly thinking?: {
|
|
475
|
+
readonly type: "enabled";
|
|
476
|
+
readonly budget_tokens: number;
|
|
477
|
+
readonly display?: "summarized" | "omitted" | undefined;
|
|
478
|
+
readonly block_binding?: {
|
|
479
|
+
readonly prefix_mismatch_behavior?: string | undefined;
|
|
480
|
+
} | undefined;
|
|
481
|
+
} | {
|
|
482
|
+
readonly type: "adaptive";
|
|
483
|
+
readonly display?: "summarized" | "omitted" | undefined;
|
|
484
|
+
readonly block_binding?: {
|
|
485
|
+
readonly prefix_mismatch_behavior?: string | undefined;
|
|
486
|
+
} | undefined;
|
|
487
|
+
} | {
|
|
488
|
+
readonly type: "disabled";
|
|
489
|
+
} | undefined;
|
|
490
|
+
readonly service_tier?: "auto" | "standard_only" | undefined;
|
|
491
|
+
readonly container?: string | {
|
|
492
|
+
readonly id?: string | null | undefined;
|
|
493
|
+
readonly skills?: readonly {
|
|
494
|
+
readonly [x: string]: unknown;
|
|
495
|
+
}[] | null | undefined;
|
|
496
|
+
} | null | undefined;
|
|
497
|
+
readonly inference_geo?: string | null | undefined;
|
|
498
|
+
readonly cache_control?: {
|
|
499
|
+
readonly type: "ephemeral";
|
|
500
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
501
|
+
} | undefined;
|
|
502
|
+
readonly output_config?: {
|
|
503
|
+
readonly format?: {
|
|
504
|
+
readonly type: "json_schema";
|
|
505
|
+
readonly schema: {
|
|
506
|
+
readonly [x: string]: unknown;
|
|
507
|
+
};
|
|
508
|
+
} | null | undefined;
|
|
509
|
+
readonly effort?: string | undefined;
|
|
510
|
+
} | undefined;
|
|
511
|
+
readonly context_management?: {
|
|
512
|
+
readonly edits: readonly {
|
|
513
|
+
readonly type: "compact_20260112";
|
|
514
|
+
readonly instructions?: string | undefined;
|
|
515
|
+
readonly trigger?: {
|
|
516
|
+
readonly type: "input_tokens";
|
|
517
|
+
readonly value: number;
|
|
518
|
+
} | undefined;
|
|
519
|
+
readonly pause_after_compaction?: boolean | undefined;
|
|
520
|
+
}[];
|
|
521
|
+
} | undefined;
|
|
522
|
+
readonly tool_choice?: {
|
|
523
|
+
readonly type: "auto" | "none" | "any";
|
|
524
|
+
readonly disable_parallel_tool_use?: boolean | undefined;
|
|
525
|
+
} | {
|
|
526
|
+
readonly type: "tool";
|
|
527
|
+
readonly name: string;
|
|
528
|
+
readonly disable_parallel_tool_use?: boolean | undefined;
|
|
529
|
+
} | undefined;
|
|
530
|
+
readonly top_p?: number | undefined;
|
|
531
|
+
readonly top_k?: number | undefined;
|
|
532
|
+
readonly stop_sequences?: readonly string[] | undefined;
|
|
533
|
+
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>;
|
|
534
|
+
export declare const route: import("../route/client.js").Route<{
|
|
26
535
|
readonly model: string;
|
|
27
536
|
readonly messages: readonly ({
|
|
28
537
|
readonly role: "system";
|
|
@@ -114,14 +623,286 @@ export declare const route: Route<{
|
|
|
114
623
|
readonly frequency_penalty?: number | undefined;
|
|
115
624
|
readonly presence_penalty?: number | undefined;
|
|
116
625
|
readonly prompt_cache_key?: string | undefined;
|
|
117
|
-
readonly reasoning_effort?: import("../
|
|
626
|
+
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
118
627
|
readonly store?: boolean | undefined;
|
|
119
628
|
readonly stream_options?: {
|
|
120
629
|
readonly include_usage: boolean;
|
|
121
630
|
} | undefined;
|
|
122
631
|
readonly tool_stream?: boolean | undefined;
|
|
123
632
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>;
|
|
124
|
-
export declare const routes: Route<{
|
|
633
|
+
export declare const routes: (import("../route/client.js").Route<{
|
|
634
|
+
readonly max_tokens: number;
|
|
635
|
+
readonly model: string;
|
|
636
|
+
readonly messages: readonly ({
|
|
637
|
+
readonly role: "user";
|
|
638
|
+
readonly content: readonly ({
|
|
639
|
+
readonly type: "text";
|
|
640
|
+
readonly text: string;
|
|
641
|
+
readonly cache_control?: {
|
|
642
|
+
readonly type: "ephemeral";
|
|
643
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
644
|
+
} | undefined;
|
|
645
|
+
} | {
|
|
646
|
+
readonly type: "image";
|
|
647
|
+
readonly source: {
|
|
648
|
+
readonly type: "base64";
|
|
649
|
+
readonly media_type: string;
|
|
650
|
+
readonly data: string;
|
|
651
|
+
} | {
|
|
652
|
+
readonly type: "url";
|
|
653
|
+
readonly url: string;
|
|
654
|
+
} | {
|
|
655
|
+
readonly type: "file";
|
|
656
|
+
readonly file_id: string;
|
|
657
|
+
};
|
|
658
|
+
readonly cache_control?: {
|
|
659
|
+
readonly type: "ephemeral";
|
|
660
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
661
|
+
} | undefined;
|
|
662
|
+
readonly transformations?: {
|
|
663
|
+
readonly oversized_image?: "error" | "downsize" | undefined;
|
|
664
|
+
} | undefined;
|
|
665
|
+
} | {
|
|
666
|
+
readonly type: "document";
|
|
667
|
+
readonly source: {
|
|
668
|
+
readonly type: "base64";
|
|
669
|
+
readonly media_type: "application/pdf";
|
|
670
|
+
readonly data: string;
|
|
671
|
+
} | {
|
|
672
|
+
readonly type: "text";
|
|
673
|
+
readonly media_type: "text/plain";
|
|
674
|
+
readonly data: string;
|
|
675
|
+
} | {
|
|
676
|
+
readonly type: "url";
|
|
677
|
+
readonly url: string;
|
|
678
|
+
} | {
|
|
679
|
+
readonly type: "file";
|
|
680
|
+
readonly file_id: string;
|
|
681
|
+
};
|
|
682
|
+
readonly title?: string | undefined;
|
|
683
|
+
readonly context?: string | undefined;
|
|
684
|
+
readonly cache_control?: {
|
|
685
|
+
readonly type: "ephemeral";
|
|
686
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
687
|
+
} | undefined;
|
|
688
|
+
readonly citations?: {
|
|
689
|
+
readonly enabled: boolean;
|
|
690
|
+
} | undefined;
|
|
691
|
+
} | {
|
|
692
|
+
readonly type: "tool_result";
|
|
693
|
+
readonly content: string | readonly ({
|
|
694
|
+
readonly type: "text";
|
|
695
|
+
readonly text: string;
|
|
696
|
+
readonly cache_control?: {
|
|
697
|
+
readonly type: "ephemeral";
|
|
698
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
699
|
+
} | undefined;
|
|
700
|
+
} | {
|
|
701
|
+
readonly type: "image";
|
|
702
|
+
readonly source: {
|
|
703
|
+
readonly type: "base64";
|
|
704
|
+
readonly media_type: string;
|
|
705
|
+
readonly data: string;
|
|
706
|
+
} | {
|
|
707
|
+
readonly type: "url";
|
|
708
|
+
readonly url: string;
|
|
709
|
+
} | {
|
|
710
|
+
readonly type: "file";
|
|
711
|
+
readonly file_id: string;
|
|
712
|
+
};
|
|
713
|
+
readonly cache_control?: {
|
|
714
|
+
readonly type: "ephemeral";
|
|
715
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
716
|
+
} | undefined;
|
|
717
|
+
readonly transformations?: {
|
|
718
|
+
readonly oversized_image?: "error" | "downsize" | undefined;
|
|
719
|
+
} | undefined;
|
|
720
|
+
} | {
|
|
721
|
+
readonly type: "document";
|
|
722
|
+
readonly source: {
|
|
723
|
+
readonly type: "base64";
|
|
724
|
+
readonly media_type: "application/pdf";
|
|
725
|
+
readonly data: string;
|
|
726
|
+
} | {
|
|
727
|
+
readonly type: "text";
|
|
728
|
+
readonly media_type: "text/plain";
|
|
729
|
+
readonly data: string;
|
|
730
|
+
} | {
|
|
731
|
+
readonly type: "url";
|
|
732
|
+
readonly url: string;
|
|
733
|
+
} | {
|
|
734
|
+
readonly type: "file";
|
|
735
|
+
readonly file_id: string;
|
|
736
|
+
};
|
|
737
|
+
readonly title?: string | undefined;
|
|
738
|
+
readonly context?: string | undefined;
|
|
739
|
+
readonly cache_control?: {
|
|
740
|
+
readonly type: "ephemeral";
|
|
741
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
742
|
+
} | undefined;
|
|
743
|
+
readonly citations?: {
|
|
744
|
+
readonly enabled: boolean;
|
|
745
|
+
} | undefined;
|
|
746
|
+
})[];
|
|
747
|
+
readonly tool_use_id: string;
|
|
748
|
+
readonly cache_control?: {
|
|
749
|
+
readonly type: "ephemeral";
|
|
750
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
751
|
+
} | undefined;
|
|
752
|
+
readonly is_error?: boolean | undefined;
|
|
753
|
+
})[];
|
|
754
|
+
} | {
|
|
755
|
+
readonly role: "assistant";
|
|
756
|
+
readonly content: readonly ({
|
|
757
|
+
readonly type: "text";
|
|
758
|
+
readonly text: string;
|
|
759
|
+
readonly cache_control?: {
|
|
760
|
+
readonly type: "ephemeral";
|
|
761
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
762
|
+
} | undefined;
|
|
763
|
+
} | {
|
|
764
|
+
readonly id: string;
|
|
765
|
+
readonly type: "tool_use";
|
|
766
|
+
readonly name: string;
|
|
767
|
+
readonly input: unknown;
|
|
768
|
+
readonly cache_control?: {
|
|
769
|
+
readonly type: "ephemeral";
|
|
770
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
771
|
+
} | undefined;
|
|
772
|
+
} | {
|
|
773
|
+
readonly id: string;
|
|
774
|
+
readonly type: "server_tool_use";
|
|
775
|
+
readonly name: string;
|
|
776
|
+
readonly input: unknown;
|
|
777
|
+
readonly cache_control?: {
|
|
778
|
+
readonly type: "ephemeral";
|
|
779
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
780
|
+
} | undefined;
|
|
781
|
+
} | {
|
|
782
|
+
readonly type: "web_search_tool_result" | "code_execution_tool_result" | "web_fetch_tool_result";
|
|
783
|
+
readonly content: unknown;
|
|
784
|
+
readonly tool_use_id: string;
|
|
785
|
+
readonly cache_control?: {
|
|
786
|
+
readonly type: "ephemeral";
|
|
787
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
788
|
+
} | undefined;
|
|
789
|
+
} | {
|
|
790
|
+
readonly type: "thinking";
|
|
791
|
+
readonly thinking: string;
|
|
792
|
+
readonly signature: string;
|
|
793
|
+
readonly cache_control?: {
|
|
794
|
+
readonly type: "ephemeral";
|
|
795
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
796
|
+
} | undefined;
|
|
797
|
+
} | {
|
|
798
|
+
readonly data: string;
|
|
799
|
+
readonly type: "redacted_thinking";
|
|
800
|
+
readonly cache_control?: {
|
|
801
|
+
readonly type: "ephemeral";
|
|
802
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
803
|
+
} | undefined;
|
|
804
|
+
} | {
|
|
805
|
+
readonly type: "compaction";
|
|
806
|
+
readonly content: string | null;
|
|
807
|
+
})[];
|
|
808
|
+
} | {
|
|
809
|
+
readonly content: readonly {
|
|
810
|
+
readonly type: "text";
|
|
811
|
+
readonly text: string;
|
|
812
|
+
readonly cache_control?: {
|
|
813
|
+
readonly type: "ephemeral";
|
|
814
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
815
|
+
} | undefined;
|
|
816
|
+
}[];
|
|
817
|
+
readonly role: "system";
|
|
818
|
+
readonly output_config?: {
|
|
819
|
+
readonly effort: string;
|
|
820
|
+
} | undefined;
|
|
821
|
+
})[];
|
|
822
|
+
readonly stream: true;
|
|
823
|
+
readonly metadata?: {
|
|
824
|
+
readonly user_id?: string | null | undefined;
|
|
825
|
+
} | undefined;
|
|
826
|
+
readonly tools?: readonly {
|
|
827
|
+
readonly description: string;
|
|
828
|
+
readonly name: string;
|
|
829
|
+
readonly input_schema: {
|
|
830
|
+
readonly [x: string]: unknown;
|
|
831
|
+
};
|
|
832
|
+
readonly cache_control?: {
|
|
833
|
+
readonly type: "ephemeral";
|
|
834
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
835
|
+
} | undefined;
|
|
836
|
+
}[] | undefined;
|
|
837
|
+
readonly system?: readonly {
|
|
838
|
+
readonly type: "text";
|
|
839
|
+
readonly text: string;
|
|
840
|
+
readonly cache_control?: {
|
|
841
|
+
readonly type: "ephemeral";
|
|
842
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
843
|
+
} | undefined;
|
|
844
|
+
}[] | undefined;
|
|
845
|
+
readonly temperature?: number | undefined;
|
|
846
|
+
readonly thinking?: {
|
|
847
|
+
readonly type: "enabled";
|
|
848
|
+
readonly budget_tokens: number;
|
|
849
|
+
readonly display?: "summarized" | "omitted" | undefined;
|
|
850
|
+
readonly block_binding?: {
|
|
851
|
+
readonly prefix_mismatch_behavior?: string | undefined;
|
|
852
|
+
} | undefined;
|
|
853
|
+
} | {
|
|
854
|
+
readonly type: "adaptive";
|
|
855
|
+
readonly display?: "summarized" | "omitted" | undefined;
|
|
856
|
+
readonly block_binding?: {
|
|
857
|
+
readonly prefix_mismatch_behavior?: string | undefined;
|
|
858
|
+
} | undefined;
|
|
859
|
+
} | {
|
|
860
|
+
readonly type: "disabled";
|
|
861
|
+
} | undefined;
|
|
862
|
+
readonly service_tier?: "auto" | "standard_only" | undefined;
|
|
863
|
+
readonly container?: string | {
|
|
864
|
+
readonly id?: string | null | undefined;
|
|
865
|
+
readonly skills?: readonly {
|
|
866
|
+
readonly [x: string]: unknown;
|
|
867
|
+
}[] | null | undefined;
|
|
868
|
+
} | null | undefined;
|
|
869
|
+
readonly inference_geo?: string | null | undefined;
|
|
870
|
+
readonly cache_control?: {
|
|
871
|
+
readonly type: "ephemeral";
|
|
872
|
+
readonly ttl?: "1h" | "5m" | undefined;
|
|
873
|
+
} | undefined;
|
|
874
|
+
readonly output_config?: {
|
|
875
|
+
readonly format?: {
|
|
876
|
+
readonly type: "json_schema";
|
|
877
|
+
readonly schema: {
|
|
878
|
+
readonly [x: string]: unknown;
|
|
879
|
+
};
|
|
880
|
+
} | null | undefined;
|
|
881
|
+
readonly effort?: string | undefined;
|
|
882
|
+
} | undefined;
|
|
883
|
+
readonly context_management?: {
|
|
884
|
+
readonly edits: readonly {
|
|
885
|
+
readonly type: "compact_20260112";
|
|
886
|
+
readonly instructions?: string | undefined;
|
|
887
|
+
readonly trigger?: {
|
|
888
|
+
readonly type: "input_tokens";
|
|
889
|
+
readonly value: number;
|
|
890
|
+
} | undefined;
|
|
891
|
+
readonly pause_after_compaction?: boolean | undefined;
|
|
892
|
+
}[];
|
|
893
|
+
} | undefined;
|
|
894
|
+
readonly tool_choice?: {
|
|
895
|
+
readonly type: "auto" | "none" | "any";
|
|
896
|
+
readonly disable_parallel_tool_use?: boolean | undefined;
|
|
897
|
+
} | {
|
|
898
|
+
readonly type: "tool";
|
|
899
|
+
readonly name: string;
|
|
900
|
+
readonly disable_parallel_tool_use?: boolean | undefined;
|
|
901
|
+
} | undefined;
|
|
902
|
+
readonly top_p?: number | undefined;
|
|
903
|
+
readonly top_k?: number | undefined;
|
|
904
|
+
readonly stop_sequences?: readonly string[] | undefined;
|
|
905
|
+
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined> | import("../route/client.js").Route<{
|
|
125
906
|
readonly model: string;
|
|
126
907
|
readonly messages: readonly ({
|
|
127
908
|
readonly role: "system";
|
|
@@ -213,23 +994,253 @@ export declare const routes: Route<{
|
|
|
213
994
|
readonly frequency_penalty?: number | undefined;
|
|
214
995
|
readonly presence_penalty?: number | undefined;
|
|
215
996
|
readonly prompt_cache_key?: string | undefined;
|
|
216
|
-
readonly reasoning_effort?: import("../
|
|
997
|
+
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
217
998
|
readonly store?: boolean | undefined;
|
|
218
999
|
readonly stream_options?: {
|
|
219
1000
|
readonly include_usage: boolean;
|
|
220
1001
|
} | undefined;
|
|
221
1002
|
readonly tool_stream?: boolean | undefined;
|
|
222
|
-
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>
|
|
1003
|
+
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined> | import("../route/client.js").Route<{
|
|
1004
|
+
readonly input: readonly ({
|
|
1005
|
+
readonly [x: string]: unknown;
|
|
1006
|
+
readonly id: string;
|
|
1007
|
+
readonly type: "web_search_call";
|
|
1008
|
+
readonly status?: string | undefined;
|
|
1009
|
+
readonly action?: {
|
|
1010
|
+
readonly [x: string]: unknown;
|
|
1011
|
+
} | null | undefined;
|
|
1012
|
+
} | {
|
|
1013
|
+
readonly [x: string]: unknown;
|
|
1014
|
+
readonly id: string;
|
|
1015
|
+
readonly type: "file_search_call";
|
|
1016
|
+
readonly status?: string | undefined;
|
|
1017
|
+
readonly queries?: readonly string[] | undefined;
|
|
1018
|
+
readonly results?: readonly {
|
|
1019
|
+
readonly [x: string]: unknown;
|
|
1020
|
+
}[] | null | undefined;
|
|
1021
|
+
} | {
|
|
1022
|
+
readonly [x: string]: unknown;
|
|
1023
|
+
readonly id: string;
|
|
1024
|
+
readonly type: "code_interpreter_call";
|
|
1025
|
+
readonly status?: string | undefined;
|
|
1026
|
+
readonly code?: string | null | undefined;
|
|
1027
|
+
readonly container_id?: string | null | undefined;
|
|
1028
|
+
readonly outputs?: readonly {
|
|
1029
|
+
readonly [x: string]: unknown;
|
|
1030
|
+
}[] | null | undefined;
|
|
1031
|
+
} | {
|
|
1032
|
+
readonly [x: string]: unknown;
|
|
1033
|
+
readonly id: string;
|
|
1034
|
+
readonly type: "mcp_call";
|
|
1035
|
+
readonly status?: string | undefined;
|
|
1036
|
+
readonly name?: string | undefined;
|
|
1037
|
+
readonly output?: string | null | undefined;
|
|
1038
|
+
readonly error?: unknown;
|
|
1039
|
+
readonly arguments?: string | undefined;
|
|
1040
|
+
readonly server_label?: string | undefined;
|
|
1041
|
+
} | {
|
|
1042
|
+
readonly type: "configuration_update";
|
|
1043
|
+
readonly reasoning: {
|
|
1044
|
+
readonly effort: import("../schema/options.js").ReasoningEffort;
|
|
1045
|
+
};
|
|
1046
|
+
} | {
|
|
1047
|
+
readonly type: "reasoning";
|
|
1048
|
+
readonly summary: readonly {
|
|
1049
|
+
readonly type: "summary_text";
|
|
1050
|
+
readonly text: string;
|
|
1051
|
+
}[];
|
|
1052
|
+
readonly id?: string | undefined;
|
|
1053
|
+
readonly encrypted_content?: string | null | undefined;
|
|
1054
|
+
} | {
|
|
1055
|
+
readonly type: "compaction";
|
|
1056
|
+
readonly encrypted_content: string;
|
|
1057
|
+
readonly id?: string | null | undefined;
|
|
1058
|
+
} | {
|
|
1059
|
+
readonly type: "message";
|
|
1060
|
+
readonly role: "system";
|
|
1061
|
+
readonly content: string;
|
|
1062
|
+
} | {
|
|
1063
|
+
readonly type: "message";
|
|
1064
|
+
readonly role: "developer";
|
|
1065
|
+
readonly content: string;
|
|
1066
|
+
} | {
|
|
1067
|
+
readonly type: "message";
|
|
1068
|
+
readonly content: readonly ({
|
|
1069
|
+
readonly type: "input_image";
|
|
1070
|
+
readonly image_url: string;
|
|
1071
|
+
readonly detail?: string | undefined;
|
|
1072
|
+
} | {
|
|
1073
|
+
readonly type: "input_file";
|
|
1074
|
+
readonly filename: string;
|
|
1075
|
+
readonly detail?: string | undefined;
|
|
1076
|
+
readonly file_data?: string | undefined;
|
|
1077
|
+
readonly file_url?: string | undefined;
|
|
1078
|
+
} | {
|
|
1079
|
+
readonly type: "input_text";
|
|
1080
|
+
readonly text: string;
|
|
1081
|
+
})[];
|
|
1082
|
+
readonly role: "user";
|
|
1083
|
+
readonly id?: string | undefined;
|
|
1084
|
+
readonly status?: string | undefined;
|
|
1085
|
+
} | {
|
|
1086
|
+
readonly type: "message";
|
|
1087
|
+
readonly content: readonly {
|
|
1088
|
+
readonly type: "output_text";
|
|
1089
|
+
readonly text: string;
|
|
1090
|
+
}[];
|
|
1091
|
+
readonly role: "assistant";
|
|
1092
|
+
readonly id?: string | undefined;
|
|
1093
|
+
readonly status?: string | undefined;
|
|
1094
|
+
readonly phase?: "commentary" | "final_answer" | null | undefined;
|
|
1095
|
+
} | {
|
|
1096
|
+
readonly type: "function_call";
|
|
1097
|
+
readonly name: string;
|
|
1098
|
+
readonly arguments: string;
|
|
1099
|
+
readonly call_id: string;
|
|
1100
|
+
readonly id?: string | undefined;
|
|
1101
|
+
readonly namespace?: string | undefined;
|
|
1102
|
+
} | {
|
|
1103
|
+
readonly type: "function_call_output";
|
|
1104
|
+
readonly call_id: string;
|
|
1105
|
+
readonly output: string | readonly ({
|
|
1106
|
+
readonly type: "input_image";
|
|
1107
|
+
readonly image_url: string;
|
|
1108
|
+
readonly detail?: string | undefined;
|
|
1109
|
+
} | {
|
|
1110
|
+
readonly type: "input_file";
|
|
1111
|
+
readonly filename: string;
|
|
1112
|
+
readonly detail?: string | undefined;
|
|
1113
|
+
readonly file_data?: string | undefined;
|
|
1114
|
+
readonly file_url?: string | undefined;
|
|
1115
|
+
} | {
|
|
1116
|
+
readonly type: "input_text";
|
|
1117
|
+
readonly text: string;
|
|
1118
|
+
} | {
|
|
1119
|
+
readonly type: "input_video";
|
|
1120
|
+
readonly video_url: string;
|
|
1121
|
+
})[];
|
|
1122
|
+
} | {
|
|
1123
|
+
readonly [x: string]: unknown;
|
|
1124
|
+
readonly id: string;
|
|
1125
|
+
readonly type: "computer_call";
|
|
1126
|
+
readonly status?: string | undefined;
|
|
1127
|
+
readonly action?: {
|
|
1128
|
+
readonly [x: string]: unknown;
|
|
1129
|
+
} | null | undefined;
|
|
1130
|
+
readonly call_id?: string | undefined;
|
|
1131
|
+
readonly pending_safety_checks?: readonly {
|
|
1132
|
+
readonly [x: string]: unknown;
|
|
1133
|
+
}[] | undefined;
|
|
1134
|
+
} | {
|
|
1135
|
+
readonly [x: string]: unknown;
|
|
1136
|
+
readonly id: string;
|
|
1137
|
+
readonly type: "web_search_preview_call";
|
|
1138
|
+
readonly status?: string | undefined;
|
|
1139
|
+
readonly action?: {
|
|
1140
|
+
readonly [x: string]: unknown;
|
|
1141
|
+
} | null | undefined;
|
|
1142
|
+
} | {
|
|
1143
|
+
readonly [x: string]: unknown;
|
|
1144
|
+
readonly id: string;
|
|
1145
|
+
readonly type: "image_generation_call";
|
|
1146
|
+
readonly status?: string | undefined;
|
|
1147
|
+
readonly result?: string | null | undefined;
|
|
1148
|
+
readonly revised_prompt?: string | null | undefined;
|
|
1149
|
+
readonly output_format?: "png" | "jpeg" | "webp" | undefined;
|
|
1150
|
+
})[];
|
|
1151
|
+
readonly model: string;
|
|
1152
|
+
readonly stream: true;
|
|
1153
|
+
readonly metadata?: {
|
|
1154
|
+
readonly [x: string]: string;
|
|
1155
|
+
} | undefined;
|
|
1156
|
+
readonly instructions?: string | undefined;
|
|
1157
|
+
readonly reasoning?: {
|
|
1158
|
+
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
1159
|
+
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
1160
|
+
} | undefined;
|
|
1161
|
+
readonly tools?: readonly ({
|
|
1162
|
+
readonly type: "function";
|
|
1163
|
+
readonly description: string;
|
|
1164
|
+
readonly name: string;
|
|
1165
|
+
readonly parameters: {
|
|
1166
|
+
readonly [x: string]: unknown;
|
|
1167
|
+
};
|
|
1168
|
+
readonly strict?: boolean | undefined;
|
|
1169
|
+
} | {
|
|
1170
|
+
readonly type: "image_generation";
|
|
1171
|
+
readonly size?: string | undefined;
|
|
1172
|
+
readonly action?: "generate" | "auto" | "edit" | undefined;
|
|
1173
|
+
readonly output_format?: "png" | "jpeg" | "webp" | undefined;
|
|
1174
|
+
readonly quality?: "auto" | "low" | "medium" | "high" | undefined;
|
|
1175
|
+
readonly background?: "auto" | "opaque" | "transparent" | undefined;
|
|
1176
|
+
readonly output_compression?: number | undefined;
|
|
1177
|
+
readonly input_fidelity?: "low" | "high" | undefined;
|
|
1178
|
+
readonly partial_images?: number | undefined;
|
|
1179
|
+
} | {
|
|
1180
|
+
readonly type: "namespace";
|
|
1181
|
+
readonly name: string;
|
|
1182
|
+
readonly description: string;
|
|
1183
|
+
readonly tools: readonly {
|
|
1184
|
+
readonly type: "function";
|
|
1185
|
+
readonly description: string;
|
|
1186
|
+
readonly name: string;
|
|
1187
|
+
readonly parameters: {
|
|
1188
|
+
readonly [x: string]: unknown;
|
|
1189
|
+
};
|
|
1190
|
+
readonly strict?: boolean | undefined;
|
|
1191
|
+
}[];
|
|
1192
|
+
})[] | undefined;
|
|
1193
|
+
readonly text?: {
|
|
1194
|
+
readonly verbosity?: import("../protocols/utils/open-responses-options.js").TextVerbosity | undefined;
|
|
1195
|
+
} | undefined;
|
|
1196
|
+
readonly temperature?: number | undefined;
|
|
1197
|
+
readonly service_tier?: import("../protocols/utils/open-responses-options.js").ServiceTier | undefined;
|
|
1198
|
+
readonly context_management?: readonly {
|
|
1199
|
+
readonly type: "compaction";
|
|
1200
|
+
readonly compact_threshold?: number | undefined;
|
|
1201
|
+
}[] | undefined;
|
|
1202
|
+
readonly tool_choice?: "required" | "auto" | "none" | {
|
|
1203
|
+
readonly type: "function";
|
|
1204
|
+
readonly name: string;
|
|
1205
|
+
} | {
|
|
1206
|
+
readonly type: "allowed_tools";
|
|
1207
|
+
readonly mode: "required" | "auto" | "none";
|
|
1208
|
+
readonly tools: readonly {
|
|
1209
|
+
readonly type: "function";
|
|
1210
|
+
readonly name: string;
|
|
1211
|
+
}[];
|
|
1212
|
+
} | {
|
|
1213
|
+
readonly type: "image_generation";
|
|
1214
|
+
} | undefined;
|
|
1215
|
+
readonly top_p?: number | undefined;
|
|
1216
|
+
readonly frequency_penalty?: number | undefined;
|
|
1217
|
+
readonly presence_penalty?: number | undefined;
|
|
1218
|
+
readonly prompt_cache_key?: string | undefined;
|
|
1219
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
1220
|
+
readonly store?: boolean | undefined;
|
|
1221
|
+
readonly include?: readonly import("../protocols/utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
1222
|
+
readonly truncation?: "auto" | "disabled" | undefined;
|
|
1223
|
+
readonly stream_options?: {
|
|
1224
|
+
readonly include_obfuscation?: boolean | undefined;
|
|
1225
|
+
} | undefined;
|
|
1226
|
+
readonly safety_identifier?: string | undefined;
|
|
1227
|
+
readonly top_logprobs?: number | undefined;
|
|
1228
|
+
readonly max_output_tokens?: number | undefined;
|
|
1229
|
+
readonly max_tool_calls?: number | undefined;
|
|
1230
|
+
}, import("../protocols/open-responses-channel.js").Prepared, {
|
|
1231
|
+
endpoint: import("../route/client.js").CompactOperation;
|
|
1232
|
+
trigger: import("../route/client.js").TriggerCompactOperation;
|
|
1233
|
+
}>)[];
|
|
223
1234
|
export declare const configure: (input: LanguageModelOptions) => {
|
|
224
1235
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
225
|
-
model: (
|
|
1236
|
+
model: (input: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
226
1237
|
configure: (input: LanguageModelOptions) => /*elided*/ any;
|
|
227
1238
|
};
|
|
228
1239
|
export declare const provider: {
|
|
229
1240
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
230
1241
|
configure: (input: LanguageModelOptions) => {
|
|
231
1242
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
232
|
-
model: (
|
|
1243
|
+
model: (input: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
233
1244
|
configure: /*elided*/ any;
|
|
234
1245
|
};
|
|
235
1246
|
};
|