@opencode/ai 0.0.0-dev-172 → 0.0.0-dev-176
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 +48 -3
- package/dist/effect.d.ts +1 -1
- package/dist/effect.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/dist/protocols/alibaba-chat.d.ts +39 -4
- package/dist/protocols/alibaba-responses.d.ts +20 -3
- package/dist/protocols/fal-images.d.ts +2 -0
- package/dist/protocols/fal-images.js +1 -0
- 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.js +8 -2
- 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 +1 -0
- package/dist/protocols/xai-images.js +2 -4
- 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/providers/alibaba.d.ts +55 -7
- package/dist/providers/amazon-bedrock-mantle.d.ts +55 -7
- package/dist/providers/azure.d.ts +75 -10
- package/dist/providers/baseten.d.ts +70 -8
- package/dist/providers/cerebras.d.ts +70 -8
- package/dist/providers/cloudflare-ai-gateway.d.ts +110 -14
- package/dist/providers/cloudflare-workers-ai.d.ts +70 -8
- package/dist/providers/cohere.d.ts +70 -8
- package/dist/providers/deepinfra.d.ts +70 -8
- package/dist/providers/deepseek.d.ts +70 -8
- package/dist/providers/digitalocean.d.ts +109 -12
- package/dist/providers/fireworks.d.ts +70 -8
- package/dist/providers/google-vertex-chat.d.ts +35 -4
- package/dist/providers/google-vertex-responses.d.ts +20 -3
- package/dist/providers/groq.d.ts +74 -8
- package/dist/providers/meta.d.ts +55 -7
- package/dist/providers/minimax/images.d.ts +3 -0
- package/dist/providers/minimax/images.js +1 -0
- package/dist/providers/minimax.d.ts +62 -8
- package/dist/providers/minimax.js +22 -9
- package/dist/providers/moonshot.d.ts +55 -7
- package/dist/providers/openai-compatible-responses.d.ts +20 -3
- package/dist/providers/openai-compatible.d.ts +35 -4
- package/dist/providers/openai-compatible.js +9 -2
- package/dist/providers/openai.d.ts +55 -7
- package/dist/providers/openrouter.d.ts +144 -16
- package/dist/providers/togetherai.d.ts +70 -8
- package/dist/providers/venice.d.ts +35 -4
- package/dist/providers/xai.d.ts +35 -4
- package/dist/providers/zai-coding-plan.d.ts +55 -7
- package/dist/providers/zai.d.ts +35 -4
- package/dist/schema/messages.d.ts +35 -1
- package/dist/schema/messages.js +20 -0
- package/dist/tool.d.ts +12 -1
- package/dist/tool.js +10 -2
- package/package.json +7 -3
|
@@ -93,7 +93,14 @@ export declare const routes: Route<{
|
|
|
93
93
|
readonly ttl?: string | undefined;
|
|
94
94
|
} | undefined;
|
|
95
95
|
}[] | null;
|
|
96
|
-
readonly tool_calls?: readonly {
|
|
96
|
+
readonly tool_calls?: readonly ({
|
|
97
|
+
readonly id: string;
|
|
98
|
+
readonly type: "custom";
|
|
99
|
+
readonly custom: {
|
|
100
|
+
readonly name: string;
|
|
101
|
+
readonly input: string;
|
|
102
|
+
};
|
|
103
|
+
} | {
|
|
97
104
|
readonly id: string;
|
|
98
105
|
readonly type: "function";
|
|
99
106
|
readonly function: {
|
|
@@ -105,13 +112,13 @@ export declare const routes: Route<{
|
|
|
105
112
|
readonly thought_signature: string;
|
|
106
113
|
};
|
|
107
114
|
} | undefined;
|
|
108
|
-
}[] | undefined;
|
|
115
|
+
})[] | undefined;
|
|
109
116
|
readonly reasoning_content?: string | undefined;
|
|
110
117
|
readonly reasoning?: string | undefined;
|
|
111
118
|
readonly reasoning_text?: string | undefined;
|
|
112
119
|
readonly reasoning_details?: unknown;
|
|
113
120
|
})[];
|
|
114
|
-
readonly tools?: readonly {
|
|
121
|
+
readonly tools?: readonly ({
|
|
115
122
|
readonly type: "function";
|
|
116
123
|
readonly function: {
|
|
117
124
|
readonly name: string;
|
|
@@ -125,12 +132,36 @@ export declare const routes: Route<{
|
|
|
125
132
|
readonly type: "ephemeral";
|
|
126
133
|
readonly ttl?: string | undefined;
|
|
127
134
|
} | undefined;
|
|
128
|
-
}
|
|
135
|
+
} | {
|
|
136
|
+
readonly type: "custom";
|
|
137
|
+
readonly custom: {
|
|
138
|
+
readonly name: string;
|
|
139
|
+
readonly description: string;
|
|
140
|
+
readonly format: {
|
|
141
|
+
readonly type: "text";
|
|
142
|
+
} | {
|
|
143
|
+
readonly type: "grammar";
|
|
144
|
+
readonly grammar: {
|
|
145
|
+
readonly syntax: "lark" | "regex";
|
|
146
|
+
readonly definition: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
readonly cache_control?: {
|
|
151
|
+
readonly type: "ephemeral";
|
|
152
|
+
readonly ttl?: string | undefined;
|
|
153
|
+
} | undefined;
|
|
154
|
+
})[] | undefined;
|
|
129
155
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
130
156
|
readonly type: "function";
|
|
131
157
|
readonly function: {
|
|
132
158
|
readonly name: string;
|
|
133
159
|
};
|
|
160
|
+
} | {
|
|
161
|
+
readonly type: "custom";
|
|
162
|
+
readonly custom: {
|
|
163
|
+
readonly name: string;
|
|
164
|
+
};
|
|
134
165
|
} | undefined;
|
|
135
166
|
readonly stream: true;
|
|
136
167
|
readonly stream_options?: {
|
|
@@ -33,7 +33,7 @@ export declare const routes: Route<{
|
|
|
33
33
|
readonly role: "developer";
|
|
34
34
|
readonly content: string;
|
|
35
35
|
} | {
|
|
36
|
-
readonly type: "function_call_output";
|
|
36
|
+
readonly type: "custom_tool_call_output" | "function_call_output";
|
|
37
37
|
readonly call_id: string;
|
|
38
38
|
readonly output: string | readonly ({
|
|
39
39
|
readonly type: "input_text";
|
|
@@ -103,6 +103,12 @@ export declare const routes: Route<{
|
|
|
103
103
|
readonly name: string;
|
|
104
104
|
readonly namespace?: string | undefined;
|
|
105
105
|
readonly arguments: string;
|
|
106
|
+
} | {
|
|
107
|
+
readonly type: "custom_tool_call";
|
|
108
|
+
readonly id?: string | undefined;
|
|
109
|
+
readonly call_id: string;
|
|
110
|
+
readonly name: string;
|
|
111
|
+
readonly input: string;
|
|
106
112
|
} | {
|
|
107
113
|
readonly [x: string]: unknown;
|
|
108
114
|
readonly type: "web_search_call";
|
|
@@ -147,6 +153,17 @@ export declare const routes: Route<{
|
|
|
147
153
|
})[];
|
|
148
154
|
readonly instructions?: string | undefined;
|
|
149
155
|
readonly tools?: readonly ({
|
|
156
|
+
readonly type: "custom";
|
|
157
|
+
readonly name: string;
|
|
158
|
+
readonly description: string;
|
|
159
|
+
readonly format: {
|
|
160
|
+
readonly type: "text";
|
|
161
|
+
} | {
|
|
162
|
+
readonly type: "grammar";
|
|
163
|
+
readonly syntax: "lark" | "regex";
|
|
164
|
+
readonly definition: string;
|
|
165
|
+
};
|
|
166
|
+
} | {
|
|
150
167
|
readonly type: "function";
|
|
151
168
|
readonly name: string;
|
|
152
169
|
readonly description: string;
|
|
@@ -159,13 +176,13 @@ export declare const routes: Route<{
|
|
|
159
176
|
readonly type: string;
|
|
160
177
|
})[] | undefined;
|
|
161
178
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
162
|
-
readonly type: "function";
|
|
179
|
+
readonly type: "custom" | "function";
|
|
163
180
|
readonly name: string;
|
|
164
181
|
} | {
|
|
165
182
|
readonly type: "allowed_tools";
|
|
166
183
|
readonly mode: "auto" | "none" | "required";
|
|
167
184
|
readonly tools: readonly {
|
|
168
|
-
readonly type: "function";
|
|
185
|
+
readonly type: "custom" | "function";
|
|
169
186
|
readonly name: string;
|
|
170
187
|
}[];
|
|
171
188
|
} | undefined;
|
package/dist/providers/groq.d.ts
CHANGED
|
@@ -97,7 +97,14 @@ export declare const protocol: Protocol<{
|
|
|
97
97
|
readonly ttl?: string | undefined;
|
|
98
98
|
} | undefined;
|
|
99
99
|
}[] | null;
|
|
100
|
-
readonly tool_calls?: readonly {
|
|
100
|
+
readonly tool_calls?: readonly ({
|
|
101
|
+
readonly id: string;
|
|
102
|
+
readonly type: "custom";
|
|
103
|
+
readonly custom: {
|
|
104
|
+
readonly name: string;
|
|
105
|
+
readonly input: string;
|
|
106
|
+
};
|
|
107
|
+
} | {
|
|
101
108
|
readonly id: string;
|
|
102
109
|
readonly type: "function";
|
|
103
110
|
readonly function: {
|
|
@@ -109,13 +116,13 @@ export declare const protocol: Protocol<{
|
|
|
109
116
|
readonly thought_signature: string;
|
|
110
117
|
};
|
|
111
118
|
} | undefined;
|
|
112
|
-
}[] | undefined;
|
|
119
|
+
})[] | undefined;
|
|
113
120
|
readonly reasoning_content?: string | undefined;
|
|
114
121
|
readonly reasoning?: string | undefined;
|
|
115
122
|
readonly reasoning_text?: string | undefined;
|
|
116
123
|
readonly reasoning_details?: unknown;
|
|
117
124
|
})[];
|
|
118
|
-
readonly tools?: readonly {
|
|
125
|
+
readonly tools?: readonly ({
|
|
119
126
|
readonly type: "function";
|
|
120
127
|
readonly function: {
|
|
121
128
|
readonly name: string;
|
|
@@ -129,12 +136,36 @@ export declare const protocol: Protocol<{
|
|
|
129
136
|
readonly type: "ephemeral";
|
|
130
137
|
readonly ttl?: string | undefined;
|
|
131
138
|
} | undefined;
|
|
132
|
-
}
|
|
139
|
+
} | {
|
|
140
|
+
readonly type: "custom";
|
|
141
|
+
readonly custom: {
|
|
142
|
+
readonly name: string;
|
|
143
|
+
readonly description: string;
|
|
144
|
+
readonly format: {
|
|
145
|
+
readonly type: "text";
|
|
146
|
+
} | {
|
|
147
|
+
readonly type: "grammar";
|
|
148
|
+
readonly grammar: {
|
|
149
|
+
readonly syntax: "lark" | "regex";
|
|
150
|
+
readonly definition: string;
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
readonly cache_control?: {
|
|
155
|
+
readonly type: "ephemeral";
|
|
156
|
+
readonly ttl?: string | undefined;
|
|
157
|
+
} | undefined;
|
|
158
|
+
})[] | undefined;
|
|
133
159
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
134
160
|
readonly type: "function";
|
|
135
161
|
readonly function: {
|
|
136
162
|
readonly name: string;
|
|
137
163
|
};
|
|
164
|
+
} | {
|
|
165
|
+
readonly type: "custom";
|
|
166
|
+
readonly custom: {
|
|
167
|
+
readonly name: string;
|
|
168
|
+
};
|
|
138
169
|
} | undefined;
|
|
139
170
|
readonly stream: true;
|
|
140
171
|
readonly stream_options?: {
|
|
@@ -185,6 +216,10 @@ export declare const protocol: Protocol<{
|
|
|
185
216
|
readonly name?: string | null | undefined;
|
|
186
217
|
readonly arguments?: string | null | undefined;
|
|
187
218
|
} | null | undefined;
|
|
219
|
+
readonly custom?: {
|
|
220
|
+
readonly name?: string | null | undefined;
|
|
221
|
+
readonly input?: string | null | undefined;
|
|
222
|
+
} | null | undefined;
|
|
188
223
|
readonly extra_content?: unknown;
|
|
189
224
|
}[] | null | undefined;
|
|
190
225
|
} | null | undefined;
|
|
@@ -315,7 +350,14 @@ export declare const route: Route<{
|
|
|
315
350
|
readonly ttl?: string | undefined;
|
|
316
351
|
} | undefined;
|
|
317
352
|
}[] | null;
|
|
318
|
-
readonly tool_calls?: readonly {
|
|
353
|
+
readonly tool_calls?: readonly ({
|
|
354
|
+
readonly id: string;
|
|
355
|
+
readonly type: "custom";
|
|
356
|
+
readonly custom: {
|
|
357
|
+
readonly name: string;
|
|
358
|
+
readonly input: string;
|
|
359
|
+
};
|
|
360
|
+
} | {
|
|
319
361
|
readonly id: string;
|
|
320
362
|
readonly type: "function";
|
|
321
363
|
readonly function: {
|
|
@@ -327,13 +369,13 @@ export declare const route: Route<{
|
|
|
327
369
|
readonly thought_signature: string;
|
|
328
370
|
};
|
|
329
371
|
} | undefined;
|
|
330
|
-
}[] | undefined;
|
|
372
|
+
})[] | undefined;
|
|
331
373
|
readonly reasoning_content?: string | undefined;
|
|
332
374
|
readonly reasoning?: string | undefined;
|
|
333
375
|
readonly reasoning_text?: string | undefined;
|
|
334
376
|
readonly reasoning_details?: unknown;
|
|
335
377
|
})[];
|
|
336
|
-
readonly tools?: readonly {
|
|
378
|
+
readonly tools?: readonly ({
|
|
337
379
|
readonly type: "function";
|
|
338
380
|
readonly function: {
|
|
339
381
|
readonly name: string;
|
|
@@ -347,12 +389,36 @@ export declare const route: Route<{
|
|
|
347
389
|
readonly type: "ephemeral";
|
|
348
390
|
readonly ttl?: string | undefined;
|
|
349
391
|
} | undefined;
|
|
350
|
-
}
|
|
392
|
+
} | {
|
|
393
|
+
readonly type: "custom";
|
|
394
|
+
readonly custom: {
|
|
395
|
+
readonly name: string;
|
|
396
|
+
readonly description: string;
|
|
397
|
+
readonly format: {
|
|
398
|
+
readonly type: "text";
|
|
399
|
+
} | {
|
|
400
|
+
readonly type: "grammar";
|
|
401
|
+
readonly grammar: {
|
|
402
|
+
readonly syntax: "lark" | "regex";
|
|
403
|
+
readonly definition: string;
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
};
|
|
407
|
+
readonly cache_control?: {
|
|
408
|
+
readonly type: "ephemeral";
|
|
409
|
+
readonly ttl?: string | undefined;
|
|
410
|
+
} | undefined;
|
|
411
|
+
})[] | undefined;
|
|
351
412
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
352
413
|
readonly type: "function";
|
|
353
414
|
readonly function: {
|
|
354
415
|
readonly name: string;
|
|
355
416
|
};
|
|
417
|
+
} | {
|
|
418
|
+
readonly type: "custom";
|
|
419
|
+
readonly custom: {
|
|
420
|
+
readonly name: string;
|
|
421
|
+
};
|
|
356
422
|
} | undefined;
|
|
357
423
|
readonly stream: true;
|
|
358
424
|
readonly stream_options?: {
|
package/dist/providers/meta.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export declare const routes: (Route<{
|
|
|
54
54
|
readonly role: "developer";
|
|
55
55
|
readonly content: string;
|
|
56
56
|
} | {
|
|
57
|
-
readonly type: "function_call_output";
|
|
57
|
+
readonly type: "custom_tool_call_output" | "function_call_output";
|
|
58
58
|
readonly call_id: string;
|
|
59
59
|
readonly output: string | readonly ({
|
|
60
60
|
readonly type: "input_text";
|
|
@@ -124,6 +124,12 @@ export declare const routes: (Route<{
|
|
|
124
124
|
readonly name: string;
|
|
125
125
|
readonly namespace?: string | undefined;
|
|
126
126
|
readonly arguments: string;
|
|
127
|
+
} | {
|
|
128
|
+
readonly type: "custom_tool_call";
|
|
129
|
+
readonly id?: string | undefined;
|
|
130
|
+
readonly call_id: string;
|
|
131
|
+
readonly name: string;
|
|
132
|
+
readonly input: string;
|
|
127
133
|
} | {
|
|
128
134
|
readonly [x: string]: unknown;
|
|
129
135
|
readonly type: "web_search_call";
|
|
@@ -168,6 +174,17 @@ export declare const routes: (Route<{
|
|
|
168
174
|
})[];
|
|
169
175
|
readonly instructions?: string | undefined;
|
|
170
176
|
readonly tools?: readonly ({
|
|
177
|
+
readonly type: "custom";
|
|
178
|
+
readonly name: string;
|
|
179
|
+
readonly description: string;
|
|
180
|
+
readonly format: {
|
|
181
|
+
readonly type: "text";
|
|
182
|
+
} | {
|
|
183
|
+
readonly type: "grammar";
|
|
184
|
+
readonly syntax: "lark" | "regex";
|
|
185
|
+
readonly definition: string;
|
|
186
|
+
};
|
|
187
|
+
} | {
|
|
171
188
|
readonly type: "function";
|
|
172
189
|
readonly name: string;
|
|
173
190
|
readonly description: string;
|
|
@@ -180,13 +197,13 @@ export declare const routes: (Route<{
|
|
|
180
197
|
readonly type: string;
|
|
181
198
|
})[] | undefined;
|
|
182
199
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
183
|
-
readonly type: "function";
|
|
200
|
+
readonly type: "custom" | "function";
|
|
184
201
|
readonly name: string;
|
|
185
202
|
} | {
|
|
186
203
|
readonly type: "allowed_tools";
|
|
187
204
|
readonly mode: "auto" | "none" | "required";
|
|
188
205
|
readonly tools: readonly {
|
|
189
|
-
readonly type: "function";
|
|
206
|
+
readonly type: "custom" | "function";
|
|
190
207
|
readonly name: string;
|
|
191
208
|
}[];
|
|
192
209
|
} | undefined;
|
|
@@ -294,7 +311,14 @@ export declare const routes: (Route<{
|
|
|
294
311
|
readonly ttl?: string | undefined;
|
|
295
312
|
} | undefined;
|
|
296
313
|
}[] | null;
|
|
297
|
-
readonly tool_calls?: readonly {
|
|
314
|
+
readonly tool_calls?: readonly ({
|
|
315
|
+
readonly id: string;
|
|
316
|
+
readonly type: "custom";
|
|
317
|
+
readonly custom: {
|
|
318
|
+
readonly name: string;
|
|
319
|
+
readonly input: string;
|
|
320
|
+
};
|
|
321
|
+
} | {
|
|
298
322
|
readonly id: string;
|
|
299
323
|
readonly type: "function";
|
|
300
324
|
readonly function: {
|
|
@@ -306,13 +330,13 @@ export declare const routes: (Route<{
|
|
|
306
330
|
readonly thought_signature: string;
|
|
307
331
|
};
|
|
308
332
|
} | undefined;
|
|
309
|
-
}[] | undefined;
|
|
333
|
+
})[] | undefined;
|
|
310
334
|
readonly reasoning_content?: string | undefined;
|
|
311
335
|
readonly reasoning?: string | undefined;
|
|
312
336
|
readonly reasoning_text?: string | undefined;
|
|
313
337
|
readonly reasoning_details?: unknown;
|
|
314
338
|
})[];
|
|
315
|
-
readonly tools?: readonly {
|
|
339
|
+
readonly tools?: readonly ({
|
|
316
340
|
readonly type: "function";
|
|
317
341
|
readonly function: {
|
|
318
342
|
readonly name: string;
|
|
@@ -326,12 +350,36 @@ export declare const routes: (Route<{
|
|
|
326
350
|
readonly type: "ephemeral";
|
|
327
351
|
readonly ttl?: string | undefined;
|
|
328
352
|
} | undefined;
|
|
329
|
-
}
|
|
353
|
+
} | {
|
|
354
|
+
readonly type: "custom";
|
|
355
|
+
readonly custom: {
|
|
356
|
+
readonly name: string;
|
|
357
|
+
readonly description: string;
|
|
358
|
+
readonly format: {
|
|
359
|
+
readonly type: "text";
|
|
360
|
+
} | {
|
|
361
|
+
readonly type: "grammar";
|
|
362
|
+
readonly grammar: {
|
|
363
|
+
readonly syntax: "lark" | "regex";
|
|
364
|
+
readonly definition: string;
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
readonly cache_control?: {
|
|
369
|
+
readonly type: "ephemeral";
|
|
370
|
+
readonly ttl?: string | undefined;
|
|
371
|
+
} | undefined;
|
|
372
|
+
})[] | undefined;
|
|
330
373
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
331
374
|
readonly type: "function";
|
|
332
375
|
readonly function: {
|
|
333
376
|
readonly name: string;
|
|
334
377
|
};
|
|
378
|
+
} | {
|
|
379
|
+
readonly type: "custom";
|
|
380
|
+
readonly custom: {
|
|
381
|
+
readonly name: string;
|
|
382
|
+
};
|
|
335
383
|
} | undefined;
|
|
336
384
|
readonly stream: true;
|
|
337
385
|
readonly stream_options?: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { imageModel as model } from "../minimax.js";
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { ProviderPackage } from "../provider-package.js";
|
|
2
2
|
import { AnthropicMessages } from "../protocols/anthropic-messages.js";
|
|
3
|
+
import { type MiniMaxImageOptions } from "../protocols/minimax-images.js";
|
|
3
4
|
import { type ProviderAuthOption } from "../route/auth-options.js";
|
|
4
5
|
import { Route, type RouteDefaultsInput } from "../route/client.js";
|
|
5
|
-
import { type ModelID } from "../schema/index.js";
|
|
6
|
+
import { type ModelID, type ProviderOptions } from "../schema/index.js";
|
|
6
7
|
export declare const id: string & import("effect/Brand").Brand<"AI.ProviderID">;
|
|
7
8
|
export type MessagesOptionsInput = {
|
|
8
9
|
/** M3 defaults to disabled; M2.x always thinks. */
|
|
@@ -33,6 +34,7 @@ export type Settings<Options = MessagesOptionsInput> = ProviderPackage.Settings
|
|
|
33
34
|
readonly apiKey?: string;
|
|
34
35
|
readonly baseURL?: string;
|
|
35
36
|
};
|
|
37
|
+
export type { MiniMaxImageOptions };
|
|
36
38
|
export declare const routes: (Route<{
|
|
37
39
|
readonly context_management?: {
|
|
38
40
|
readonly edits: readonly {
|
|
@@ -356,7 +358,7 @@ export declare const routes: (Route<{
|
|
|
356
358
|
readonly role: "developer";
|
|
357
359
|
readonly content: string;
|
|
358
360
|
} | {
|
|
359
|
-
readonly type: "function_call_output";
|
|
361
|
+
readonly type: "custom_tool_call_output" | "function_call_output";
|
|
360
362
|
readonly call_id: string;
|
|
361
363
|
readonly output: string | readonly ({
|
|
362
364
|
readonly type: "input_text";
|
|
@@ -426,6 +428,12 @@ export declare const routes: (Route<{
|
|
|
426
428
|
readonly name: string;
|
|
427
429
|
readonly namespace?: string | undefined;
|
|
428
430
|
readonly arguments: string;
|
|
431
|
+
} | {
|
|
432
|
+
readonly type: "custom_tool_call";
|
|
433
|
+
readonly id?: string | undefined;
|
|
434
|
+
readonly call_id: string;
|
|
435
|
+
readonly name: string;
|
|
436
|
+
readonly input: string;
|
|
429
437
|
} | {
|
|
430
438
|
readonly [x: string]: unknown;
|
|
431
439
|
readonly type: "web_search_call";
|
|
@@ -470,6 +478,17 @@ export declare const routes: (Route<{
|
|
|
470
478
|
})[];
|
|
471
479
|
readonly instructions?: string | undefined;
|
|
472
480
|
readonly tools?: readonly ({
|
|
481
|
+
readonly type: "custom";
|
|
482
|
+
readonly name: string;
|
|
483
|
+
readonly description: string;
|
|
484
|
+
readonly format: {
|
|
485
|
+
readonly type: "text";
|
|
486
|
+
} | {
|
|
487
|
+
readonly type: "grammar";
|
|
488
|
+
readonly syntax: "lark" | "regex";
|
|
489
|
+
readonly definition: string;
|
|
490
|
+
};
|
|
491
|
+
} | {
|
|
473
492
|
readonly type: "function";
|
|
474
493
|
readonly name: string;
|
|
475
494
|
readonly description: string;
|
|
@@ -482,13 +501,13 @@ export declare const routes: (Route<{
|
|
|
482
501
|
readonly type: string;
|
|
483
502
|
})[] | undefined;
|
|
484
503
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
485
|
-
readonly type: "function";
|
|
504
|
+
readonly type: "custom" | "function";
|
|
486
505
|
readonly name: string;
|
|
487
506
|
} | {
|
|
488
507
|
readonly type: "allowed_tools";
|
|
489
508
|
readonly mode: "auto" | "none" | "required";
|
|
490
509
|
readonly tools: readonly {
|
|
491
|
-
readonly type: "function";
|
|
510
|
+
readonly type: "custom" | "function";
|
|
492
511
|
readonly name: string;
|
|
493
512
|
}[];
|
|
494
513
|
} | undefined;
|
|
@@ -596,7 +615,14 @@ export declare const routes: (Route<{
|
|
|
596
615
|
readonly ttl?: string | undefined;
|
|
597
616
|
} | undefined;
|
|
598
617
|
}[] | null;
|
|
599
|
-
readonly tool_calls?: readonly {
|
|
618
|
+
readonly tool_calls?: readonly ({
|
|
619
|
+
readonly id: string;
|
|
620
|
+
readonly type: "custom";
|
|
621
|
+
readonly custom: {
|
|
622
|
+
readonly name: string;
|
|
623
|
+
readonly input: string;
|
|
624
|
+
};
|
|
625
|
+
} | {
|
|
600
626
|
readonly id: string;
|
|
601
627
|
readonly type: "function";
|
|
602
628
|
readonly function: {
|
|
@@ -608,13 +634,13 @@ export declare const routes: (Route<{
|
|
|
608
634
|
readonly thought_signature: string;
|
|
609
635
|
};
|
|
610
636
|
} | undefined;
|
|
611
|
-
}[] | undefined;
|
|
637
|
+
})[] | undefined;
|
|
612
638
|
readonly reasoning_content?: string | undefined;
|
|
613
639
|
readonly reasoning?: string | undefined;
|
|
614
640
|
readonly reasoning_text?: string | undefined;
|
|
615
641
|
readonly reasoning_details?: unknown;
|
|
616
642
|
})[];
|
|
617
|
-
readonly tools?: readonly {
|
|
643
|
+
readonly tools?: readonly ({
|
|
618
644
|
readonly type: "function";
|
|
619
645
|
readonly function: {
|
|
620
646
|
readonly name: string;
|
|
@@ -628,12 +654,36 @@ export declare const routes: (Route<{
|
|
|
628
654
|
readonly type: "ephemeral";
|
|
629
655
|
readonly ttl?: string | undefined;
|
|
630
656
|
} | undefined;
|
|
631
|
-
}
|
|
657
|
+
} | {
|
|
658
|
+
readonly type: "custom";
|
|
659
|
+
readonly custom: {
|
|
660
|
+
readonly name: string;
|
|
661
|
+
readonly description: string;
|
|
662
|
+
readonly format: {
|
|
663
|
+
readonly type: "text";
|
|
664
|
+
} | {
|
|
665
|
+
readonly type: "grammar";
|
|
666
|
+
readonly grammar: {
|
|
667
|
+
readonly syntax: "lark" | "regex";
|
|
668
|
+
readonly definition: string;
|
|
669
|
+
};
|
|
670
|
+
};
|
|
671
|
+
};
|
|
672
|
+
readonly cache_control?: {
|
|
673
|
+
readonly type: "ephemeral";
|
|
674
|
+
readonly ttl?: string | undefined;
|
|
675
|
+
} | undefined;
|
|
676
|
+
})[] | undefined;
|
|
632
677
|
readonly tool_choice?: "auto" | "none" | "required" | {
|
|
633
678
|
readonly type: "function";
|
|
634
679
|
readonly function: {
|
|
635
680
|
readonly name: string;
|
|
636
681
|
};
|
|
682
|
+
} | {
|
|
683
|
+
readonly type: "custom";
|
|
684
|
+
readonly custom: {
|
|
685
|
+
readonly name: string;
|
|
686
|
+
};
|
|
637
687
|
} | undefined;
|
|
638
688
|
readonly stream: true;
|
|
639
689
|
readonly stream_options?: {
|
|
@@ -673,6 +723,7 @@ export declare const configure: (input?: Config) => {
|
|
|
673
723
|
messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<MessagesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
674
724
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
675
725
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
726
|
+
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
676
727
|
configure: typeof configure;
|
|
677
728
|
};
|
|
678
729
|
export declare const provider: {
|
|
@@ -681,10 +732,13 @@ export declare const provider: {
|
|
|
681
732
|
messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<MessagesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
682
733
|
chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
683
734
|
responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
735
|
+
image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
684
736
|
configure: typeof configure;
|
|
685
737
|
};
|
|
686
738
|
export declare const model: ProviderPackage.Model<Settings<MessagesOptionsInput>, MessagesOptionsInput>;
|
|
739
|
+
export declare const imageModel: (modelID: string, settings?: Settings<MiniMaxImageOptions>) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
687
740
|
export declare const messages: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<MessagesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
688
741
|
export declare const chat: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ChatOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
689
742
|
export declare const responses: (modelID: string | ModelID) => import("../schema/options.js").LanguageModel<ResponsesOptionsInput, import("../route/client.js").CompactionOperations | undefined>;
|
|
743
|
+
export declare const image: (modelID: string | ModelID, providerOptions?: ProviderOptions) => import("../image.js").ImageModel<MiniMaxImageOptions>;
|
|
690
744
|
export * as MiniMax from "./minimax.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import { AnthropicMessages } from "../protocols/anthropic-messages.js";
|
|
3
|
+
import { MiniMaxImages } from "../protocols/minimax-images.js";
|
|
3
4
|
import { OpenAIChat } from "../protocols/openai-chat.js";
|
|
4
5
|
import { OpenResponses } from "../protocols/open-responses.js";
|
|
5
6
|
import { ProviderShared } from "../protocols/shared.js";
|
|
@@ -7,6 +8,7 @@ import { AuthOptions } from "../route/auth-options.js";
|
|
|
7
8
|
import { Route } from "../route/client.js";
|
|
8
9
|
import { Endpoint } from "../route/endpoint.js";
|
|
9
10
|
import { Framing } from "../route/framing.js";
|
|
11
|
+
import { MediaRoute } from "../route/media.js";
|
|
10
12
|
import { Protocol } from "../route/protocol.js";
|
|
11
13
|
import { ProviderID } from "../schema/index.js";
|
|
12
14
|
export const id = ProviderID.make("minimax");
|
|
@@ -62,10 +64,11 @@ const responsesRoute = Route.make({
|
|
|
62
64
|
export const routes = [messagesRoute, chatRoute, responsesRoute];
|
|
63
65
|
export const configure = (input = {}) => {
|
|
64
66
|
const { apiKey: _apiKey, auth: _auth, baseURL, ...rest } = input;
|
|
67
|
+
const auth = AuthOptions.bearer(input, "MINIMAX_API_KEY");
|
|
65
68
|
const defaults = {
|
|
66
69
|
...rest,
|
|
67
70
|
endpoint: baseURL === undefined ? undefined : { baseURL },
|
|
68
|
-
auth
|
|
71
|
+
auth,
|
|
69
72
|
};
|
|
70
73
|
const messages = (modelID) => messagesRoute.with(defaults).model({ id: modelID });
|
|
71
74
|
const chat = (modelID) => chatRoute.with(defaults).model({
|
|
@@ -73,17 +76,27 @@ export const configure = (input = {}) => {
|
|
|
73
76
|
compatibility: { supportsStrictMode: false },
|
|
74
77
|
});
|
|
75
78
|
const responses = (modelID) => responsesRoute.with(defaults).model({ id: modelID });
|
|
76
|
-
|
|
79
|
+
const media = MediaRoute.deployment(input, auth);
|
|
80
|
+
const image = (modelID, providerOptions) => MiniMaxImages.model({ ...media, id: modelID, providerOptions });
|
|
81
|
+
return { id, model: messages, messages, chat, responses, image, configure };
|
|
77
82
|
};
|
|
78
83
|
export const provider = configure();
|
|
79
|
-
export const model = (modelID,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
providerOptions,
|
|
85
|
-
}).model(modelID);
|
|
84
|
+
export const model = (modelID, settings) => configure(config(settings)).model(modelID);
|
|
85
|
+
export const imageModel = (modelID, settings) => {
|
|
86
|
+
const input = config(settings);
|
|
87
|
+
return configure(input).image(modelID, input.providerOptions);
|
|
88
|
+
};
|
|
86
89
|
export const messages = provider.messages;
|
|
87
90
|
export const chat = provider.chat;
|
|
88
91
|
export const responses = provider.responses;
|
|
92
|
+
export const image = provider.image;
|
|
93
|
+
function config({ apiKey, baseURL, body, headers, ...providerOptions } = {}) {
|
|
94
|
+
return {
|
|
95
|
+
apiKey,
|
|
96
|
+
baseURL,
|
|
97
|
+
headers,
|
|
98
|
+
http: body === undefined ? undefined : { body },
|
|
99
|
+
providerOptions,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
89
102
|
export * as MiniMax from "./minimax.js";
|