@opencode/ai 2.0.22 → 2.0.24
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/README.md +61 -1
- package/dist/cache-policy.js +13 -9
- package/dist/protocols/alibaba-chat.d.ts +3 -3
- package/dist/protocols/alibaba-messages.d.ts +3 -0
- package/dist/protocols/alibaba-responses.d.ts +19 -12
- package/dist/protocols/alibaba-responses.js +3 -5
- package/dist/protocols/anthropic-messages.d.ts +3 -0
- package/dist/protocols/anthropic-messages.js +53 -48
- package/dist/protocols/bedrock-converse.js +3 -3
- package/dist/protocols/cartesia-speech.js +3 -3
- package/dist/protocols/cohere-chat.d.ts +178 -0
- package/dist/protocols/cohere-chat.js +299 -0
- package/dist/protocols/elevenlabs-speech.js +3 -3
- package/dist/protocols/gemini.d.ts +2 -2
- package/dist/protocols/gemini.js +3 -3
- package/dist/protocols/google-interactions.d.ts +236 -0
- package/dist/protocols/google-interactions.js +478 -0
- package/dist/protocols/google-speech.js +1 -1
- package/dist/protocols/google-transcription.js +1 -1
- package/dist/protocols/index.d.ts +2 -0
- package/dist/protocols/index.js +2 -0
- package/dist/protocols/meta-messages.d.ts +3 -0
- package/dist/protocols/meta-responses.d.ts +34 -58
- package/dist/protocols/meta-responses.js +8 -27
- package/dist/protocols/mistral-chat.d.ts +24 -9
- package/dist/protocols/mistral-chat.js +22 -10
- package/dist/protocols/open-responses.d.ts +424 -103
- package/dist/protocols/open-responses.js +30 -20
- package/dist/protocols/openai-chat.d.ts +401 -5
- package/dist/protocols/openai-chat.js +18 -21
- package/dist/protocols/openai-compatible-chat.d.ts +1 -1
- package/dist/protocols/openai-compatible-responses.d.ts +16 -4
- package/dist/protocols/openai-images.js +2 -2
- package/dist/protocols/openai-responses.d.ts +90 -223
- package/dist/protocols/openai-responses.js +6 -13
- package/dist/protocols/openai-speech.js +1 -1
- package/dist/protocols/openai-transcription.js +1 -1
- package/dist/protocols/shared.js +2 -2
- package/dist/protocols/stability-images.js +1 -1
- package/dist/protocols/utils/bedrock-media.js +2 -2
- package/dist/protocols/utils/gateway-protocol.d.ts +17 -0
- package/dist/protocols/utils/gateway-protocol.js +57 -0
- package/dist/protocols/utils/responses-checkpoint.js +2 -2
- package/dist/protocols/utils/responses-hosted-tools.js +1 -1
- package/dist/protocols/utils/tool-stream.js +15 -7
- package/dist/protocols/venice-chat.d.ts +280 -0
- package/dist/protocols/venice-chat.js +283 -0
- package/dist/protocols/xai-responses.d.ts +21 -21
- package/dist/protocols/xai-responses.js +2 -8
- package/dist/protocols/zai-chat.d.ts +3 -3
- package/dist/protocols/zai-messages.d.ts +3 -0
- package/dist/provider-error.js +7 -1
- package/dist/providers/alibaba.d.ts +17 -13
- package/dist/providers/amazon-bedrock/mantle/messages.d.ts +2 -0
- package/dist/providers/amazon-bedrock/mantle/messages.js +1 -0
- package/dist/providers/amazon-bedrock-mantle.d.ts +301 -9
- package/dist/providers/amazon-bedrock-mantle.js +28 -3
- package/dist/providers/azure.d.ts +13 -61
- package/dist/providers/baseten.d.ts +2 -2
- package/dist/providers/cerebras.d.ts +2 -2
- package/dist/providers/cloudflare-ai-gateway.d.ts +14 -62
- package/dist/providers/cloudflare-workers-ai.d.ts +2 -2
- package/dist/providers/cohere/chat.d.ts +4 -0
- package/dist/providers/cohere/chat.js +8 -0
- package/dist/providers/cohere.d.ts +395 -0
- package/dist/providers/cohere.js +48 -0
- package/dist/providers/deepinfra.d.ts +2 -2
- package/dist/providers/deepseek.d.ts +2 -2
- package/dist/providers/digitalocean.d.ts +5 -5
- package/dist/providers/fireworks.d.ts +2 -2
- package/dist/providers/google/interactions.d.ts +7 -0
- package/dist/providers/google/interactions.js +8 -0
- package/dist/providers/google-vertex-chat.d.ts +1 -1
- package/dist/providers/google-vertex-messages.js +1 -0
- package/dist/providers/google-vertex-responses.d.ts +16 -4
- package/dist/providers/google-vertex.d.ts +1 -1
- package/dist/providers/google.d.ts +95 -4
- package/dist/providers/google.js +8 -1
- package/dist/providers/groq.d.ts +4 -4
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +2 -0
- package/dist/providers/meta.d.ts +15 -28
- package/dist/providers/minimax.d.ts +17 -5
- package/dist/providers/mistral.d.ts +10 -4
- package/dist/providers/moonshot.d.ts +17 -5
- package/dist/providers/openai-compatible-responses.d.ts +16 -4
- package/dist/providers/openai-compatible.d.ts +1 -1
- package/dist/providers/openai-options.d.ts +1 -1
- package/dist/providers/openai.d.ts +7 -31
- package/dist/providers/openrouter.d.ts +5 -5
- package/dist/providers/togetherai.d.ts +2 -2
- package/dist/providers/venice.d.ts +183 -0
- package/dist/providers/venice.js +38 -0
- package/dist/providers/vercel-ai-gateway/chat.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/chat.js +1 -0
- package/dist/providers/vercel-ai-gateway/messages.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/messages.js +1 -0
- package/dist/providers/vercel-ai-gateway/responses.d.ts +2 -0
- package/dist/providers/vercel-ai-gateway/responses.js +1 -0
- package/dist/providers/vercel-ai-gateway.d.ts +91 -9
- package/dist/providers/vercel-ai-gateway.js +161 -21
- package/dist/providers/xai.d.ts +1 -1
- package/dist/providers/zai-coding-plan.d.ts +17 -5
- package/dist/providers/zai.d.ts +1 -1
- package/dist/route/client.js +2 -5
- package/dist/route/framing.js +23 -23
- package/package.json +3 -3
|
@@ -17,7 +17,10 @@ export declare const route: import("../route/client.js").Route<{
|
|
|
17
17
|
readonly model: string;
|
|
18
18
|
readonly messages: readonly ({
|
|
19
19
|
readonly role: "system";
|
|
20
|
-
readonly content: string
|
|
20
|
+
readonly content: string | readonly {
|
|
21
|
+
readonly type: "text";
|
|
22
|
+
readonly text: string;
|
|
23
|
+
}[];
|
|
21
24
|
} | {
|
|
22
25
|
readonly role: "user";
|
|
23
26
|
readonly content: string | readonly ({
|
|
@@ -90,9 +93,9 @@ export declare const route: import("../route/client.js").Route<{
|
|
|
90
93
|
};
|
|
91
94
|
} | undefined;
|
|
92
95
|
readonly top_p?: number | undefined;
|
|
93
|
-
readonly random_seed?: number | undefined;
|
|
94
96
|
readonly frequency_penalty?: number | undefined;
|
|
95
97
|
readonly presence_penalty?: number | undefined;
|
|
98
|
+
readonly random_seed?: number | undefined;
|
|
96
99
|
readonly prompt_cache_key?: string | undefined;
|
|
97
100
|
readonly safe_prompt?: boolean | undefined;
|
|
98
101
|
readonly document_image_limit?: number | undefined;
|
|
@@ -105,7 +108,10 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
105
108
|
readonly model: string;
|
|
106
109
|
readonly messages: readonly ({
|
|
107
110
|
readonly role: "system";
|
|
108
|
-
readonly content: string
|
|
111
|
+
readonly content: string | readonly {
|
|
112
|
+
readonly type: "text";
|
|
113
|
+
readonly text: string;
|
|
114
|
+
}[];
|
|
109
115
|
} | {
|
|
110
116
|
readonly role: "user";
|
|
111
117
|
readonly content: string | readonly ({
|
|
@@ -178,9 +184,9 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
178
184
|
};
|
|
179
185
|
} | undefined;
|
|
180
186
|
readonly top_p?: number | undefined;
|
|
181
|
-
readonly random_seed?: number | undefined;
|
|
182
187
|
readonly frequency_penalty?: number | undefined;
|
|
183
188
|
readonly presence_penalty?: number | undefined;
|
|
189
|
+
readonly random_seed?: number | undefined;
|
|
184
190
|
readonly prompt_cache_key?: string | undefined;
|
|
185
191
|
readonly safe_prompt?: boolean | undefined;
|
|
186
192
|
readonly document_image_limit?: number | undefined;
|
|
@@ -341,6 +341,15 @@ export declare const routes: (Route<{
|
|
|
341
341
|
readonly error?: unknown;
|
|
342
342
|
readonly arguments?: string | undefined;
|
|
343
343
|
readonly server_label?: string | undefined;
|
|
344
|
+
} | {
|
|
345
|
+
readonly type: "configuration_update";
|
|
346
|
+
readonly reasoning: {
|
|
347
|
+
readonly effort: import("../schema/options.js").ReasoningEffort;
|
|
348
|
+
};
|
|
349
|
+
} | {
|
|
350
|
+
readonly [x: string]: unknown;
|
|
351
|
+
readonly type: string;
|
|
352
|
+
readonly id: string;
|
|
344
353
|
} | {
|
|
345
354
|
readonly type: "reasoning";
|
|
346
355
|
readonly summary: readonly {
|
|
@@ -428,7 +437,10 @@ export declare const routes: (Route<{
|
|
|
428
437
|
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
429
438
|
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
430
439
|
} | undefined;
|
|
431
|
-
readonly tools?: readonly {
|
|
440
|
+
readonly tools?: readonly ({
|
|
441
|
+
readonly [x: string]: unknown;
|
|
442
|
+
readonly type: string;
|
|
443
|
+
} | {
|
|
432
444
|
readonly type: "function";
|
|
433
445
|
readonly description: string;
|
|
434
446
|
readonly name: string;
|
|
@@ -436,7 +448,7 @@ export declare const routes: (Route<{
|
|
|
436
448
|
readonly [x: string]: unknown;
|
|
437
449
|
};
|
|
438
450
|
readonly strict?: boolean | undefined;
|
|
439
|
-
}[] | undefined;
|
|
451
|
+
})[] | undefined;
|
|
440
452
|
readonly text?: {
|
|
441
453
|
readonly verbosity?: import("../protocols/utils/open-responses-options.js").TextVerbosity | undefined;
|
|
442
454
|
} | undefined;
|
|
@@ -456,9 +468,10 @@ export declare const routes: (Route<{
|
|
|
456
468
|
readonly top_p?: number | undefined;
|
|
457
469
|
readonly frequency_penalty?: number | undefined;
|
|
458
470
|
readonly presence_penalty?: number | undefined;
|
|
471
|
+
readonly store?: boolean | undefined;
|
|
472
|
+
readonly max_output_tokens?: number | undefined;
|
|
459
473
|
readonly prompt_cache_key?: string | undefined;
|
|
460
474
|
readonly parallel_tool_calls?: boolean | undefined;
|
|
461
|
-
readonly store?: boolean | undefined;
|
|
462
475
|
readonly include?: readonly import("../protocols/utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
463
476
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
464
477
|
readonly stream_options?: {
|
|
@@ -466,7 +479,6 @@ export declare const routes: (Route<{
|
|
|
466
479
|
} | undefined;
|
|
467
480
|
readonly safety_identifier?: string | undefined;
|
|
468
481
|
readonly top_logprobs?: number | undefined;
|
|
469
|
-
readonly max_output_tokens?: number | undefined;
|
|
470
482
|
readonly max_tool_calls?: number | undefined;
|
|
471
483
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined> | Route<{
|
|
472
484
|
readonly model: string;
|
|
@@ -586,9 +598,9 @@ export declare const routes: (Route<{
|
|
|
586
598
|
readonly top_p?: number | undefined;
|
|
587
599
|
readonly frequency_penalty?: number | undefined;
|
|
588
600
|
readonly presence_penalty?: number | undefined;
|
|
601
|
+
readonly store?: boolean | undefined;
|
|
589
602
|
readonly prompt_cache_key?: string | undefined;
|
|
590
603
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
591
|
-
readonly store?: boolean | undefined;
|
|
592
604
|
readonly stream_options?: {
|
|
593
605
|
readonly include_usage: boolean;
|
|
594
606
|
} | undefined;
|
|
@@ -53,6 +53,15 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
53
53
|
readonly error?: unknown;
|
|
54
54
|
readonly arguments?: string | undefined;
|
|
55
55
|
readonly server_label?: string | undefined;
|
|
56
|
+
} | {
|
|
57
|
+
readonly type: "configuration_update";
|
|
58
|
+
readonly reasoning: {
|
|
59
|
+
readonly effort: import("../schema/options.js").ReasoningEffort;
|
|
60
|
+
};
|
|
61
|
+
} | {
|
|
62
|
+
readonly [x: string]: unknown;
|
|
63
|
+
readonly type: string;
|
|
64
|
+
readonly id: string;
|
|
56
65
|
} | {
|
|
57
66
|
readonly type: "reasoning";
|
|
58
67
|
readonly summary: readonly {
|
|
@@ -140,7 +149,10 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
140
149
|
readonly summary?: "auto" | "concise" | "detailed" | undefined;
|
|
141
150
|
readonly effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
142
151
|
} | undefined;
|
|
143
|
-
readonly tools?: readonly {
|
|
152
|
+
readonly tools?: readonly ({
|
|
153
|
+
readonly [x: string]: unknown;
|
|
154
|
+
readonly type: string;
|
|
155
|
+
} | {
|
|
144
156
|
readonly type: "function";
|
|
145
157
|
readonly description: string;
|
|
146
158
|
readonly name: string;
|
|
@@ -148,7 +160,7 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
148
160
|
readonly [x: string]: unknown;
|
|
149
161
|
};
|
|
150
162
|
readonly strict?: boolean | undefined;
|
|
151
|
-
}[] | undefined;
|
|
163
|
+
})[] | undefined;
|
|
152
164
|
readonly text?: {
|
|
153
165
|
readonly verbosity?: import("../protocols/utils/open-responses-options.js").TextVerbosity | undefined;
|
|
154
166
|
} | undefined;
|
|
@@ -168,9 +180,10 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
168
180
|
readonly top_p?: number | undefined;
|
|
169
181
|
readonly frequency_penalty?: number | undefined;
|
|
170
182
|
readonly presence_penalty?: number | undefined;
|
|
183
|
+
readonly store?: boolean | undefined;
|
|
184
|
+
readonly max_output_tokens?: number | undefined;
|
|
171
185
|
readonly prompt_cache_key?: string | undefined;
|
|
172
186
|
readonly parallel_tool_calls?: boolean | undefined;
|
|
173
|
-
readonly store?: boolean | undefined;
|
|
174
187
|
readonly include?: readonly import("../protocols/utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
175
188
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
176
189
|
readonly stream_options?: {
|
|
@@ -178,7 +191,6 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
178
191
|
} | undefined;
|
|
179
192
|
readonly safety_identifier?: string | undefined;
|
|
180
193
|
readonly top_logprobs?: number | undefined;
|
|
181
|
-
readonly max_output_tokens?: number | undefined;
|
|
182
194
|
readonly max_tool_calls?: number | undefined;
|
|
183
195
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
|
|
184
196
|
export declare const configure: (input: Config) => {
|
|
@@ -128,9 +128,9 @@ export declare const routes: import("../route/client.js").Route<{
|
|
|
128
128
|
readonly top_p?: number | undefined;
|
|
129
129
|
readonly frequency_penalty?: number | undefined;
|
|
130
130
|
readonly presence_penalty?: number | undefined;
|
|
131
|
+
readonly store?: boolean | undefined;
|
|
131
132
|
readonly prompt_cache_key?: string | undefined;
|
|
132
133
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
133
|
-
readonly store?: boolean | undefined;
|
|
134
134
|
readonly stream_options?: {
|
|
135
135
|
readonly include_usage: boolean;
|
|
136
136
|
} | undefined;
|
|
@@ -13,7 +13,7 @@ export type OpenAIProviderOptionsInput = OpenAIOptionsInput;
|
|
|
13
13
|
export declare const gpt5DefaultOptions: (modelID: string) => ProviderOptions | undefined;
|
|
14
14
|
export declare const openAIDefaultOptions: (modelID: string) => ProviderOptions | undefined;
|
|
15
15
|
export declare const withOpenAIOptions: <Options extends {
|
|
16
|
-
readonly providerOptions?:
|
|
16
|
+
readonly providerOptions?: ProviderOptions;
|
|
17
17
|
}>(modelID: string, options: Options) => Omit<Options, "providerOptions"> & {
|
|
18
18
|
readonly providerOptions?: ProviderOptions;
|
|
19
19
|
};
|
|
@@ -123,9 +123,9 @@ export declare const routes: (Route<{
|
|
|
123
123
|
readonly top_p?: number | undefined;
|
|
124
124
|
readonly frequency_penalty?: number | undefined;
|
|
125
125
|
readonly presence_penalty?: number | undefined;
|
|
126
|
+
readonly store?: boolean | undefined;
|
|
126
127
|
readonly prompt_cache_key?: string | undefined;
|
|
127
128
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
128
|
-
readonly store?: boolean | undefined;
|
|
129
129
|
readonly stream_options?: {
|
|
130
130
|
readonly include_usage: boolean;
|
|
131
131
|
} | undefined;
|
|
@@ -173,6 +173,10 @@ export declare const routes: (Route<{
|
|
|
173
173
|
readonly reasoning: {
|
|
174
174
|
readonly effort: import("../schema/options.js").ReasoningEffort;
|
|
175
175
|
};
|
|
176
|
+
} | {
|
|
177
|
+
readonly [x: string]: unknown;
|
|
178
|
+
readonly type: string;
|
|
179
|
+
readonly id: string;
|
|
176
180
|
} | {
|
|
177
181
|
readonly type: "reasoning";
|
|
178
182
|
readonly summary: readonly {
|
|
@@ -249,34 +253,6 @@ export declare const routes: (Route<{
|
|
|
249
253
|
readonly type: "input_video";
|
|
250
254
|
readonly video_url: string;
|
|
251
255
|
})[];
|
|
252
|
-
} | {
|
|
253
|
-
readonly [x: string]: unknown;
|
|
254
|
-
readonly id: string;
|
|
255
|
-
readonly type: "computer_call";
|
|
256
|
-
readonly status?: string | undefined;
|
|
257
|
-
readonly action?: {
|
|
258
|
-
readonly [x: string]: unknown;
|
|
259
|
-
} | null | undefined;
|
|
260
|
-
readonly call_id?: string | undefined;
|
|
261
|
-
readonly pending_safety_checks?: readonly {
|
|
262
|
-
readonly [x: string]: unknown;
|
|
263
|
-
}[] | undefined;
|
|
264
|
-
} | {
|
|
265
|
-
readonly [x: string]: unknown;
|
|
266
|
-
readonly id: string;
|
|
267
|
-
readonly type: "web_search_preview_call";
|
|
268
|
-
readonly status?: string | undefined;
|
|
269
|
-
readonly action?: {
|
|
270
|
-
readonly [x: string]: unknown;
|
|
271
|
-
} | null | undefined;
|
|
272
|
-
} | {
|
|
273
|
-
readonly [x: string]: unknown;
|
|
274
|
-
readonly id: string;
|
|
275
|
-
readonly type: "image_generation_call";
|
|
276
|
-
readonly status?: string | undefined;
|
|
277
|
-
readonly result?: string | null | undefined;
|
|
278
|
-
readonly output_format?: "png" | "jpeg" | "webp" | undefined;
|
|
279
|
-
readonly revised_prompt?: string | null | undefined;
|
|
280
256
|
})[];
|
|
281
257
|
readonly model: string;
|
|
282
258
|
readonly stream: true;
|
|
@@ -345,9 +321,10 @@ export declare const routes: (Route<{
|
|
|
345
321
|
readonly top_p?: number | undefined;
|
|
346
322
|
readonly frequency_penalty?: number | undefined;
|
|
347
323
|
readonly presence_penalty?: number | undefined;
|
|
324
|
+
readonly store?: boolean | undefined;
|
|
325
|
+
readonly max_output_tokens?: number | undefined;
|
|
348
326
|
readonly prompt_cache_key?: string | undefined;
|
|
349
327
|
readonly parallel_tool_calls?: boolean | undefined;
|
|
350
|
-
readonly store?: boolean | undefined;
|
|
351
328
|
readonly include?: readonly import("../protocols/utils/open-responses-options.js").ResponseIncludable[] | undefined;
|
|
352
329
|
readonly truncation?: "auto" | "disabled" | undefined;
|
|
353
330
|
readonly stream_options?: {
|
|
@@ -355,7 +332,6 @@ export declare const routes: (Route<{
|
|
|
355
332
|
} | undefined;
|
|
356
333
|
readonly safety_identifier?: string | undefined;
|
|
357
334
|
readonly top_logprobs?: number | undefined;
|
|
358
|
-
readonly max_output_tokens?: number | undefined;
|
|
359
335
|
readonly max_tool_calls?: number | undefined;
|
|
360
336
|
}, import("../protocols/open-responses-channel.js").Prepared, {
|
|
361
337
|
endpoint: import("../route/client.js").CompactOperation;
|
|
@@ -322,9 +322,9 @@ export declare const protocol: Protocol<{
|
|
|
322
322
|
readonly top_p?: number | undefined;
|
|
323
323
|
readonly frequency_penalty?: number | undefined;
|
|
324
324
|
readonly presence_penalty?: number | undefined;
|
|
325
|
+
readonly store?: boolean | undefined;
|
|
325
326
|
readonly prompt_cache_key?: string | undefined;
|
|
326
327
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
327
|
-
readonly store?: boolean | undefined;
|
|
328
328
|
readonly stream_options?: {
|
|
329
329
|
readonly include_usage: boolean;
|
|
330
330
|
} | undefined;
|
|
@@ -340,9 +340,9 @@ export declare const protocol: Protocol<{
|
|
|
340
340
|
readonly [x: string]: unknown;
|
|
341
341
|
readonly cache_read_input_tokens?: number | null | undefined;
|
|
342
342
|
readonly cached_tokens?: number | null | undefined;
|
|
343
|
+
readonly total_tokens?: number | null | undefined;
|
|
343
344
|
readonly prompt_tokens?: number | null | undefined;
|
|
344
345
|
readonly completion_tokens?: number | null | undefined;
|
|
345
|
-
readonly total_tokens?: number | null | undefined;
|
|
346
346
|
readonly prompt_tokens_details?: {
|
|
347
347
|
readonly [x: string]: unknown;
|
|
348
348
|
readonly cached_tokens?: number | null | undefined;
|
|
@@ -381,9 +381,9 @@ export declare const protocol: Protocol<{
|
|
|
381
381
|
readonly [x: string]: unknown;
|
|
382
382
|
readonly cache_read_input_tokens?: number | null | undefined;
|
|
383
383
|
readonly cached_tokens?: number | null | undefined;
|
|
384
|
+
readonly total_tokens?: number | null | undefined;
|
|
384
385
|
readonly prompt_tokens?: number | null | undefined;
|
|
385
386
|
readonly completion_tokens?: number | null | undefined;
|
|
386
|
-
readonly total_tokens?: number | null | undefined;
|
|
387
387
|
readonly prompt_tokens_details?: {
|
|
388
388
|
readonly [x: string]: unknown;
|
|
389
389
|
readonly cached_tokens?: number | null | undefined;
|
|
@@ -517,9 +517,9 @@ export declare const route: Route<{
|
|
|
517
517
|
readonly top_p?: number | undefined;
|
|
518
518
|
readonly frequency_penalty?: number | undefined;
|
|
519
519
|
readonly presence_penalty?: number | undefined;
|
|
520
|
+
readonly store?: boolean | undefined;
|
|
520
521
|
readonly prompt_cache_key?: string | undefined;
|
|
521
522
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
522
|
-
readonly store?: boolean | undefined;
|
|
523
523
|
readonly stream_options?: {
|
|
524
524
|
readonly include_usage: boolean;
|
|
525
525
|
} | undefined;
|
|
@@ -640,9 +640,9 @@ export declare const routes: Route<{
|
|
|
640
640
|
readonly top_p?: number | undefined;
|
|
641
641
|
readonly frequency_penalty?: number | undefined;
|
|
642
642
|
readonly presence_penalty?: number | undefined;
|
|
643
|
+
readonly store?: boolean | undefined;
|
|
643
644
|
readonly prompt_cache_key?: string | undefined;
|
|
644
645
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
645
|
-
readonly store?: boolean | undefined;
|
|
646
646
|
readonly stream_options?: {
|
|
647
647
|
readonly include_usage: boolean;
|
|
648
648
|
} | undefined;
|
|
@@ -126,9 +126,9 @@ export declare const route: Route<{
|
|
|
126
126
|
readonly top_p?: number | undefined;
|
|
127
127
|
readonly frequency_penalty?: number | undefined;
|
|
128
128
|
readonly presence_penalty?: number | undefined;
|
|
129
|
+
readonly store?: boolean | undefined;
|
|
129
130
|
readonly prompt_cache_key?: string | undefined;
|
|
130
131
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
131
|
-
readonly store?: boolean | undefined;
|
|
132
132
|
readonly stream_options?: {
|
|
133
133
|
readonly include_usage: boolean;
|
|
134
134
|
} | undefined;
|
|
@@ -248,9 +248,9 @@ export declare const routes: Route<{
|
|
|
248
248
|
readonly top_p?: number | undefined;
|
|
249
249
|
readonly frequency_penalty?: number | undefined;
|
|
250
250
|
readonly presence_penalty?: number | undefined;
|
|
251
|
+
readonly store?: boolean | undefined;
|
|
251
252
|
readonly prompt_cache_key?: string | undefined;
|
|
252
253
|
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
253
|
-
readonly store?: boolean | undefined;
|
|
254
254
|
readonly stream_options?: {
|
|
255
255
|
readonly include_usage: boolean;
|
|
256
256
|
} | undefined;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { ProviderPackage } from "../provider-package.js";
|
|
2
|
+
import { VeniceChat } from "../protocols/venice-chat.js";
|
|
3
|
+
import { type ProviderAuthOption } from "../route/auth-options.js";
|
|
4
|
+
import { Route, type RouteDefaultsInput } from "../route/client.js";
|
|
5
|
+
import { type ModelID } from "../schema/index.js";
|
|
6
|
+
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
7
|
+
export type ChatOptionsInput = VeniceChat.OptionsInput;
|
|
8
|
+
export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
9
|
+
readonly baseURL?: string;
|
|
10
|
+
readonly queryParams?: Readonly<Record<string, string>>;
|
|
11
|
+
readonly providerOptions?: ChatOptionsInput;
|
|
12
|
+
};
|
|
13
|
+
export type Settings = ProviderPackage.Settings & ChatOptionsInput & {
|
|
14
|
+
readonly apiKey?: string;
|
|
15
|
+
readonly baseURL?: string;
|
|
16
|
+
readonly queryParams?: Readonly<Record<string, string>>;
|
|
17
|
+
};
|
|
18
|
+
export declare const routes: Route<{
|
|
19
|
+
readonly model: string;
|
|
20
|
+
readonly messages: readonly ({
|
|
21
|
+
readonly role: "system";
|
|
22
|
+
readonly content: string | readonly ({
|
|
23
|
+
readonly type: "text";
|
|
24
|
+
readonly text: string;
|
|
25
|
+
readonly cache_control?: {
|
|
26
|
+
readonly type: "ephemeral";
|
|
27
|
+
readonly ttl?: string | undefined;
|
|
28
|
+
} | undefined;
|
|
29
|
+
} | {
|
|
30
|
+
readonly type: "image_url";
|
|
31
|
+
readonly image_url: {
|
|
32
|
+
readonly url: string;
|
|
33
|
+
};
|
|
34
|
+
} | {
|
|
35
|
+
readonly type: "file";
|
|
36
|
+
readonly file: {
|
|
37
|
+
readonly filename: string;
|
|
38
|
+
readonly file_data: string;
|
|
39
|
+
};
|
|
40
|
+
})[];
|
|
41
|
+
} | {
|
|
42
|
+
readonly role: "user";
|
|
43
|
+
readonly content: string | readonly ({
|
|
44
|
+
readonly type: "text";
|
|
45
|
+
readonly text: string;
|
|
46
|
+
readonly cache_control?: {
|
|
47
|
+
readonly type: "ephemeral";
|
|
48
|
+
readonly ttl?: string | undefined;
|
|
49
|
+
} | undefined;
|
|
50
|
+
} | {
|
|
51
|
+
readonly type: "image_url";
|
|
52
|
+
readonly image_url: {
|
|
53
|
+
readonly url: string;
|
|
54
|
+
};
|
|
55
|
+
} | {
|
|
56
|
+
readonly type: "file";
|
|
57
|
+
readonly file: {
|
|
58
|
+
readonly filename: string;
|
|
59
|
+
readonly file_data: string;
|
|
60
|
+
};
|
|
61
|
+
})[];
|
|
62
|
+
} | {
|
|
63
|
+
readonly role: "tool";
|
|
64
|
+
readonly tool_call_id: string;
|
|
65
|
+
readonly content: string | readonly {
|
|
66
|
+
readonly type: "text";
|
|
67
|
+
readonly text: string;
|
|
68
|
+
readonly cache_control?: {
|
|
69
|
+
readonly type: "ephemeral";
|
|
70
|
+
readonly ttl?: string | undefined;
|
|
71
|
+
} | undefined;
|
|
72
|
+
}[];
|
|
73
|
+
} | {
|
|
74
|
+
readonly [x: string]: unknown;
|
|
75
|
+
readonly content: string | readonly {
|
|
76
|
+
readonly type: "text";
|
|
77
|
+
readonly text: string;
|
|
78
|
+
readonly cache_control?: {
|
|
79
|
+
readonly type: "ephemeral";
|
|
80
|
+
readonly ttl?: string | undefined;
|
|
81
|
+
} | undefined;
|
|
82
|
+
}[] | null;
|
|
83
|
+
readonly role: "assistant";
|
|
84
|
+
readonly reasoning?: string | undefined;
|
|
85
|
+
readonly reasoning_content?: string | undefined;
|
|
86
|
+
readonly reasoning_text?: string | undefined;
|
|
87
|
+
readonly tool_calls?: readonly {
|
|
88
|
+
readonly function: {
|
|
89
|
+
readonly name: string;
|
|
90
|
+
readonly arguments: string;
|
|
91
|
+
};
|
|
92
|
+
readonly id: string;
|
|
93
|
+
readonly type: "function";
|
|
94
|
+
readonly thought_signature?: string | undefined;
|
|
95
|
+
readonly extra_content?: {
|
|
96
|
+
readonly google: {
|
|
97
|
+
readonly thought_signature: string;
|
|
98
|
+
};
|
|
99
|
+
} | undefined;
|
|
100
|
+
}[] | undefined;
|
|
101
|
+
readonly thought_signature?: string | undefined;
|
|
102
|
+
readonly reasoning_details?: unknown;
|
|
103
|
+
})[];
|
|
104
|
+
readonly stream: true;
|
|
105
|
+
readonly venice_parameters: {
|
|
106
|
+
readonly [x: string]: string | boolean;
|
|
107
|
+
};
|
|
108
|
+
readonly reasoning?: {
|
|
109
|
+
readonly enabled?: boolean | undefined;
|
|
110
|
+
readonly summary?: string | undefined;
|
|
111
|
+
readonly effort?: string | undefined;
|
|
112
|
+
} | undefined;
|
|
113
|
+
readonly max_completion_tokens?: number | undefined;
|
|
114
|
+
readonly max_tokens?: number | undefined;
|
|
115
|
+
readonly tools?: readonly {
|
|
116
|
+
readonly function: {
|
|
117
|
+
readonly description: string;
|
|
118
|
+
readonly name: string;
|
|
119
|
+
readonly parameters: {
|
|
120
|
+
readonly [x: string]: unknown;
|
|
121
|
+
};
|
|
122
|
+
readonly strict?: boolean | undefined;
|
|
123
|
+
};
|
|
124
|
+
readonly type: "function";
|
|
125
|
+
readonly cache_control?: {
|
|
126
|
+
readonly type: "ephemeral";
|
|
127
|
+
readonly ttl?: string | undefined;
|
|
128
|
+
} | undefined;
|
|
129
|
+
}[] | undefined;
|
|
130
|
+
readonly stop?: readonly string[] | undefined;
|
|
131
|
+
readonly user?: string | undefined;
|
|
132
|
+
readonly temperature?: number | undefined;
|
|
133
|
+
readonly seed?: number | undefined;
|
|
134
|
+
readonly tool_choice?: "required" | "auto" | "none" | {
|
|
135
|
+
readonly type: "function";
|
|
136
|
+
readonly function: {
|
|
137
|
+
readonly name: string;
|
|
138
|
+
};
|
|
139
|
+
} | undefined;
|
|
140
|
+
readonly top_p?: number | undefined;
|
|
141
|
+
readonly top_k?: number | undefined;
|
|
142
|
+
readonly frequency_penalty?: number | undefined;
|
|
143
|
+
readonly presence_penalty?: number | undefined;
|
|
144
|
+
readonly store?: boolean | undefined;
|
|
145
|
+
readonly prompt_cache_key?: string | undefined;
|
|
146
|
+
readonly parallel_tool_calls?: boolean | undefined;
|
|
147
|
+
readonly reasoning_effort?: import("../schema/options.js").ReasoningEffort | undefined;
|
|
148
|
+
readonly stream_options?: {
|
|
149
|
+
readonly include_usage: boolean;
|
|
150
|
+
} | undefined;
|
|
151
|
+
readonly tool_stream?: boolean | undefined;
|
|
152
|
+
readonly top_logprobs?: number | undefined;
|
|
153
|
+
readonly prompt_cache_retention?: string | undefined;
|
|
154
|
+
readonly repetition_penalty?: number | undefined;
|
|
155
|
+
readonly response_format?: {
|
|
156
|
+
readonly [x: string]: unknown;
|
|
157
|
+
} | undefined;
|
|
158
|
+
readonly logprobs?: boolean | undefined;
|
|
159
|
+
readonly min_p?: number | undefined;
|
|
160
|
+
readonly stop_token_ids?: readonly number[] | undefined;
|
|
161
|
+
readonly max_temp?: number | undefined;
|
|
162
|
+
readonly min_temp?: number | undefined;
|
|
163
|
+
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
|
|
164
|
+
export declare const configure: (input?: Config) => {
|
|
165
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
166
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<VeniceChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
167
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<VeniceChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
168
|
+
configure: (input?: Config) => /*elided*/ any;
|
|
169
|
+
};
|
|
170
|
+
export declare const provider: {
|
|
171
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
172
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<VeniceChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
173
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<VeniceChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
174
|
+
configure: (input?: Config) => {
|
|
175
|
+
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
176
|
+
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<VeniceChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
177
|
+
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<VeniceChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
178
|
+
configure: /*elided*/ any;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<VeniceChat.OptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
182
|
+
export declare const model: ProviderPackage.Definition<Settings, ChatOptionsInput>["model"];
|
|
183
|
+
export * as Venice from "./venice.js";
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { VeniceChat } from "../protocols/venice-chat.js";
|
|
2
|
+
import { OpenAIChat } from "../protocols/openai-chat.js";
|
|
3
|
+
import { AuthOptions } from "../route/auth-options.js";
|
|
4
|
+
import { Route } from "../route/client.js";
|
|
5
|
+
import { Endpoint } from "../route/endpoint.js";
|
|
6
|
+
import { ProviderID } from "../schema/index.js";
|
|
7
|
+
export const id = ProviderID.make("venice");
|
|
8
|
+
const route = Route.make({
|
|
9
|
+
id: "venice-chat",
|
|
10
|
+
provider: id,
|
|
11
|
+
providerMetadataKey: "venice",
|
|
12
|
+
protocol: VeniceChat.protocol,
|
|
13
|
+
endpoint: Endpoint.path("/chat/completions", { baseURL: "https://api.venice.ai/api/v1" }),
|
|
14
|
+
framing: OpenAIChat.framing,
|
|
15
|
+
});
|
|
16
|
+
export const routes = [route];
|
|
17
|
+
export const configure = (input = {}) => {
|
|
18
|
+
const { apiKey: _apiKey, auth: _auth, baseURL, queryParams, ...rest } = input;
|
|
19
|
+
const chat = (modelID) => route
|
|
20
|
+
.with({
|
|
21
|
+
...rest,
|
|
22
|
+
endpoint: { baseURL: baseURL ?? route.endpoint.baseURL, query: queryParams },
|
|
23
|
+
auth: AuthOptions.bearer(input, "VENICE_API_KEY"),
|
|
24
|
+
})
|
|
25
|
+
.model({ id: modelID, compatibility: VeniceChat.compatibility });
|
|
26
|
+
return { id, model: chat, chat, configure };
|
|
27
|
+
};
|
|
28
|
+
export const provider = configure();
|
|
29
|
+
export const chat = provider.chat;
|
|
30
|
+
export const model = (modelID, { apiKey, baseURL, queryParams, body, headers, ...providerOptions }) => configure({
|
|
31
|
+
apiKey,
|
|
32
|
+
baseURL,
|
|
33
|
+
queryParams,
|
|
34
|
+
headers,
|
|
35
|
+
http: body === undefined ? undefined : { body: { ...body } },
|
|
36
|
+
providerOptions,
|
|
37
|
+
}).model(modelID);
|
|
38
|
+
export * as Venice from "./venice.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { chatModel as model } from "../vercel-ai-gateway.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { messagesModel as model } from "../vercel-ai-gateway.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { responsesModel as model } from "../vercel-ai-gateway.js";
|