@ottocode/sdk 0.1.202 → 0.1.204
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/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/providers/src/catalog-manual.ts +12 -0
- package/src/providers/src/catalog.ts +155 -0
- package/src/providers/src/env.ts +1 -0
- package/src/providers/src/index.ts +2 -0
- package/src/providers/src/minimax-client.ts +24 -0
- package/src/providers/src/utils.ts +6 -0
- package/src/types/src/provider.ts +3 -1
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -108,6 +108,8 @@ export { createOpencodeModel } from './providers/src/index.ts';
|
|
|
108
108
|
export type { OpencodeProviderConfig } from './providers/src/index.ts';
|
|
109
109
|
export { createMoonshotModel } from './providers/src/index.ts';
|
|
110
110
|
export type { MoonshotProviderConfig } from './providers/src/index.ts';
|
|
111
|
+
export { createMinimaxModel } from './providers/src/index.ts';
|
|
112
|
+
export type { MinimaxProviderConfig } from './providers/src/index.ts';
|
|
111
113
|
export {
|
|
112
114
|
createCopilotFetch,
|
|
113
115
|
createCopilotModel,
|
|
@@ -36,6 +36,12 @@ const isAllowedZaiModel = (id: string): boolean => {
|
|
|
36
36
|
return false;
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
+
const isAllowedMinimaxModel = (id: string): boolean => {
|
|
40
|
+
if (id === 'MiniMax-M2.5') return true;
|
|
41
|
+
if (id === 'MiniMax-M2.1') return true;
|
|
42
|
+
return false;
|
|
43
|
+
};
|
|
44
|
+
|
|
39
45
|
const SETU_SOURCES: Array<{
|
|
40
46
|
id: ProviderId;
|
|
41
47
|
npm: string;
|
|
@@ -66,6 +72,11 @@ const SETU_SOURCES: Array<{
|
|
|
66
72
|
npm: '@ai-sdk/openai-compatible',
|
|
67
73
|
family: 'openai-compatible',
|
|
68
74
|
},
|
|
75
|
+
{
|
|
76
|
+
id: 'minimax',
|
|
77
|
+
npm: '@ai-sdk/anthropic',
|
|
78
|
+
family: 'minimax',
|
|
79
|
+
},
|
|
69
80
|
];
|
|
70
81
|
|
|
71
82
|
function cloneModel(model: ModelInfo): ModelInfo {
|
|
@@ -95,6 +106,7 @@ function buildSetuEntry(base: CatalogMap): ProviderCatalogEntry | null {
|
|
|
95
106
|
if (id === 'anthropic') return isAllowedAnthropicModel(model.id);
|
|
96
107
|
if (id === 'google') return isAllowedGoogleModel(model.id);
|
|
97
108
|
if (id === 'zai') return isAllowedZaiModel(model.id);
|
|
109
|
+
if (id === 'minimax') return isAllowedMinimaxModel(model.id);
|
|
98
110
|
return true;
|
|
99
111
|
});
|
|
100
112
|
return sourceModels.map((model) => {
|
|
@@ -3924,6 +3924,30 @@ export const catalog: Partial<Record<ProviderId, ProviderCatalogEntry>> = {
|
|
|
3924
3924
|
output: 131072,
|
|
3925
3925
|
},
|
|
3926
3926
|
},
|
|
3927
|
+
{
|
|
3928
|
+
id: 'minimax/minimax-m2.5',
|
|
3929
|
+
label: 'MiniMax M2.5',
|
|
3930
|
+
modalities: {
|
|
3931
|
+
input: ['text'],
|
|
3932
|
+
output: ['text'],
|
|
3933
|
+
},
|
|
3934
|
+
toolCall: true,
|
|
3935
|
+
reasoningText: true,
|
|
3936
|
+
attachment: false,
|
|
3937
|
+
temperature: true,
|
|
3938
|
+
releaseDate: '2026-02-12',
|
|
3939
|
+
lastUpdated: '2026-02-12',
|
|
3940
|
+
openWeights: true,
|
|
3941
|
+
cost: {
|
|
3942
|
+
input: 0.3,
|
|
3943
|
+
output: 1.2,
|
|
3944
|
+
cacheRead: 0.03,
|
|
3945
|
+
},
|
|
3946
|
+
limit: {
|
|
3947
|
+
context: 204800,
|
|
3948
|
+
output: 131072,
|
|
3949
|
+
},
|
|
3950
|
+
},
|
|
3927
3951
|
{
|
|
3928
3952
|
id: 'mistralai/codestral-2508',
|
|
3929
3953
|
label: 'Codestral 2508',
|
|
@@ -6986,6 +7010,31 @@ export const catalog: Partial<Record<ProviderId, ProviderCatalogEntry>> = {
|
|
|
6986
7010
|
output: 131072,
|
|
6987
7011
|
},
|
|
6988
7012
|
},
|
|
7013
|
+
{
|
|
7014
|
+
id: 'glm-5',
|
|
7015
|
+
label: 'GLM-5',
|
|
7016
|
+
modalities: {
|
|
7017
|
+
input: ['text'],
|
|
7018
|
+
output: ['text'],
|
|
7019
|
+
},
|
|
7020
|
+
toolCall: true,
|
|
7021
|
+
reasoningText: true,
|
|
7022
|
+
attachment: false,
|
|
7023
|
+
temperature: true,
|
|
7024
|
+
knowledge: '2025-04',
|
|
7025
|
+
releaseDate: '2026-02-11',
|
|
7026
|
+
lastUpdated: '2026-02-11',
|
|
7027
|
+
openWeights: true,
|
|
7028
|
+
cost: {
|
|
7029
|
+
input: 1,
|
|
7030
|
+
output: 3.2,
|
|
7031
|
+
cacheRead: 0.2,
|
|
7032
|
+
},
|
|
7033
|
+
limit: {
|
|
7034
|
+
context: 204800,
|
|
7035
|
+
output: 131072,
|
|
7036
|
+
},
|
|
7037
|
+
},
|
|
6989
7038
|
{
|
|
6990
7039
|
id: 'gpt-5',
|
|
6991
7040
|
label: 'GPT-5',
|
|
@@ -7416,6 +7465,31 @@ export const catalog: Partial<Record<ProviderId, ProviderCatalogEntry>> = {
|
|
|
7416
7465
|
npm: '@ai-sdk/anthropic',
|
|
7417
7466
|
},
|
|
7418
7467
|
},
|
|
7468
|
+
{
|
|
7469
|
+
id: 'minimax-m2.5',
|
|
7470
|
+
label: 'MiniMax M2.5',
|
|
7471
|
+
modalities: {
|
|
7472
|
+
input: ['text'],
|
|
7473
|
+
output: ['text'],
|
|
7474
|
+
},
|
|
7475
|
+
toolCall: true,
|
|
7476
|
+
reasoningText: true,
|
|
7477
|
+
attachment: false,
|
|
7478
|
+
temperature: true,
|
|
7479
|
+
knowledge: '2025-01',
|
|
7480
|
+
releaseDate: '2026-02-12',
|
|
7481
|
+
lastUpdated: '2026-02-12',
|
|
7482
|
+
openWeights: true,
|
|
7483
|
+
cost: {
|
|
7484
|
+
input: 0.3,
|
|
7485
|
+
output: 1.2,
|
|
7486
|
+
cacheRead: 0.06,
|
|
7487
|
+
},
|
|
7488
|
+
limit: {
|
|
7489
|
+
context: 204800,
|
|
7490
|
+
output: 131072,
|
|
7491
|
+
},
|
|
7492
|
+
},
|
|
7419
7493
|
{
|
|
7420
7494
|
id: 'minimax-m2.5-free',
|
|
7421
7495
|
label: 'MiniMax M2.5 Free',
|
|
@@ -8134,6 +8208,87 @@ export const catalog: Partial<Record<ProviderId, ProviderCatalogEntry>> = {
|
|
|
8134
8208
|
api: 'https://api.moonshot.ai/v1',
|
|
8135
8209
|
doc: 'https://platform.moonshot.ai/docs/api/chat',
|
|
8136
8210
|
},
|
|
8211
|
+
minimax: {
|
|
8212
|
+
id: 'minimax',
|
|
8213
|
+
models: [
|
|
8214
|
+
{
|
|
8215
|
+
id: 'MiniMax-M2',
|
|
8216
|
+
label: 'MiniMax-M2',
|
|
8217
|
+
modalities: {
|
|
8218
|
+
input: ['text'],
|
|
8219
|
+
output: ['text'],
|
|
8220
|
+
},
|
|
8221
|
+
toolCall: true,
|
|
8222
|
+
reasoningText: true,
|
|
8223
|
+
attachment: false,
|
|
8224
|
+
temperature: true,
|
|
8225
|
+
releaseDate: '2025-10-27',
|
|
8226
|
+
lastUpdated: '2025-10-27',
|
|
8227
|
+
openWeights: true,
|
|
8228
|
+
cost: {
|
|
8229
|
+
input: 0.3,
|
|
8230
|
+
output: 1.2,
|
|
8231
|
+
},
|
|
8232
|
+
limit: {
|
|
8233
|
+
context: 196608,
|
|
8234
|
+
output: 128000,
|
|
8235
|
+
},
|
|
8236
|
+
},
|
|
8237
|
+
{
|
|
8238
|
+
id: 'MiniMax-M2.1',
|
|
8239
|
+
label: 'MiniMax-M2.1',
|
|
8240
|
+
modalities: {
|
|
8241
|
+
input: ['text'],
|
|
8242
|
+
output: ['text'],
|
|
8243
|
+
},
|
|
8244
|
+
toolCall: true,
|
|
8245
|
+
reasoningText: true,
|
|
8246
|
+
attachment: false,
|
|
8247
|
+
temperature: true,
|
|
8248
|
+
releaseDate: '2025-12-23',
|
|
8249
|
+
lastUpdated: '2025-12-23',
|
|
8250
|
+
openWeights: true,
|
|
8251
|
+
cost: {
|
|
8252
|
+
input: 0.3,
|
|
8253
|
+
output: 1.2,
|
|
8254
|
+
},
|
|
8255
|
+
limit: {
|
|
8256
|
+
context: 204800,
|
|
8257
|
+
output: 131072,
|
|
8258
|
+
},
|
|
8259
|
+
},
|
|
8260
|
+
{
|
|
8261
|
+
id: 'MiniMax-M2.5',
|
|
8262
|
+
label: 'MiniMax-M2.5',
|
|
8263
|
+
modalities: {
|
|
8264
|
+
input: ['text'],
|
|
8265
|
+
output: ['text'],
|
|
8266
|
+
},
|
|
8267
|
+
toolCall: true,
|
|
8268
|
+
reasoningText: true,
|
|
8269
|
+
attachment: false,
|
|
8270
|
+
temperature: true,
|
|
8271
|
+
releaseDate: '2026-02-12',
|
|
8272
|
+
lastUpdated: '2026-02-12',
|
|
8273
|
+
openWeights: true,
|
|
8274
|
+
cost: {
|
|
8275
|
+
input: 0.3,
|
|
8276
|
+
output: 1.2,
|
|
8277
|
+
cacheRead: 0.03,
|
|
8278
|
+
cacheWrite: 0.375,
|
|
8279
|
+
},
|
|
8280
|
+
limit: {
|
|
8281
|
+
context: 204800,
|
|
8282
|
+
output: 131072,
|
|
8283
|
+
},
|
|
8284
|
+
},
|
|
8285
|
+
],
|
|
8286
|
+
label: 'MiniMax (minimax.io)',
|
|
8287
|
+
env: ['MINIMAX_API_KEY'],
|
|
8288
|
+
npm: '@ai-sdk/anthropic',
|
|
8289
|
+
api: 'https://api.minimax.io/anthropic/v1',
|
|
8290
|
+
doc: 'https://platform.minimax.io/docs/guides/quickstart',
|
|
8291
|
+
},
|
|
8137
8292
|
copilot: {
|
|
8138
8293
|
id: 'copilot',
|
|
8139
8294
|
models: [
|
package/src/providers/src/env.ts
CHANGED
|
@@ -72,5 +72,7 @@ export { createOpencodeModel } from './opencode-client.ts';
|
|
|
72
72
|
export type { OpencodeProviderConfig } from './opencode-client.ts';
|
|
73
73
|
export { createMoonshotModel } from './moonshot-client.ts';
|
|
74
74
|
export type { MoonshotProviderConfig } from './moonshot-client.ts';
|
|
75
|
+
export { createMinimaxModel } from './minimax-client.ts';
|
|
76
|
+
export type { MinimaxProviderConfig } from './minimax-client.ts';
|
|
75
77
|
export { createCopilotFetch, createCopilotModel } from './copilot-client.ts';
|
|
76
78
|
export type { CopilotOAuthConfig } from './copilot-client.ts';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createAnthropic } from '@ai-sdk/anthropic';
|
|
2
|
+
import { catalog } from './catalog-merged.ts';
|
|
3
|
+
|
|
4
|
+
export type MinimaxProviderConfig = {
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
baseURL?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export function createMinimaxModel(
|
|
10
|
+
model: string,
|
|
11
|
+
config?: MinimaxProviderConfig,
|
|
12
|
+
) {
|
|
13
|
+
const entry = catalog.minimax;
|
|
14
|
+
const baseURL =
|
|
15
|
+
config?.baseURL || entry?.api || 'https://api.minimax.io/anthropic/v1';
|
|
16
|
+
const apiKey = config?.apiKey || process.env.MINIMAX_API_KEY || '';
|
|
17
|
+
|
|
18
|
+
const instance = createAnthropic({
|
|
19
|
+
apiKey,
|
|
20
|
+
baseURL,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return instance(model);
|
|
24
|
+
}
|
|
@@ -124,6 +124,7 @@ export type UnderlyingProviderKey =
|
|
|
124
124
|
| 'openai'
|
|
125
125
|
| 'google'
|
|
126
126
|
| 'moonshot'
|
|
127
|
+
| 'minimax'
|
|
127
128
|
| 'glm'
|
|
128
129
|
| 'openai-compatible'
|
|
129
130
|
| null;
|
|
@@ -136,6 +137,7 @@ export function getUnderlyingProviderKey(
|
|
|
136
137
|
if (provider === 'openai') return 'openai';
|
|
137
138
|
if (provider === 'google') return 'google';
|
|
138
139
|
if (provider === 'moonshot') return 'moonshot';
|
|
140
|
+
if (provider === 'minimax') return 'minimax';
|
|
139
141
|
if (provider === 'copilot') return 'openai';
|
|
140
142
|
|
|
141
143
|
if (provider === 'zai' || provider === 'zai-coding') return 'glm';
|
|
@@ -158,6 +160,7 @@ export function getModelFamily(
|
|
|
158
160
|
if (provider === 'openai') return 'openai';
|
|
159
161
|
if (provider === 'google') return 'google';
|
|
160
162
|
if (provider === 'moonshot') return 'moonshot';
|
|
163
|
+
if (provider === 'minimax') return 'minimax';
|
|
161
164
|
if (provider === 'copilot') return 'openai';
|
|
162
165
|
if (provider === 'zai' || provider === 'zai-coding') return 'glm';
|
|
163
166
|
|
|
@@ -191,6 +194,9 @@ export function getModelFamily(
|
|
|
191
194
|
) {
|
|
192
195
|
return 'glm';
|
|
193
196
|
}
|
|
197
|
+
if (lowerModel.includes('minimax')) {
|
|
198
|
+
return 'minimax';
|
|
199
|
+
}
|
|
194
200
|
}
|
|
195
201
|
|
|
196
202
|
// 2) Check model's family field in catalog
|
|
@@ -11,7 +11,8 @@ export type ProviderId =
|
|
|
11
11
|
| 'setu'
|
|
12
12
|
| 'zai'
|
|
13
13
|
| 'zai-coding'
|
|
14
|
-
| 'moonshot'
|
|
14
|
+
| 'moonshot'
|
|
15
|
+
| 'minimax';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Provider family for prompt selection
|
|
@@ -21,6 +22,7 @@ export type ProviderFamily =
|
|
|
21
22
|
| 'anthropic'
|
|
22
23
|
| 'google'
|
|
23
24
|
| 'moonshot'
|
|
25
|
+
| 'minimax'
|
|
24
26
|
| 'openai-compatible';
|
|
25
27
|
|
|
26
28
|
export type ModelProviderBinding = {
|