@ai-sdk/minimax 2.0.0 → 3.0.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/CHANGELOG.md +18 -2
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/minimax-provider.ts +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
# @ai-sdk/minimax
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 3.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [dc0c28e]
|
|
8
|
+
- Updated dependencies [fa95504]
|
|
9
|
+
- @ai-sdk/anthropic@4.0.26
|
|
10
|
+
- @ai-sdk/provider-utils@5.0.17
|
|
11
|
+
|
|
12
|
+
## 3.0.0
|
|
4
13
|
|
|
5
14
|
### Major Changes
|
|
6
15
|
|
|
7
|
-
-
|
|
16
|
+
- 5b5335f: Add MiniMax provider with language model support for the MiniMax-M model series.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [d8210b6]
|
|
21
|
+
- Updated dependencies [b192878]
|
|
22
|
+
- @ai-sdk/provider-utils@5.0.16
|
|
23
|
+
- @ai-sdk/anthropic@4.0.25
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ProviderV4, LanguageModelV4 } from '@ai-sdk/provider';
|
|
2
2
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
3
|
import { z } from 'zod/v4';
|
|
4
4
|
|
|
@@ -34,19 +34,19 @@ interface MiniMaxProviderSettings {
|
|
|
34
34
|
*/
|
|
35
35
|
fetch?: FetchFunction;
|
|
36
36
|
}
|
|
37
|
-
interface MiniMaxProvider extends
|
|
37
|
+
interface MiniMaxProvider extends ProviderV4 {
|
|
38
38
|
/**
|
|
39
39
|
* Creates a MiniMax model for text generation.
|
|
40
40
|
*/
|
|
41
|
-
(modelId: MiniMaxChatModelId):
|
|
41
|
+
(modelId: MiniMaxChatModelId): LanguageModelV4;
|
|
42
42
|
/**
|
|
43
43
|
* Creates a MiniMax language model for text generation.
|
|
44
44
|
*/
|
|
45
|
-
languageModel(modelId: MiniMaxChatModelId):
|
|
45
|
+
languageModel(modelId: MiniMaxChatModelId): LanguageModelV4;
|
|
46
46
|
/**
|
|
47
47
|
* Creates a MiniMax chat model for text generation.
|
|
48
48
|
*/
|
|
49
|
-
chat(modelId: MiniMaxChatModelId):
|
|
49
|
+
chat(modelId: MiniMaxChatModelId): LanguageModelV4;
|
|
50
50
|
/**
|
|
51
51
|
* @deprecated Use `embeddingModel` instead.
|
|
52
52
|
*/
|
package/dist/index.js
CHANGED
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
withoutTrailingSlash,
|
|
9
9
|
withUserAgentSuffix
|
|
10
10
|
} from "@ai-sdk/provider-utils";
|
|
11
|
-
import {
|
|
11
|
+
import { AnthropicLanguageModel } from "@ai-sdk/anthropic/internal";
|
|
12
12
|
|
|
13
13
|
// src/version.ts
|
|
14
|
-
var VERSION = true ? "
|
|
14
|
+
var VERSION = true ? "3.0.1" : "0.0.0-test";
|
|
15
15
|
|
|
16
16
|
// src/minimax-provider.ts
|
|
17
17
|
var defaultBaseURL = "https://api.minimax.io/anthropic/v1";
|
|
@@ -30,7 +30,7 @@ function createMiniMax(options = {}) {
|
|
|
30
30
|
},
|
|
31
31
|
`ai-sdk/minimax/${VERSION}`
|
|
32
32
|
);
|
|
33
|
-
const createChatModel = (modelId) => new
|
|
33
|
+
const createChatModel = (modelId) => new AnthropicLanguageModel(modelId, {
|
|
34
34
|
provider: "minimax.messages",
|
|
35
35
|
baseURL,
|
|
36
36
|
headers: getHeaders,
|
|
@@ -39,7 +39,7 @@ function createMiniMax(options = {}) {
|
|
|
39
39
|
supportedUrls: () => ({})
|
|
40
40
|
});
|
|
41
41
|
const provider = (modelId) => createChatModel(modelId);
|
|
42
|
-
provider.specificationVersion = "
|
|
42
|
+
provider.specificationVersion = "v4";
|
|
43
43
|
provider.languageModel = createChatModel;
|
|
44
44
|
provider.chat = createChatModel;
|
|
45
45
|
provider.embeddingModel = (modelId) => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/minimax-provider.ts","../src/version.ts"],"sourcesContent":["import {\n NoSuchModelError,\n type
|
|
1
|
+
{"version":3,"sources":["../src/minimax-provider.ts","../src/version.ts"],"sourcesContent":["import {\n NoSuchModelError,\n type LanguageModelV4,\n type ProviderV4,\n} from '@ai-sdk/provider';\nimport {\n generateId,\n loadApiKey,\n withoutTrailingSlash,\n withUserAgentSuffix,\n type FetchFunction,\n} from '@ai-sdk/provider-utils';\nimport { AnthropicLanguageModel } from '@ai-sdk/anthropic/internal';\nimport type { MiniMaxChatModelId } from './minimax-chat-options';\nimport { VERSION } from './version';\n\nexport interface MiniMaxProviderSettings {\n /**\n * MiniMax API key. Default value is taken from the `MINIMAX_API_KEY`\n * environment variable.\n */\n apiKey?: string;\n /**\n * Base URL for the API calls. Defaults to MiniMax's Anthropic-compatible\n * endpoint (`https://api.minimax.io/anthropic/v1`).\n */\n baseURL?: string;\n /**\n * Custom headers to include in the requests.\n */\n headers?: Record<string, string>;\n /**\n * Custom fetch implementation. You can use it as a middleware to intercept requests,\n * or to provide a custom fetch implementation for e.g. testing.\n */\n fetch?: FetchFunction;\n}\n\nexport interface MiniMaxProvider extends ProviderV4 {\n /**\n * Creates a MiniMax model for text generation.\n */\n (modelId: MiniMaxChatModelId): LanguageModelV4;\n\n /**\n * Creates a MiniMax language model for text generation.\n */\n languageModel(modelId: MiniMaxChatModelId): LanguageModelV4;\n\n /**\n * Creates a MiniMax chat model for text generation.\n */\n chat(modelId: MiniMaxChatModelId): LanguageModelV4;\n\n /**\n * @deprecated Use `embeddingModel` instead.\n */\n textEmbeddingModel(modelId: string): never;\n}\n\nconst defaultBaseURL = 'https://api.minimax.io/anthropic/v1';\n\nexport function createMiniMax(\n options: MiniMaxProviderSettings = {},\n): MiniMaxProvider {\n const baseURL =\n withoutTrailingSlash(options.baseURL ?? defaultBaseURL) ?? defaultBaseURL;\n\n const getHeaders = () =>\n withUserAgentSuffix(\n {\n 'anthropic-version': '2023-06-01',\n 'x-api-key': loadApiKey({\n apiKey: options.apiKey,\n environmentVariableName: 'MINIMAX_API_KEY',\n description: 'MiniMax API key',\n }),\n ...options.headers,\n },\n `ai-sdk/minimax/${VERSION}`,\n );\n\n const createChatModel = (modelId: MiniMaxChatModelId) =>\n new AnthropicLanguageModel(modelId, {\n provider: 'minimax.messages',\n baseURL,\n headers: getHeaders,\n fetch: options.fetch,\n generateId,\n supportedUrls: () => ({}),\n });\n\n const provider = (modelId: MiniMaxChatModelId) => createChatModel(modelId);\n\n provider.specificationVersion = 'v4' as const;\n provider.languageModel = createChatModel;\n provider.chat = createChatModel;\n\n provider.embeddingModel = (modelId: string) => {\n throw new NoSuchModelError({ modelId, modelType: 'embeddingModel' });\n };\n provider.textEmbeddingModel = provider.embeddingModel;\n provider.imageModel = (modelId: string) => {\n throw new NoSuchModelError({ modelId, modelType: 'imageModel' });\n };\n\n return provider;\n}\n\nexport const minimax = createMiniMax();\n","// Version string of this package injected at build time.\ndeclare const __PACKAGE_VERSION__: string | undefined;\nexport const VERSION: string =\n typeof __PACKAGE_VERSION__ !== 'undefined'\n ? __PACKAGE_VERSION__\n : '0.0.0-test';\n"],"mappings":";AAAA;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,8BAA8B;;;ACVhC,IAAM,UACX,OACI,UACA;;;ADuDN,IAAM,iBAAiB;AAEhB,SAAS,cACd,UAAmC,CAAC,GACnB;AAhEnB;AAiEE,QAAM,WACJ,2BAAqB,aAAQ,YAAR,YAAmB,cAAc,MAAtD,YAA2D;AAE7D,QAAM,aAAa,MACjB;AAAA,IACE;AAAA,MACE,qBAAqB;AAAA,MACrB,aAAa,WAAW;AAAA,QACtB,QAAQ,QAAQ;AAAA,QAChB,yBAAyB;AAAA,QACzB,aAAa;AAAA,MACf,CAAC;AAAA,MACD,GAAG,QAAQ;AAAA,IACb;AAAA,IACA,kBAAkB,OAAO;AAAA,EAC3B;AAEF,QAAM,kBAAkB,CAAC,YACvB,IAAI,uBAAuB,SAAS;AAAA,IAClC,UAAU;AAAA,IACV;AAAA,IACA,SAAS;AAAA,IACT,OAAO,QAAQ;AAAA,IACf;AAAA,IACA,eAAe,OAAO,CAAC;AAAA,EACzB,CAAC;AAEH,QAAM,WAAW,CAAC,YAAgC,gBAAgB,OAAO;AAEzE,WAAS,uBAAuB;AAChC,WAAS,gBAAgB;AACzB,WAAS,OAAO;AAEhB,WAAS,iBAAiB,CAAC,YAAoB;AAC7C,UAAM,IAAI,iBAAiB,EAAE,SAAS,WAAW,iBAAiB,CAAC;AAAA,EACrE;AACA,WAAS,qBAAqB,SAAS;AACvC,WAAS,aAAa,CAAC,YAAoB;AACzC,UAAM,IAAI,iBAAiB,EAAE,SAAS,WAAW,aAAa,CAAC;AAAA,EACjE;AAEA,SAAO;AACT;AAEO,IAAM,UAAU,cAAc;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/minimax",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@ai-sdk/
|
|
29
|
-
"@ai-sdk/provider-utils": "
|
|
30
|
-
"@ai-sdk/
|
|
28
|
+
"@ai-sdk/anthropic": "4.0.26",
|
|
29
|
+
"@ai-sdk/provider-utils": "5.0.17",
|
|
30
|
+
"@ai-sdk/provider": "4.0.4"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "22.19.19",
|
|
34
34
|
"tsup": "^8.5.1",
|
|
35
35
|
"typescript": "5.8.3",
|
|
36
36
|
"zod": "3.25.76",
|
|
37
|
-
"@ai-sdk/test-server": "
|
|
37
|
+
"@ai-sdk/test-server": "2.0.1",
|
|
38
38
|
"@vercel/ai-tsconfig": "0.0.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
package/src/minimax-provider.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NoSuchModelError,
|
|
3
|
-
type
|
|
4
|
-
type
|
|
3
|
+
type LanguageModelV4,
|
|
4
|
+
type ProviderV4,
|
|
5
5
|
} from '@ai-sdk/provider';
|
|
6
6
|
import {
|
|
7
7
|
generateId,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
withUserAgentSuffix,
|
|
11
11
|
type FetchFunction,
|
|
12
12
|
} from '@ai-sdk/provider-utils';
|
|
13
|
-
import {
|
|
13
|
+
import { AnthropicLanguageModel } from '@ai-sdk/anthropic/internal';
|
|
14
14
|
import type { MiniMaxChatModelId } from './minimax-chat-options';
|
|
15
15
|
import { VERSION } from './version';
|
|
16
16
|
|
|
@@ -36,21 +36,21 @@ export interface MiniMaxProviderSettings {
|
|
|
36
36
|
fetch?: FetchFunction;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
export interface MiniMaxProvider extends
|
|
39
|
+
export interface MiniMaxProvider extends ProviderV4 {
|
|
40
40
|
/**
|
|
41
41
|
* Creates a MiniMax model for text generation.
|
|
42
42
|
*/
|
|
43
|
-
(modelId: MiniMaxChatModelId):
|
|
43
|
+
(modelId: MiniMaxChatModelId): LanguageModelV4;
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Creates a MiniMax language model for text generation.
|
|
47
47
|
*/
|
|
48
|
-
languageModel(modelId: MiniMaxChatModelId):
|
|
48
|
+
languageModel(modelId: MiniMaxChatModelId): LanguageModelV4;
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Creates a MiniMax chat model for text generation.
|
|
52
52
|
*/
|
|
53
|
-
chat(modelId: MiniMaxChatModelId):
|
|
53
|
+
chat(modelId: MiniMaxChatModelId): LanguageModelV4;
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* @deprecated Use `embeddingModel` instead.
|
|
@@ -81,7 +81,7 @@ export function createMiniMax(
|
|
|
81
81
|
);
|
|
82
82
|
|
|
83
83
|
const createChatModel = (modelId: MiniMaxChatModelId) =>
|
|
84
|
-
new
|
|
84
|
+
new AnthropicLanguageModel(modelId, {
|
|
85
85
|
provider: 'minimax.messages',
|
|
86
86
|
baseURL,
|
|
87
87
|
headers: getHeaders,
|
|
@@ -92,7 +92,7 @@ export function createMiniMax(
|
|
|
92
92
|
|
|
93
93
|
const provider = (modelId: MiniMaxChatModelId) => createChatModel(modelId);
|
|
94
94
|
|
|
95
|
-
provider.specificationVersion = '
|
|
95
|
+
provider.specificationVersion = 'v4' as const;
|
|
96
96
|
provider.languageModel = createChatModel;
|
|
97
97
|
provider.chat = createChatModel;
|
|
98
98
|
|