@opencode/ai 2.2.0 → 2.2.1
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 +66 -62
- package/dist/effect.d.ts +1 -1
- package/dist/effect.js +1 -1
- package/dist/image-client.d.ts +45 -0
- package/dist/index.d.ts +38 -20
- package/dist/index.js +14 -2
- package/dist/media-client.d.ts +1 -0
- package/dist/media-client.js +1 -0
- package/dist/protocols/alibaba-chat.d.ts +39 -4
- package/dist/protocols/alibaba-responses.d.ts +20 -3
- package/dist/protocols/google-images.js +3 -1
- package/dist/protocols/meta-responses.d.ts +40 -6
- package/dist/protocols/meta-responses.js +1 -1
- package/dist/protocols/minimax-images.d.ts +25 -0
- package/dist/protocols/minimax-images.js +150 -0
- package/dist/protocols/open-responses.d.ts +182 -27
- package/dist/protocols/open-responses.js +108 -36
- package/dist/protocols/openai-chat.d.ts +438 -46
- package/dist/protocols/openai-chat.js +121 -39
- package/dist/protocols/openai-compatible-chat.d.ts +35 -4
- package/dist/protocols/openai-compatible-responses.d.ts +20 -3
- package/dist/protocols/openai-freeform.d.ts +47 -0
- package/dist/protocols/openai-freeform.js +54 -0
- package/dist/protocols/openai-images.d.ts +16 -1
- package/dist/protocols/openai-images.js +49 -17
- package/dist/protocols/openai-responses.d.ts +120 -18
- package/dist/protocols/openai-responses.js +17 -8
- package/dist/protocols/venice-chat.d.ts +39 -4
- package/dist/protocols/venice-chat.js +1 -1
- package/dist/protocols/xai-images.d.ts +6 -0
- package/dist/protocols/xai-images.js +4 -5
- package/dist/protocols/xai-responses.d.ts +20 -3
- package/dist/protocols/xai-responses.js +2 -1
- package/dist/protocols/zai-chat.d.ts +39 -4
- package/dist/provider-error.js +5 -4
- package/dist/provider-package.d.ts +2 -0
- package/dist/providers/alibaba.d.ts +58 -10
- package/dist/providers/amazon-bedrock-mantle.d.ts +66 -11
- package/dist/providers/amazon-bedrock-mantle.js +1 -1
- package/dist/providers/amazon-bedrock.d.ts +1 -1
- package/dist/providers/amazon-bedrock.js +1 -1
- package/dist/providers/anthropic-compatible.d.ts +1 -1
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/anthropic.js +1 -1
- package/dist/providers/azure.d.ts +79 -15
- package/dist/providers/baseten.d.ts +74 -12
- package/dist/providers/baseten.js +1 -1
- package/dist/providers/cerebras.d.ts +73 -11
- package/dist/providers/cerebras.js +1 -1
- package/dist/providers/cloudflare-ai-gateway.d.ts +113 -17
- package/dist/providers/cloudflare-workers-ai.d.ts +73 -11
- package/dist/providers/cohere/chat.d.ts +1 -1
- package/dist/providers/cohere/chat.js +1 -1
- package/dist/providers/cohere.d.ts +73 -11
- package/dist/providers/cohere.js +1 -1
- package/dist/providers/deepinfra.d.ts +73 -11
- package/dist/providers/deepinfra.js +1 -1
- package/dist/providers/deepseek.d.ts +73 -11
- package/dist/providers/deepseek.js +1 -1
- package/dist/providers/digitalocean/responses.d.ts +4 -0
- package/dist/providers/digitalocean/responses.js +1 -0
- package/dist/providers/digitalocean.d.ts +320 -21
- package/dist/providers/digitalocean.js +18 -7
- package/dist/providers/fireworks.d.ts +73 -11
- package/dist/providers/fireworks.js +1 -1
- package/dist/providers/google/interactions.d.ts +1 -1
- package/dist/providers/google/interactions.js +1 -1
- package/dist/providers/google-vertex-chat.d.ts +36 -5
- package/dist/providers/google-vertex-chat.js +1 -1
- package/dist/providers/google-vertex-interactions.d.ts +1 -1
- package/dist/providers/google-vertex-interactions.js +1 -1
- package/dist/providers/google-vertex-messages.d.ts +1 -1
- package/dist/providers/google-vertex-messages.js +1 -1
- package/dist/providers/google-vertex-mistral.d.ts +1 -1
- package/dist/providers/google-vertex-mistral.js +1 -1
- package/dist/providers/google-vertex-responses.d.ts +21 -4
- package/dist/providers/google-vertex-responses.js +1 -1
- package/dist/providers/google-vertex.d.ts +2 -2
- package/dist/providers/google-vertex.js +1 -1
- package/dist/providers/google.d.ts +2 -2
- package/dist/providers/google.js +1 -1
- package/dist/providers/groq.d.ts +77 -11
- package/dist/providers/groq.js +1 -1
- package/dist/providers/index.d.ts +0 -4
- package/dist/providers/index.js +0 -4
- package/dist/providers/meta/images.d.ts +2 -0
- package/dist/providers/meta/images.js +1 -0
- package/dist/providers/meta.d.ts +61 -12
- package/dist/providers/meta.js +2 -1
- package/dist/providers/minimax/chat.d.ts +1 -1
- package/dist/providers/minimax/chat.js +1 -1
- package/dist/providers/minimax/images.d.ts +3 -0
- package/dist/providers/minimax/images.js +1 -0
- package/dist/providers/minimax/responses.d.ts +1 -1
- package/dist/providers/minimax/responses.js +1 -1
- package/dist/providers/minimax.d.ts +63 -9
- package/dist/providers/minimax.js +22 -9
- package/dist/providers/mistral.d.ts +3 -3
- package/dist/providers/mistral.js +1 -1
- package/dist/providers/moonshot/messages.d.ts +1 -1
- package/dist/providers/moonshot/messages.js +1 -1
- package/dist/providers/moonshot/responses.d.ts +1 -1
- package/dist/providers/moonshot/responses.js +1 -1
- package/dist/providers/moonshot.d.ts +56 -8
- package/dist/providers/moonshot.js +1 -1
- package/dist/providers/openai-compatible-responses.d.ts +21 -4
- package/dist/providers/openai-compatible.d.ts +38 -7
- package/dist/providers/openai-compatible.js +9 -2
- package/dist/providers/openai.d.ts +59 -11
- package/dist/providers/openai.js +4 -2
- package/dist/providers/opencode.d.ts +3 -3
- package/dist/providers/opencode.js +1 -1
- package/dist/providers/openrouter/responses.d.ts +4 -0
- package/dist/providers/openrouter/responses.js +1 -0
- package/dist/providers/openrouter.d.ts +356 -26
- package/dist/providers/openrouter.js +42 -13
- package/dist/providers/togetherai.d.ts +73 -11
- package/dist/providers/togetherai.js +1 -1
- package/dist/providers/typesafe-ai.d.ts +3 -3
- package/dist/providers/typesafe-ai.js +1 -1
- package/dist/providers/venice/responses.d.ts +4 -0
- package/dist/providers/venice/responses.js +1 -0
- package/dist/providers/venice.d.ts +242 -9
- package/dist/providers/venice.js +33 -17
- package/dist/providers/vercel-ai-gateway.d.ts +8 -8
- package/dist/providers/vercel-ai-gateway.js +12 -2
- package/dist/providers/xai.d.ts +39 -8
- package/dist/providers/xai.js +1 -1
- package/dist/providers/zai-coding-plan/messages.d.ts +1 -1
- package/dist/providers/zai-coding-plan/messages.js +1 -1
- package/dist/providers/zai-coding-plan/responses.d.ts +1 -1
- package/dist/providers/zai-coding-plan/responses.js +1 -1
- package/dist/providers/zai-coding-plan.d.ts +56 -8
- package/dist/providers/zai-coding-plan.js +1 -1
- package/dist/providers/zai.d.ts +37 -6
- package/dist/providers/zai.js +1 -1
- package/dist/route/auth.d.ts +1 -1
- package/dist/route/media-protocol.d.ts +2 -4
- package/dist/route/media.d.ts +1 -1
- package/dist/route/media.js +2 -4
- package/dist/schema/messages.d.ts +35 -1
- package/dist/schema/messages.js +20 -0
- package/dist/speech-client.d.ts +48 -0
- package/dist/testing/decision.d.ts +16 -0
- package/dist/testing/decision.js +20 -0
- package/dist/testing/image.d.ts +14 -0
- package/dist/testing/image.js +12 -0
- package/dist/testing/media.d.ts +18 -0
- package/dist/testing/media.js +36 -0
- package/dist/testing/script.d.ts +28 -0
- package/dist/testing/script.js +60 -0
- package/dist/testing/speech.d.ts +14 -0
- package/dist/testing/speech.js +12 -0
- package/dist/testing/transcription.d.ts +14 -0
- package/dist/testing/transcription.js +12 -0
- package/dist/testing/video.d.ts +14 -0
- package/dist/testing/video.js +12 -0
- package/dist/testing.d.ts +10 -21
- package/dist/testing.js +11 -54
- package/dist/tool.d.ts +12 -1
- package/dist/tool.js +10 -2
- package/dist/transcription-client.d.ts +64 -0
- package/dist/video-client.d.ts +41 -0
- package/package.json +22 -38
- package/dist/protocols/bfl-images.d.ts +0 -47
- package/dist/protocols/bfl-images.js +0 -155
- package/dist/protocols/fal-images.d.ts +0 -34
- package/dist/protocols/fal-images.js +0 -95
- package/dist/protocols/fal-video.d.ts +0 -29
- package/dist/protocols/fal-video.js +0 -73
- package/dist/protocols/replicate-images.d.ts +0 -28
- package/dist/protocols/replicate-images.js +0 -127
- package/dist/protocols/stability-images.d.ts +0 -44
- package/dist/protocols/stability-images.js +0 -131
- package/dist/protocols/utils/fal-queue.d.ts +0 -26
- package/dist/protocols/utils/fal-queue.js +0 -67
- package/dist/providers/black-forest-labs.d.ts +0 -21
- package/dist/providers/black-forest-labs.js +0 -23
- package/dist/providers/fal.d.ts +0 -24
- package/dist/providers/fal.js +0 -26
- package/dist/providers/replicate.d.ts +0 -21
- package/dist/providers/replicate.js +0 -17
- package/dist/providers/stability.d.ts +0 -23
- package/dist/providers/stability.js +0 -18
|
@@ -18,7 +18,7 @@ type GatewayOptions = {
|
|
|
18
18
|
readonly skipCache?: boolean;
|
|
19
19
|
readonly collectLog?: boolean;
|
|
20
20
|
};
|
|
21
|
-
export type
|
|
21
|
+
export type Config = GatewayURL & GatewayOptions & Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
22
22
|
readonly gatewayApiKey?: string | Redacted.Redacted | Config.Config<string | Redacted.Redacted>;
|
|
23
23
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
24
24
|
};
|
|
@@ -45,7 +45,7 @@ export declare const responsesRoute: import("../route/client.js").Route<{
|
|
|
45
45
|
readonly role: "developer";
|
|
46
46
|
readonly content: string;
|
|
47
47
|
} | {
|
|
48
|
-
readonly type: "function_call_output";
|
|
48
|
+
readonly type: "custom_tool_call_output" | "function_call_output";
|
|
49
49
|
readonly call_id: string;
|
|
50
50
|
readonly output: string | readonly ({
|
|
51
51
|
readonly type: "input_text";
|
|
@@ -115,6 +115,12 @@ export declare const responsesRoute: import("../route/client.js").Route<{
|
|
|
115
115
|
readonly name: string;
|
|
116
116
|
readonly namespace?: string | undefined;
|
|
117
117
|
readonly arguments: string;
|
|
118
|
+
} | {
|
|
119
|
+
readonly type: "custom_tool_call";
|
|
120
|
+
readonly id?: string | undefined;
|
|
121
|
+
readonly call_id: string;
|
|
122
|
+
readonly name: string;
|
|
123
|
+
readonly input: string;
|
|
118
124
|
} | {
|
|
119
125
|
readonly [x: string]: unknown;
|
|
120
126
|
readonly type: "web_search_call";
|
|
@@ -186,6 +192,17 @@ export declare const responsesRoute: import("../route/client.js").Route<{
|
|
|
186
192
|
readonly ttl?: string | undefined;
|
|
187
193
|
} | undefined;
|
|
188
194
|
readonly tools?: readonly ({
|
|
195
|
+
readonly type: "custom";
|
|
196
|
+
readonly name: string;
|
|
197
|
+
readonly description: string;
|
|
198
|
+
readonly format: {
|
|
199
|
+
readonly type: "text";
|
|
200
|
+
} | {
|
|
201
|
+
readonly type: "grammar";
|
|
202
|
+
readonly syntax: "lark" | "regex";
|
|
203
|
+
readonly definition: string;
|
|
204
|
+
};
|
|
205
|
+
} | {
|
|
189
206
|
readonly type: "namespace";
|
|
190
207
|
readonly name: string;
|
|
191
208
|
readonly description: string;
|
|
@@ -218,13 +235,13 @@ export declare const responsesRoute: import("../route/client.js").Route<{
|
|
|
218
235
|
readonly size?: string | undefined;
|
|
219
236
|
})[] | undefined;
|
|
220
237
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
221
|
-
readonly type: "function";
|
|
238
|
+
readonly type: "custom" | "function";
|
|
222
239
|
readonly name: string;
|
|
223
240
|
} | {
|
|
224
241
|
readonly type: "allowed_tools";
|
|
225
242
|
readonly mode: "auto" | "none" | "required";
|
|
226
243
|
readonly tools: readonly {
|
|
227
|
-
readonly type: "function";
|
|
244
|
+
readonly type: "custom" | "function";
|
|
228
245
|
readonly name: string;
|
|
229
246
|
}[];
|
|
230
247
|
} | {
|
|
@@ -629,7 +646,14 @@ export declare const route: import("../route/client.js").Route<{
|
|
|
629
646
|
readonly ttl?: string | undefined;
|
|
630
647
|
} | undefined;
|
|
631
648
|
}[] | null;
|
|
632
|
-
readonly tool_calls?: readonly {
|
|
649
|
+
readonly tool_calls?: readonly ({
|
|
650
|
+
readonly id: string;
|
|
651
|
+
readonly type: "custom";
|
|
652
|
+
readonly custom: {
|
|
653
|
+
readonly name: string;
|
|
654
|
+
readonly input: string;
|
|
655
|
+
};
|
|
656
|
+
} | {
|
|
633
657
|
readonly id: string;
|
|
634
658
|
readonly type: "function";
|
|
635
659
|
readonly function: {
|
|
@@ -641,13 +665,13 @@ export declare const route: import("../route/client.js").Route<{
|
|
|
641
665
|
readonly thought_signature: string;
|
|
642
666
|
};
|
|
643
667
|
} | undefined;
|
|
644
|
-
}[] | undefined;
|
|
668
|
+
})[] | undefined;
|
|
645
669
|
readonly reasoning_content?: string | undefined;
|
|
646
670
|
readonly reasoning?: string | undefined;
|
|
647
671
|
readonly reasoning_text?: string | undefined;
|
|
648
672
|
readonly reasoning_details?: unknown;
|
|
649
673
|
})[];
|
|
650
|
-
readonly tools?: readonly {
|
|
674
|
+
readonly tools?: readonly ({
|
|
651
675
|
readonly type: "function";
|
|
652
676
|
readonly function: {
|
|
653
677
|
readonly name: string;
|
|
@@ -661,12 +685,36 @@ export declare const route: import("../route/client.js").Route<{
|
|
|
661
685
|
readonly type: "ephemeral";
|
|
662
686
|
readonly ttl?: string | undefined;
|
|
663
687
|
} | undefined;
|
|
664
|
-
}
|
|
688
|
+
} | {
|
|
689
|
+
readonly type: "custom";
|
|
690
|
+
readonly custom: {
|
|
691
|
+
readonly name: string;
|
|
692
|
+
readonly description: string;
|
|
693
|
+
readonly format: {
|
|
694
|
+
readonly type: "text";
|
|
695
|
+
} | {
|
|
696
|
+
readonly type: "grammar";
|
|
697
|
+
readonly grammar: {
|
|
698
|
+
readonly syntax: "lark" | "regex";
|
|
699
|
+
readonly definition: string;
|
|
700
|
+
};
|
|
701
|
+
};
|
|
702
|
+
};
|
|
703
|
+
readonly cache_control?: {
|
|
704
|
+
readonly type: "ephemeral";
|
|
705
|
+
readonly ttl?: string | undefined;
|
|
706
|
+
} | undefined;
|
|
707
|
+
})[] | undefined;
|
|
665
708
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
666
709
|
readonly type: "function";
|
|
667
710
|
readonly function: {
|
|
668
711
|
readonly name: string;
|
|
669
712
|
};
|
|
713
|
+
} | {
|
|
714
|
+
readonly type: "custom";
|
|
715
|
+
readonly custom: {
|
|
716
|
+
readonly name: string;
|
|
717
|
+
};
|
|
670
718
|
} | undefined;
|
|
671
719
|
readonly stream: true;
|
|
672
720
|
readonly stream_options?: {
|
|
@@ -1079,7 +1127,14 @@ export declare const routes: (import("../route/client.js").Route<{
|
|
|
1079
1127
|
readonly ttl?: string | undefined;
|
|
1080
1128
|
} | undefined;
|
|
1081
1129
|
}[] | null;
|
|
1082
|
-
readonly tool_calls?: readonly {
|
|
1130
|
+
readonly tool_calls?: readonly ({
|
|
1131
|
+
readonly id: string;
|
|
1132
|
+
readonly type: "custom";
|
|
1133
|
+
readonly custom: {
|
|
1134
|
+
readonly name: string;
|
|
1135
|
+
readonly input: string;
|
|
1136
|
+
};
|
|
1137
|
+
} | {
|
|
1083
1138
|
readonly id: string;
|
|
1084
1139
|
readonly type: "function";
|
|
1085
1140
|
readonly function: {
|
|
@@ -1091,13 +1146,13 @@ export declare const routes: (import("../route/client.js").Route<{
|
|
|
1091
1146
|
readonly thought_signature: string;
|
|
1092
1147
|
};
|
|
1093
1148
|
} | undefined;
|
|
1094
|
-
}[] | undefined;
|
|
1149
|
+
})[] | undefined;
|
|
1095
1150
|
readonly reasoning_content?: string | undefined;
|
|
1096
1151
|
readonly reasoning?: string | undefined;
|
|
1097
1152
|
readonly reasoning_text?: string | undefined;
|
|
1098
1153
|
readonly reasoning_details?: unknown;
|
|
1099
1154
|
})[];
|
|
1100
|
-
readonly tools?: readonly {
|
|
1155
|
+
readonly tools?: readonly ({
|
|
1101
1156
|
readonly type: "function";
|
|
1102
1157
|
readonly function: {
|
|
1103
1158
|
readonly name: string;
|
|
@@ -1111,12 +1166,36 @@ export declare const routes: (import("../route/client.js").Route<{
|
|
|
1111
1166
|
readonly type: "ephemeral";
|
|
1112
1167
|
readonly ttl?: string | undefined;
|
|
1113
1168
|
} | undefined;
|
|
1114
|
-
}
|
|
1169
|
+
} | {
|
|
1170
|
+
readonly type: "custom";
|
|
1171
|
+
readonly custom: {
|
|
1172
|
+
readonly name: string;
|
|
1173
|
+
readonly description: string;
|
|
1174
|
+
readonly format: {
|
|
1175
|
+
readonly type: "text";
|
|
1176
|
+
} | {
|
|
1177
|
+
readonly type: "grammar";
|
|
1178
|
+
readonly grammar: {
|
|
1179
|
+
readonly syntax: "lark" | "regex";
|
|
1180
|
+
readonly definition: string;
|
|
1181
|
+
};
|
|
1182
|
+
};
|
|
1183
|
+
};
|
|
1184
|
+
readonly cache_control?: {
|
|
1185
|
+
readonly type: "ephemeral";
|
|
1186
|
+
readonly ttl?: string | undefined;
|
|
1187
|
+
} | undefined;
|
|
1188
|
+
})[] | undefined;
|
|
1115
1189
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
1116
1190
|
readonly type: "function";
|
|
1117
1191
|
readonly function: {
|
|
1118
1192
|
readonly name: string;
|
|
1119
1193
|
};
|
|
1194
|
+
} | {
|
|
1195
|
+
readonly type: "custom";
|
|
1196
|
+
readonly custom: {
|
|
1197
|
+
readonly name: string;
|
|
1198
|
+
};
|
|
1120
1199
|
} | undefined;
|
|
1121
1200
|
readonly stream: true;
|
|
1122
1201
|
readonly stream_options?: {
|
|
@@ -1161,7 +1240,7 @@ export declare const routes: (import("../route/client.js").Route<{
|
|
|
1161
1240
|
readonly role: "developer";
|
|
1162
1241
|
readonly content: string;
|
|
1163
1242
|
} | {
|
|
1164
|
-
readonly type: "function_call_output";
|
|
1243
|
+
readonly type: "custom_tool_call_output" | "function_call_output";
|
|
1165
1244
|
readonly call_id: string;
|
|
1166
1245
|
readonly output: string | readonly ({
|
|
1167
1246
|
readonly type: "input_text";
|
|
@@ -1231,6 +1310,12 @@ export declare const routes: (import("../route/client.js").Route<{
|
|
|
1231
1310
|
readonly name: string;
|
|
1232
1311
|
readonly namespace?: string | undefined;
|
|
1233
1312
|
readonly arguments: string;
|
|
1313
|
+
} | {
|
|
1314
|
+
readonly type: "custom_tool_call";
|
|
1315
|
+
readonly id?: string | undefined;
|
|
1316
|
+
readonly call_id: string;
|
|
1317
|
+
readonly name: string;
|
|
1318
|
+
readonly input: string;
|
|
1234
1319
|
} | {
|
|
1235
1320
|
readonly [x: string]: unknown;
|
|
1236
1321
|
readonly type: "web_search_call";
|
|
@@ -1302,6 +1387,17 @@ export declare const routes: (import("../route/client.js").Route<{
|
|
|
1302
1387
|
readonly ttl?: string | undefined;
|
|
1303
1388
|
} | undefined;
|
|
1304
1389
|
readonly tools?: readonly ({
|
|
1390
|
+
readonly type: "custom";
|
|
1391
|
+
readonly name: string;
|
|
1392
|
+
readonly description: string;
|
|
1393
|
+
readonly format: {
|
|
1394
|
+
readonly type: "text";
|
|
1395
|
+
} | {
|
|
1396
|
+
readonly type: "grammar";
|
|
1397
|
+
readonly syntax: "lark" | "regex";
|
|
1398
|
+
readonly definition: string;
|
|
1399
|
+
};
|
|
1400
|
+
} | {
|
|
1305
1401
|
readonly type: "namespace";
|
|
1306
1402
|
readonly name: string;
|
|
1307
1403
|
readonly description: string;
|
|
@@ -1334,13 +1430,13 @@ export declare const routes: (import("../route/client.js").Route<{
|
|
|
1334
1430
|
readonly size?: string | undefined;
|
|
1335
1431
|
})[] | undefined;
|
|
1336
1432
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
1337
|
-
readonly type: "function";
|
|
1433
|
+
readonly type: "custom" | "function";
|
|
1338
1434
|
readonly name: string;
|
|
1339
1435
|
} | {
|
|
1340
1436
|
readonly type: "allowed_tools";
|
|
1341
1437
|
readonly mode: "auto" | "none" | "required";
|
|
1342
1438
|
readonly tools: readonly {
|
|
1343
|
-
readonly type: "function";
|
|
1439
|
+
readonly type: "custom" | "function";
|
|
1344
1440
|
readonly name: string;
|
|
1345
1441
|
}[];
|
|
1346
1442
|
} | {
|
|
@@ -1361,7 +1457,7 @@ export declare const routes: (import("../route/client.js").Route<{
|
|
|
1361
1457
|
endpoint: import("../route/client.js").CompactOperation;
|
|
1362
1458
|
trigger: import("../route/client.js").TriggerCompactOperation;
|
|
1363
1459
|
}>)[];
|
|
1364
|
-
export declare const configure: (input:
|
|
1460
|
+
export declare const configure: (input: Config) => {
|
|
1365
1461
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
1366
1462
|
model: (value: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, {
|
|
1367
1463
|
endpoint: import("../route/client.js").CompactOperation;
|
|
@@ -1374,6 +1470,6 @@ export declare const provider: {
|
|
|
1374
1470
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
1375
1471
|
configure: typeof configure;
|
|
1376
1472
|
};
|
|
1377
|
-
export declare const model: ProviderPackage.
|
|
1473
|
+
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
1378
1474
|
export declare const decisionModel: (modelID: string, settings: Settings) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
1379
1475
|
export * as CloudflareAIGateway from "./cloudflare-ai-gateway.js";
|
|
@@ -9,7 +9,7 @@ type WorkersAIURL = AtLeastOne<{
|
|
|
9
9
|
readonly accountId: string;
|
|
10
10
|
readonly baseURL: string;
|
|
11
11
|
}>;
|
|
12
|
-
export type
|
|
12
|
+
export type Config = WorkersAIURL & Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
13
13
|
readonly providerOptions?: OpenAIProviderOptionsInput;
|
|
14
14
|
};
|
|
15
15
|
export type Settings = ProviderPackage.Settings & OpenAIProviderOptionsInput & WorkersAIURL & {
|
|
@@ -95,7 +95,14 @@ export declare const route: Route<{
|
|
|
95
95
|
readonly ttl?: string | undefined;
|
|
96
96
|
} | undefined;
|
|
97
97
|
}[] | null;
|
|
98
|
-
readonly tool_calls?: readonly {
|
|
98
|
+
readonly tool_calls?: readonly ({
|
|
99
|
+
readonly id: string;
|
|
100
|
+
readonly type: "custom";
|
|
101
|
+
readonly custom: {
|
|
102
|
+
readonly name: string;
|
|
103
|
+
readonly input: string;
|
|
104
|
+
};
|
|
105
|
+
} | {
|
|
99
106
|
readonly id: string;
|
|
100
107
|
readonly type: "function";
|
|
101
108
|
readonly function: {
|
|
@@ -107,13 +114,13 @@ export declare const route: Route<{
|
|
|
107
114
|
readonly thought_signature: string;
|
|
108
115
|
};
|
|
109
116
|
} | undefined;
|
|
110
|
-
}[] | undefined;
|
|
117
|
+
})[] | undefined;
|
|
111
118
|
readonly reasoning_content?: string | undefined;
|
|
112
119
|
readonly reasoning?: string | undefined;
|
|
113
120
|
readonly reasoning_text?: string | undefined;
|
|
114
121
|
readonly reasoning_details?: unknown;
|
|
115
122
|
})[];
|
|
116
|
-
readonly tools?: readonly {
|
|
123
|
+
readonly tools?: readonly ({
|
|
117
124
|
readonly type: "function";
|
|
118
125
|
readonly function: {
|
|
119
126
|
readonly name: string;
|
|
@@ -127,12 +134,36 @@ export declare const route: Route<{
|
|
|
127
134
|
readonly type: "ephemeral";
|
|
128
135
|
readonly ttl?: string | undefined;
|
|
129
136
|
} | undefined;
|
|
130
|
-
}
|
|
137
|
+
} | {
|
|
138
|
+
readonly type: "custom";
|
|
139
|
+
readonly custom: {
|
|
140
|
+
readonly name: string;
|
|
141
|
+
readonly description: string;
|
|
142
|
+
readonly format: {
|
|
143
|
+
readonly type: "text";
|
|
144
|
+
} | {
|
|
145
|
+
readonly type: "grammar";
|
|
146
|
+
readonly grammar: {
|
|
147
|
+
readonly syntax: "lark" | "regex";
|
|
148
|
+
readonly definition: string;
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
readonly cache_control?: {
|
|
153
|
+
readonly type: "ephemeral";
|
|
154
|
+
readonly ttl?: string | undefined;
|
|
155
|
+
} | undefined;
|
|
156
|
+
})[] | undefined;
|
|
131
157
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
132
158
|
readonly type: "function";
|
|
133
159
|
readonly function: {
|
|
134
160
|
readonly name: string;
|
|
135
161
|
};
|
|
162
|
+
} | {
|
|
163
|
+
readonly type: "custom";
|
|
164
|
+
readonly custom: {
|
|
165
|
+
readonly name: string;
|
|
166
|
+
};
|
|
136
167
|
} | undefined;
|
|
137
168
|
readonly stream: true;
|
|
138
169
|
readonly stream_options?: {
|
|
@@ -238,7 +269,14 @@ export declare const routes: Route<{
|
|
|
238
269
|
readonly ttl?: string | undefined;
|
|
239
270
|
} | undefined;
|
|
240
271
|
}[] | null;
|
|
241
|
-
readonly tool_calls?: readonly {
|
|
272
|
+
readonly tool_calls?: readonly ({
|
|
273
|
+
readonly id: string;
|
|
274
|
+
readonly type: "custom";
|
|
275
|
+
readonly custom: {
|
|
276
|
+
readonly name: string;
|
|
277
|
+
readonly input: string;
|
|
278
|
+
};
|
|
279
|
+
} | {
|
|
242
280
|
readonly id: string;
|
|
243
281
|
readonly type: "function";
|
|
244
282
|
readonly function: {
|
|
@@ -250,13 +288,13 @@ export declare const routes: Route<{
|
|
|
250
288
|
readonly thought_signature: string;
|
|
251
289
|
};
|
|
252
290
|
} | undefined;
|
|
253
|
-
}[] | undefined;
|
|
291
|
+
})[] | undefined;
|
|
254
292
|
readonly reasoning_content?: string | undefined;
|
|
255
293
|
readonly reasoning?: string | undefined;
|
|
256
294
|
readonly reasoning_text?: string | undefined;
|
|
257
295
|
readonly reasoning_details?: unknown;
|
|
258
296
|
})[];
|
|
259
|
-
readonly tools?: readonly {
|
|
297
|
+
readonly tools?: readonly ({
|
|
260
298
|
readonly type: "function";
|
|
261
299
|
readonly function: {
|
|
262
300
|
readonly name: string;
|
|
@@ -270,12 +308,36 @@ export declare const routes: Route<{
|
|
|
270
308
|
readonly type: "ephemeral";
|
|
271
309
|
readonly ttl?: string | undefined;
|
|
272
310
|
} | undefined;
|
|
273
|
-
}
|
|
311
|
+
} | {
|
|
312
|
+
readonly type: "custom";
|
|
313
|
+
readonly custom: {
|
|
314
|
+
readonly name: string;
|
|
315
|
+
readonly description: string;
|
|
316
|
+
readonly format: {
|
|
317
|
+
readonly type: "text";
|
|
318
|
+
} | {
|
|
319
|
+
readonly type: "grammar";
|
|
320
|
+
readonly grammar: {
|
|
321
|
+
readonly syntax: "lark" | "regex";
|
|
322
|
+
readonly definition: string;
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
};
|
|
326
|
+
readonly cache_control?: {
|
|
327
|
+
readonly type: "ephemeral";
|
|
328
|
+
readonly ttl?: string | undefined;
|
|
329
|
+
} | undefined;
|
|
330
|
+
})[] | undefined;
|
|
274
331
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
275
332
|
readonly type: "function";
|
|
276
333
|
readonly function: {
|
|
277
334
|
readonly name: string;
|
|
278
335
|
};
|
|
336
|
+
} | {
|
|
337
|
+
readonly type: "custom";
|
|
338
|
+
readonly custom: {
|
|
339
|
+
readonly name: string;
|
|
340
|
+
};
|
|
279
341
|
} | undefined;
|
|
280
342
|
readonly stream: true;
|
|
281
343
|
readonly stream_options?: {
|
|
@@ -305,7 +367,7 @@ export declare const routes: Route<{
|
|
|
305
367
|
readonly seed?: number | undefined;
|
|
306
368
|
readonly stop?: readonly string[] | undefined;
|
|
307
369
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>[];
|
|
308
|
-
export declare const configure: (input:
|
|
370
|
+
export declare const configure: (input: Config) => {
|
|
309
371
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
310
372
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<import("./openai-options.js").OpenAIOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
311
373
|
decision: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
@@ -321,7 +383,7 @@ export declare const provider: {
|
|
|
321
383
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
322
384
|
configure: typeof configure;
|
|
323
385
|
};
|
|
324
|
-
export declare const model: ProviderPackage.
|
|
386
|
+
export declare const model: ProviderPackage.Model<Settings, OpenAIProviderOptionsInput>;
|
|
325
387
|
export declare const imageModel: (modelID: string, settings: Settings) => import("../image.js").ImageModel<import("./cloudflare-workers-ai.js").CloudflareWorkersAIImageOptions>;
|
|
326
388
|
export declare const decisionModel: (modelID: string, settings: Settings) => import("../decision.js").DecisionModel<import("../decision.js").DecisionOptions>;
|
|
327
389
|
export * as CloudflareWorkersAI from "./cloudflare-workers-ai.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ProviderPackage } from "../../provider-package.js";
|
|
2
2
|
import { Cohere } from "../cohere.js";
|
|
3
3
|
export type Settings = Cohere.Settings<Cohere.ChatOptionsInput>;
|
|
4
|
-
export declare const model: ProviderPackage.
|
|
4
|
+
export declare const model: ProviderPackage.Model<Settings, Cohere.ChatOptionsInput>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cohere } from "../cohere.js";
|
|
2
|
-
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => Cohere.configure({
|
|
2
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions } = {}) => Cohere.configure({
|
|
3
3
|
apiKey,
|
|
4
4
|
baseURL,
|
|
5
5
|
headers,
|
|
@@ -8,7 +8,7 @@ export type ChatOptionsInput = {
|
|
|
8
8
|
readonly reasoningEffort?: OpenString<"none" | "high">;
|
|
9
9
|
};
|
|
10
10
|
export type ProviderOptions = CohereChat.ProviderOptionsInput & ChatOptionsInput;
|
|
11
|
-
export type
|
|
11
|
+
export type Config = Omit<RouteDefaultsInput, "providerOptions"> & ProviderAuthOption<"optional"> & {
|
|
12
12
|
readonly baseURL?: string;
|
|
13
13
|
readonly providerOptions?: ProviderOptions;
|
|
14
14
|
};
|
|
@@ -144,7 +144,14 @@ export declare const chatRoute: Route<{
|
|
|
144
144
|
readonly ttl?: string | undefined;
|
|
145
145
|
} | undefined;
|
|
146
146
|
}[] | null;
|
|
147
|
-
readonly tool_calls?: readonly {
|
|
147
|
+
readonly tool_calls?: readonly ({
|
|
148
|
+
readonly id: string;
|
|
149
|
+
readonly type: "custom";
|
|
150
|
+
readonly custom: {
|
|
151
|
+
readonly name: string;
|
|
152
|
+
readonly input: string;
|
|
153
|
+
};
|
|
154
|
+
} | {
|
|
148
155
|
readonly id: string;
|
|
149
156
|
readonly type: "function";
|
|
150
157
|
readonly function: {
|
|
@@ -156,13 +163,13 @@ export declare const chatRoute: Route<{
|
|
|
156
163
|
readonly thought_signature: string;
|
|
157
164
|
};
|
|
158
165
|
} | undefined;
|
|
159
|
-
}[] | undefined;
|
|
166
|
+
})[] | undefined;
|
|
160
167
|
readonly reasoning_content?: string | undefined;
|
|
161
168
|
readonly reasoning?: string | undefined;
|
|
162
169
|
readonly reasoning_text?: string | undefined;
|
|
163
170
|
readonly reasoning_details?: unknown;
|
|
164
171
|
})[];
|
|
165
|
-
readonly tools?: readonly {
|
|
172
|
+
readonly tools?: readonly ({
|
|
166
173
|
readonly type: "function";
|
|
167
174
|
readonly function: {
|
|
168
175
|
readonly name: string;
|
|
@@ -176,12 +183,36 @@ export declare const chatRoute: Route<{
|
|
|
176
183
|
readonly type: "ephemeral";
|
|
177
184
|
readonly ttl?: string | undefined;
|
|
178
185
|
} | undefined;
|
|
179
|
-
}
|
|
186
|
+
} | {
|
|
187
|
+
readonly type: "custom";
|
|
188
|
+
readonly custom: {
|
|
189
|
+
readonly name: string;
|
|
190
|
+
readonly description: string;
|
|
191
|
+
readonly format: {
|
|
192
|
+
readonly type: "text";
|
|
193
|
+
} | {
|
|
194
|
+
readonly type: "grammar";
|
|
195
|
+
readonly grammar: {
|
|
196
|
+
readonly syntax: "lark" | "regex";
|
|
197
|
+
readonly definition: string;
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
readonly cache_control?: {
|
|
202
|
+
readonly type: "ephemeral";
|
|
203
|
+
readonly ttl?: string | undefined;
|
|
204
|
+
} | undefined;
|
|
205
|
+
})[] | undefined;
|
|
180
206
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
181
207
|
readonly type: "function";
|
|
182
208
|
readonly function: {
|
|
183
209
|
readonly name: string;
|
|
184
210
|
};
|
|
211
|
+
} | {
|
|
212
|
+
readonly type: "custom";
|
|
213
|
+
readonly custom: {
|
|
214
|
+
readonly name: string;
|
|
215
|
+
};
|
|
185
216
|
} | undefined;
|
|
186
217
|
readonly stream: true;
|
|
187
218
|
readonly stream_options?: {
|
|
@@ -338,7 +369,14 @@ export declare const routes: (Route<{
|
|
|
338
369
|
readonly ttl?: string | undefined;
|
|
339
370
|
} | undefined;
|
|
340
371
|
}[] | null;
|
|
341
|
-
readonly tool_calls?: readonly {
|
|
372
|
+
readonly tool_calls?: readonly ({
|
|
373
|
+
readonly id: string;
|
|
374
|
+
readonly type: "custom";
|
|
375
|
+
readonly custom: {
|
|
376
|
+
readonly name: string;
|
|
377
|
+
readonly input: string;
|
|
378
|
+
};
|
|
379
|
+
} | {
|
|
342
380
|
readonly id: string;
|
|
343
381
|
readonly type: "function";
|
|
344
382
|
readonly function: {
|
|
@@ -350,13 +388,13 @@ export declare const routes: (Route<{
|
|
|
350
388
|
readonly thought_signature: string;
|
|
351
389
|
};
|
|
352
390
|
} | undefined;
|
|
353
|
-
}[] | undefined;
|
|
391
|
+
})[] | undefined;
|
|
354
392
|
readonly reasoning_content?: string | undefined;
|
|
355
393
|
readonly reasoning?: string | undefined;
|
|
356
394
|
readonly reasoning_text?: string | undefined;
|
|
357
395
|
readonly reasoning_details?: unknown;
|
|
358
396
|
})[];
|
|
359
|
-
readonly tools?: readonly {
|
|
397
|
+
readonly tools?: readonly ({
|
|
360
398
|
readonly type: "function";
|
|
361
399
|
readonly function: {
|
|
362
400
|
readonly name: string;
|
|
@@ -370,12 +408,36 @@ export declare const routes: (Route<{
|
|
|
370
408
|
readonly type: "ephemeral";
|
|
371
409
|
readonly ttl?: string | undefined;
|
|
372
410
|
} | undefined;
|
|
373
|
-
}
|
|
411
|
+
} | {
|
|
412
|
+
readonly type: "custom";
|
|
413
|
+
readonly custom: {
|
|
414
|
+
readonly name: string;
|
|
415
|
+
readonly description: string;
|
|
416
|
+
readonly format: {
|
|
417
|
+
readonly type: "text";
|
|
418
|
+
} | {
|
|
419
|
+
readonly type: "grammar";
|
|
420
|
+
readonly grammar: {
|
|
421
|
+
readonly syntax: "lark" | "regex";
|
|
422
|
+
readonly definition: string;
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
readonly cache_control?: {
|
|
427
|
+
readonly type: "ephemeral";
|
|
428
|
+
readonly ttl?: string | undefined;
|
|
429
|
+
} | undefined;
|
|
430
|
+
})[] | undefined;
|
|
374
431
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
375
432
|
readonly type: "function";
|
|
376
433
|
readonly function: {
|
|
377
434
|
readonly name: string;
|
|
378
435
|
};
|
|
436
|
+
} | {
|
|
437
|
+
readonly type: "custom";
|
|
438
|
+
readonly custom: {
|
|
439
|
+
readonly name: string;
|
|
440
|
+
};
|
|
379
441
|
} | undefined;
|
|
380
442
|
readonly stream: true;
|
|
381
443
|
readonly stream_options?: {
|
|
@@ -405,7 +467,7 @@ export declare const routes: (Route<{
|
|
|
405
467
|
readonly seed?: number | undefined;
|
|
406
468
|
readonly stop?: readonly string[] | undefined;
|
|
407
469
|
}, import("../route/transport/http.js").HttpPrepared<string>, import("../route/client.js").CompactionOperations | undefined>)[];
|
|
408
|
-
export declare const configure: (input?:
|
|
470
|
+
export declare const configure: (input?: Config) => {
|
|
409
471
|
id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
410
472
|
model: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<{
|
|
411
473
|
readonly thinking?: {
|
|
@@ -427,5 +489,5 @@ export declare const provider: {
|
|
|
427
489
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
428
490
|
configure: typeof configure;
|
|
429
491
|
};
|
|
430
|
-
export declare const model: ProviderPackage.
|
|
492
|
+
export declare const model: ProviderPackage.Model<Settings, CohereChat.ProviderOptionsInput>;
|
|
431
493
|
export * as Cohere from "./cohere.js";
|
package/dist/providers/cohere.js
CHANGED
|
@@ -36,7 +36,7 @@ export const configure = (input = {}) => {
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
export const provider = configure();
|
|
39
|
-
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions }) => configure({
|
|
39
|
+
export const model = (modelID, { apiKey, baseURL, body, headers, ...providerOptions } = {}) => configure({
|
|
40
40
|
apiKey,
|
|
41
41
|
baseURL,
|
|
42
42
|
headers,
|