@ai-sdk/alibaba 2.0.0-beta.2 → 2.0.0-beta.21
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 +158 -0
- package/README.md +2 -0
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +55 -25
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +55 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -6
- package/src/alibaba-chat-language-model.ts +73 -27
- package/src/alibaba-provider.ts +10 -10
- package/src/alibaba-video-model.ts +7 -7
- package/src/convert-alibaba-usage.ts +2 -2
- package/src/convert-to-alibaba-chat-messages.ts +21 -30
- package/src/get-cache-control.ts +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,163 @@
|
|
|
1
1
|
# @ai-sdk/alibaba
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [34bd95d]
|
|
8
|
+
- Updated dependencies [008271d]
|
|
9
|
+
- @ai-sdk/provider@4.0.0-beta.8
|
|
10
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.19
|
|
11
|
+
- @ai-sdk/provider-utils@5.0.0-beta.14
|
|
12
|
+
|
|
13
|
+
## 2.0.0-beta.20
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [b0c2869]
|
|
18
|
+
- Updated dependencies [7e26e81]
|
|
19
|
+
- @ai-sdk/provider-utils@5.0.0-beta.13
|
|
20
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.18
|
|
21
|
+
|
|
22
|
+
## 2.0.0-beta.19
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [816ff67]
|
|
27
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.17
|
|
28
|
+
|
|
29
|
+
## 2.0.0-beta.18
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies [46d1149]
|
|
34
|
+
- @ai-sdk/provider-utils@5.0.0-beta.12
|
|
35
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.16
|
|
36
|
+
|
|
37
|
+
## 2.0.0-beta.17
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies [6fd51c0]
|
|
42
|
+
- @ai-sdk/provider-utils@5.0.0-beta.11
|
|
43
|
+
- @ai-sdk/provider@4.0.0-beta.7
|
|
44
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.15
|
|
45
|
+
|
|
46
|
+
## 2.0.0-beta.16
|
|
47
|
+
|
|
48
|
+
### Patch Changes
|
|
49
|
+
|
|
50
|
+
- c29a26f: feat(provider): add support for provider references and uploading files as supported per provider
|
|
51
|
+
- Updated dependencies [c29a26f]
|
|
52
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.14
|
|
53
|
+
- @ai-sdk/provider-utils@5.0.0-beta.10
|
|
54
|
+
- @ai-sdk/provider@4.0.0-beta.6
|
|
55
|
+
|
|
56
|
+
## 2.0.0-beta.15
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- 38fc777: Add AI Gateway hint to provider READMEs
|
|
61
|
+
- Updated dependencies [38fc777]
|
|
62
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.13
|
|
63
|
+
|
|
64
|
+
## 2.0.0-beta.14
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- Updated dependencies [2e17091]
|
|
69
|
+
- @ai-sdk/provider-utils@5.0.0-beta.9
|
|
70
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.12
|
|
71
|
+
|
|
72
|
+
## 2.0.0-beta.13
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- Updated dependencies [986c6fd]
|
|
77
|
+
- Updated dependencies [493295c]
|
|
78
|
+
- @ai-sdk/provider-utils@5.0.0-beta.8
|
|
79
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.11
|
|
80
|
+
|
|
81
|
+
## 2.0.0-beta.12
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- Updated dependencies [1f509d4]
|
|
86
|
+
- @ai-sdk/provider-utils@5.0.0-beta.7
|
|
87
|
+
- @ai-sdk/provider@4.0.0-beta.5
|
|
88
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.10
|
|
89
|
+
|
|
90
|
+
## 2.0.0-beta.11
|
|
91
|
+
|
|
92
|
+
### Patch Changes
|
|
93
|
+
|
|
94
|
+
- 74d520f: feat: migrate providers to support new top-level `reasoning` parameter
|
|
95
|
+
- Updated dependencies [74d520f]
|
|
96
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.9
|
|
97
|
+
|
|
98
|
+
## 2.0.0-beta.10
|
|
99
|
+
|
|
100
|
+
### Patch Changes
|
|
101
|
+
|
|
102
|
+
- Updated dependencies [3887c70]
|
|
103
|
+
- @ai-sdk/provider-utils@5.0.0-beta.6
|
|
104
|
+
- @ai-sdk/provider@4.0.0-beta.4
|
|
105
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.8
|
|
106
|
+
|
|
107
|
+
## 2.0.0-beta.9
|
|
108
|
+
|
|
109
|
+
### Patch Changes
|
|
110
|
+
|
|
111
|
+
- Updated dependencies [776b617]
|
|
112
|
+
- @ai-sdk/provider-utils@5.0.0-beta.5
|
|
113
|
+
- @ai-sdk/provider@4.0.0-beta.3
|
|
114
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.7
|
|
115
|
+
|
|
116
|
+
## 2.0.0-beta.8
|
|
117
|
+
|
|
118
|
+
### Patch Changes
|
|
119
|
+
|
|
120
|
+
- Updated dependencies [61753c3]
|
|
121
|
+
- @ai-sdk/provider-utils@5.0.0-beta.4
|
|
122
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.6
|
|
123
|
+
|
|
124
|
+
## 2.0.0-beta.7
|
|
125
|
+
|
|
126
|
+
### Patch Changes
|
|
127
|
+
|
|
128
|
+
- 811cd8e: fix(provider/alibaba): handle single-item content array cache control
|
|
129
|
+
|
|
130
|
+
## 2.0.0-beta.6
|
|
131
|
+
|
|
132
|
+
### Patch Changes
|
|
133
|
+
|
|
134
|
+
- Updated dependencies [f7d4f01]
|
|
135
|
+
- @ai-sdk/provider-utils@5.0.0-beta.3
|
|
136
|
+
- @ai-sdk/provider@4.0.0-beta.2
|
|
137
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.5
|
|
138
|
+
|
|
139
|
+
## 2.0.0-beta.5
|
|
140
|
+
|
|
141
|
+
### Patch Changes
|
|
142
|
+
|
|
143
|
+
- Updated dependencies [5c2a5a2]
|
|
144
|
+
- @ai-sdk/provider@4.0.0-beta.1
|
|
145
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.4
|
|
146
|
+
- @ai-sdk/provider-utils@5.0.0-beta.2
|
|
147
|
+
|
|
148
|
+
## 2.0.0-beta.4
|
|
149
|
+
|
|
150
|
+
### Patch Changes
|
|
151
|
+
|
|
152
|
+
- Updated dependencies [8f3e1da]
|
|
153
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.3
|
|
154
|
+
|
|
155
|
+
## 2.0.0-beta.3
|
|
156
|
+
|
|
157
|
+
### Patch Changes
|
|
158
|
+
|
|
159
|
+
- 4ab27b9: chore(alibaba): update v3 specs to v4
|
|
160
|
+
|
|
3
161
|
## 2.0.0-beta.2
|
|
4
162
|
|
|
5
163
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
The **[Alibaba provider](https://ai-sdk.dev/providers/ai-sdk-providers/alibaba)** for the [AI SDK](https://ai-sdk.dev/docs) contains language model support for [Alibaba Cloud Model Studio](https://modelstudio.console.alibabacloud.com/), including the Qwen model series with advanced reasoning capabilities.
|
|
4
4
|
|
|
5
|
+
> **Deploying to Vercel?** With Vercel's AI Gateway you can access Alibaba (and hundreds of models from other providers) — no additional packages, API keys, or extra cost. [Get started with AI Gateway](https://vercel.com/ai-gateway).
|
|
6
|
+
|
|
5
7
|
## Setup
|
|
6
8
|
|
|
7
9
|
The Alibaba provider is available in the `@ai-sdk/alibaba` module. You can install it with
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
2
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
|
-
import {
|
|
3
|
+
import { ProviderV4, LanguageModelV4, Experimental_VideoModelV4 } from '@ai-sdk/provider';
|
|
4
4
|
|
|
5
5
|
type AlibabaChatModelId = 'qwen3-max' | 'qwen3-max-preview' | 'qwen-plus' | 'qwen-plus-latest' | 'qwen-flash' | 'qwen-turbo' | 'qwen-turbo-latest' | 'qwen3-235b-a22b' | 'qwen3-32b' | 'qwen3-30b-a3b' | 'qwen3-14b' | 'qwen3-next-80b-a3b-thinking' | 'qwen3-235b-a22b-thinking-2507' | 'qwen3-30b-a3b-thinking-2507' | 'qwq-plus' | 'qwq-plus-latest' | 'qwq-32b' | 'qwen-coder' | 'qwen3-coder-plus' | 'qwen3-coder-flash' | (string & {});
|
|
6
6
|
declare const alibabaLanguageModelOptions: z.ZodObject<{
|
|
@@ -16,24 +16,24 @@ type AlibabaCacheControl = {
|
|
|
16
16
|
|
|
17
17
|
type AlibabaVideoModelId = 'wan2.6-t2v' | 'wan2.5-t2v-preview' | 'wan2.6-i2v' | 'wan2.6-i2v-flash' | 'wan2.6-r2v' | 'wan2.6-r2v-flash' | (string & {});
|
|
18
18
|
|
|
19
|
-
interface AlibabaProvider extends
|
|
20
|
-
(modelId: AlibabaChatModelId):
|
|
19
|
+
interface AlibabaProvider extends ProviderV4 {
|
|
20
|
+
(modelId: AlibabaChatModelId): LanguageModelV4;
|
|
21
21
|
/**
|
|
22
22
|
* Creates a model for text generation.
|
|
23
23
|
*/
|
|
24
|
-
languageModel(modelId: AlibabaChatModelId):
|
|
24
|
+
languageModel(modelId: AlibabaChatModelId): LanguageModelV4;
|
|
25
25
|
/**
|
|
26
26
|
* Creates a chat model for text generation.
|
|
27
27
|
*/
|
|
28
|
-
chatModel(modelId: AlibabaChatModelId):
|
|
28
|
+
chatModel(modelId: AlibabaChatModelId): LanguageModelV4;
|
|
29
29
|
/**
|
|
30
30
|
* Creates a model for video generation.
|
|
31
31
|
*/
|
|
32
|
-
video(modelId: AlibabaVideoModelId):
|
|
32
|
+
video(modelId: AlibabaVideoModelId): Experimental_VideoModelV4;
|
|
33
33
|
/**
|
|
34
34
|
* Creates a model for video generation.
|
|
35
35
|
*/
|
|
36
|
-
videoModel(modelId: AlibabaVideoModelId):
|
|
36
|
+
videoModel(modelId: AlibabaVideoModelId): Experimental_VideoModelV4;
|
|
37
37
|
}
|
|
38
38
|
interface AlibabaProviderSettings {
|
|
39
39
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
2
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
|
-
import {
|
|
3
|
+
import { ProviderV4, LanguageModelV4, Experimental_VideoModelV4 } from '@ai-sdk/provider';
|
|
4
4
|
|
|
5
5
|
type AlibabaChatModelId = 'qwen3-max' | 'qwen3-max-preview' | 'qwen-plus' | 'qwen-plus-latest' | 'qwen-flash' | 'qwen-turbo' | 'qwen-turbo-latest' | 'qwen3-235b-a22b' | 'qwen3-32b' | 'qwen3-30b-a3b' | 'qwen3-14b' | 'qwen3-next-80b-a3b-thinking' | 'qwen3-235b-a22b-thinking-2507' | 'qwen3-30b-a3b-thinking-2507' | 'qwq-plus' | 'qwq-plus-latest' | 'qwq-32b' | 'qwen-coder' | 'qwen3-coder-plus' | 'qwen3-coder-flash' | (string & {});
|
|
6
6
|
declare const alibabaLanguageModelOptions: z.ZodObject<{
|
|
@@ -16,24 +16,24 @@ type AlibabaCacheControl = {
|
|
|
16
16
|
|
|
17
17
|
type AlibabaVideoModelId = 'wan2.6-t2v' | 'wan2.5-t2v-preview' | 'wan2.6-i2v' | 'wan2.6-i2v-flash' | 'wan2.6-r2v' | 'wan2.6-r2v-flash' | (string & {});
|
|
18
18
|
|
|
19
|
-
interface AlibabaProvider extends
|
|
20
|
-
(modelId: AlibabaChatModelId):
|
|
19
|
+
interface AlibabaProvider extends ProviderV4 {
|
|
20
|
+
(modelId: AlibabaChatModelId): LanguageModelV4;
|
|
21
21
|
/**
|
|
22
22
|
* Creates a model for text generation.
|
|
23
23
|
*/
|
|
24
|
-
languageModel(modelId: AlibabaChatModelId):
|
|
24
|
+
languageModel(modelId: AlibabaChatModelId): LanguageModelV4;
|
|
25
25
|
/**
|
|
26
26
|
* Creates a chat model for text generation.
|
|
27
27
|
*/
|
|
28
|
-
chatModel(modelId: AlibabaChatModelId):
|
|
28
|
+
chatModel(modelId: AlibabaChatModelId): LanguageModelV4;
|
|
29
29
|
/**
|
|
30
30
|
* Creates a model for video generation.
|
|
31
31
|
*/
|
|
32
|
-
video(modelId: AlibabaVideoModelId):
|
|
32
|
+
video(modelId: AlibabaVideoModelId): Experimental_VideoModelV4;
|
|
33
33
|
/**
|
|
34
34
|
* Creates a model for video generation.
|
|
35
35
|
*/
|
|
36
|
-
videoModel(modelId: AlibabaVideoModelId):
|
|
36
|
+
videoModel(modelId: AlibabaVideoModelId): Experimental_VideoModelV4;
|
|
37
37
|
}
|
|
38
38
|
interface AlibabaProviderSettings {
|
|
39
39
|
/**
|
package/dist/index.js
CHANGED
|
@@ -18,13 +18,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
23
|
VERSION: () => VERSION,
|
|
24
24
|
alibaba: () => alibaba,
|
|
25
25
|
createAlibaba: () => createAlibaba
|
|
26
26
|
});
|
|
27
|
-
module.exports = __toCommonJS(
|
|
27
|
+
module.exports = __toCommonJS(index_exports);
|
|
28
28
|
|
|
29
29
|
// src/alibaba-provider.ts
|
|
30
30
|
var import_provider4 = require("@ai-sdk/provider");
|
|
@@ -89,7 +89,7 @@ function convertToAlibabaChatMessages({
|
|
|
89
89
|
prompt,
|
|
90
90
|
cacheControlValidator
|
|
91
91
|
}) {
|
|
92
|
-
var _a;
|
|
92
|
+
var _a, _b;
|
|
93
93
|
const messages = [];
|
|
94
94
|
for (const { role, content, ...message } of prompt) {
|
|
95
95
|
const messageCacheControl = cacheControlValidator == null ? void 0 : cacheControlValidator.getCacheControl(
|
|
@@ -114,18 +114,12 @@ function convertToAlibabaChatMessages({
|
|
|
114
114
|
break;
|
|
115
115
|
}
|
|
116
116
|
case "user": {
|
|
117
|
-
const isSinglePart = content.length === 1;
|
|
118
|
-
if (isSinglePart && content[0].type === "text" && !messageCacheControl) {
|
|
119
|
-
messages.push({
|
|
120
|
-
role: "user",
|
|
121
|
-
content: content[0].text
|
|
122
|
-
});
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
117
|
messages.push({
|
|
126
118
|
role: "user",
|
|
127
|
-
content: content.map((part) => {
|
|
128
|
-
|
|
119
|
+
content: content.map((part, index) => {
|
|
120
|
+
var _a2;
|
|
121
|
+
const isLastPart = index === content.length - 1;
|
|
122
|
+
const partCacheControl = (_a2 = cacheControlValidator == null ? void 0 : cacheControlValidator.getCacheControl(part.providerOptions)) != null ? _a2 : isLastPart ? messageCacheControl : void 0;
|
|
129
123
|
switch (part.type) {
|
|
130
124
|
case "text": {
|
|
131
125
|
return {
|
|
@@ -135,6 +129,11 @@ function convertToAlibabaChatMessages({
|
|
|
135
129
|
};
|
|
136
130
|
}
|
|
137
131
|
case "file": {
|
|
132
|
+
if ((0, import_provider_utils.isProviderReference)(part.data)) {
|
|
133
|
+
throw new import_provider.UnsupportedFunctionalityError({
|
|
134
|
+
functionality: "file parts with provider references"
|
|
135
|
+
});
|
|
136
|
+
}
|
|
138
137
|
if (part.mediaType.startsWith("image/")) {
|
|
139
138
|
const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
|
|
140
139
|
return {
|
|
@@ -192,13 +191,13 @@ function convertToAlibabaChatMessages({
|
|
|
192
191
|
const toolResponses = content.filter(
|
|
193
192
|
(r) => r.type !== "tool-approval-response"
|
|
194
193
|
);
|
|
195
|
-
const isSinglePart = toolResponses.length === 1;
|
|
196
194
|
for (let i = 0; i < toolResponses.length; i++) {
|
|
197
195
|
const toolResponse = toolResponses[i];
|
|
198
196
|
const output = toolResponse.output;
|
|
199
|
-
const
|
|
197
|
+
const isLastPart = i === toolResponses.length - 1;
|
|
198
|
+
const partCacheControl = (_a = cacheControlValidator == null ? void 0 : cacheControlValidator.getCacheControl(
|
|
200
199
|
toolResponse.providerOptions
|
|
201
|
-
);
|
|
200
|
+
)) != null ? _a : isLastPart ? messageCacheControl : void 0;
|
|
202
201
|
let contentValue;
|
|
203
202
|
switch (output.type) {
|
|
204
203
|
case "text":
|
|
@@ -206,7 +205,7 @@ function convertToAlibabaChatMessages({
|
|
|
206
205
|
contentValue = output.value;
|
|
207
206
|
break;
|
|
208
207
|
case "execution-denied":
|
|
209
|
-
contentValue = (
|
|
208
|
+
contentValue = (_b = output.reason) != null ? _b : "Tool execution denied.";
|
|
210
209
|
break;
|
|
211
210
|
case "content":
|
|
212
211
|
case "json":
|
|
@@ -272,7 +271,7 @@ var CacheControlValidator = class {
|
|
|
272
271
|
// src/alibaba-chat-language-model.ts
|
|
273
272
|
var AlibabaLanguageModel = class {
|
|
274
273
|
constructor(modelId, config) {
|
|
275
|
-
this.specificationVersion = "
|
|
274
|
+
this.specificationVersion = "v4";
|
|
276
275
|
this.supportedUrls = {
|
|
277
276
|
"image/*": [/^https?:\/\/.*$/]
|
|
278
277
|
};
|
|
@@ -297,6 +296,7 @@ var AlibabaLanguageModel = class {
|
|
|
297
296
|
stopSequences,
|
|
298
297
|
responseFormat,
|
|
299
298
|
seed,
|
|
299
|
+
reasoning,
|
|
300
300
|
providerOptions,
|
|
301
301
|
tools,
|
|
302
302
|
toolChoice
|
|
@@ -329,9 +329,11 @@ var AlibabaLanguageModel = class {
|
|
|
329
329
|
description: responseFormat.description
|
|
330
330
|
}
|
|
331
331
|
} : { type: "json_object" } : void 0,
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
332
|
+
...resolveAlibabaThinking({
|
|
333
|
+
reasoning,
|
|
334
|
+
alibabaOptions,
|
|
335
|
+
warnings
|
|
336
|
+
}),
|
|
335
337
|
// Convert messages with cache control support
|
|
336
338
|
messages: convertToAlibabaChatMessages({
|
|
337
339
|
prompt,
|
|
@@ -626,6 +628,34 @@ var AlibabaLanguageModel = class {
|
|
|
626
628
|
};
|
|
627
629
|
}
|
|
628
630
|
};
|
|
631
|
+
function resolveAlibabaThinking({
|
|
632
|
+
reasoning,
|
|
633
|
+
alibabaOptions,
|
|
634
|
+
warnings
|
|
635
|
+
}) {
|
|
636
|
+
if ((alibabaOptions == null ? void 0 : alibabaOptions.enableThinking) != null || (alibabaOptions == null ? void 0 : alibabaOptions.thinkingBudget) != null) {
|
|
637
|
+
return {
|
|
638
|
+
...alibabaOptions.enableThinking != null ? { enable_thinking: alibabaOptions.enableThinking } : {},
|
|
639
|
+
...alibabaOptions.thinkingBudget != null ? { thinking_budget: alibabaOptions.thinkingBudget } : {}
|
|
640
|
+
};
|
|
641
|
+
}
|
|
642
|
+
if (!(0, import_provider_utils2.isCustomReasoning)(reasoning)) {
|
|
643
|
+
return {};
|
|
644
|
+
}
|
|
645
|
+
if (reasoning === "none") {
|
|
646
|
+
return { enable_thinking: false };
|
|
647
|
+
}
|
|
648
|
+
const thinkingBudget = (0, import_provider_utils2.mapReasoningToProviderBudget)({
|
|
649
|
+
reasoning,
|
|
650
|
+
maxOutputTokens: 16384,
|
|
651
|
+
maxReasoningBudget: 16384,
|
|
652
|
+
warnings
|
|
653
|
+
});
|
|
654
|
+
return {
|
|
655
|
+
enable_thinking: true,
|
|
656
|
+
...thinkingBudget != null ? { thinking_budget: thinkingBudget } : {}
|
|
657
|
+
};
|
|
658
|
+
}
|
|
629
659
|
var alibabaUsageSchema = import_v42.z.object({
|
|
630
660
|
prompt_tokens: import_v42.z.number(),
|
|
631
661
|
completion_tokens: import_v42.z.number(),
|
|
@@ -763,7 +793,7 @@ var AlibabaVideoModel = class {
|
|
|
763
793
|
constructor(modelId, config) {
|
|
764
794
|
this.modelId = modelId;
|
|
765
795
|
this.config = config;
|
|
766
|
-
this.specificationVersion = "
|
|
796
|
+
this.specificationVersion = "v4";
|
|
767
797
|
this.maxVideosPerCall = 1;
|
|
768
798
|
}
|
|
769
799
|
get provider() {
|
|
@@ -970,7 +1000,7 @@ var AlibabaVideoModel = class {
|
|
|
970
1000
|
};
|
|
971
1001
|
|
|
972
1002
|
// src/version.ts
|
|
973
|
-
var VERSION = "2.0.0-beta.
|
|
1003
|
+
var VERSION = "2.0.0-beta.21";
|
|
974
1004
|
|
|
975
1005
|
// src/alibaba-provider.ts
|
|
976
1006
|
var alibabaErrorDataSchema = import_v44.z.object({
|
|
@@ -1023,7 +1053,7 @@ function createAlibaba(options = {}) {
|
|
|
1023
1053
|
}
|
|
1024
1054
|
return createLanguageModel(modelId);
|
|
1025
1055
|
};
|
|
1026
|
-
provider.specificationVersion = "
|
|
1056
|
+
provider.specificationVersion = "v4";
|
|
1027
1057
|
provider.languageModel = createLanguageModel;
|
|
1028
1058
|
provider.chatModel = createLanguageModel;
|
|
1029
1059
|
provider.video = createVideoModel;
|