@ai-sdk/xai 4.0.0-beta.2 → 4.0.0-beta.20
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 +148 -8
- package/dist/index.d.mts +51 -43
- package/dist/index.d.ts +51 -43
- package/dist/index.js +110 -53
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +111 -50
- package/dist/index.mjs.map +1 -1
- package/docs/01-xai.mdx +30 -336
- package/package.json +4 -6
- package/src/convert-to-xai-chat-messages.ts +5 -5
- package/src/convert-xai-chat-usage.ts +2 -2
- package/src/map-xai-finish-reason.ts +2 -2
- package/src/responses/convert-to-xai-responses-input.ts +7 -5
- package/src/responses/convert-xai-responses-usage.ts +2 -2
- package/src/responses/map-xai-responses-finish-reason.ts +2 -2
- package/src/responses/xai-responses-api.ts +3 -0
- package/src/responses/xai-responses-language-model.ts +71 -30
- package/src/responses/xai-responses-options.ts +4 -0
- package/src/responses/xai-responses-prepare-tools.ts +6 -6
- package/src/xai-chat-language-model.ts +41 -22
- package/src/xai-chat-options.ts +3 -6
- package/src/xai-image-model.ts +43 -28
- package/src/xai-image-options.ts +2 -0
- package/src/xai-image-settings.ts +0 -2
- package/src/xai-prepare-tools.ts +6 -6
- package/src/xai-provider.ts +18 -21
- package/src/xai-video-model.ts +23 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,145 @@
|
|
|
1
1
|
# @ai-sdk/xai
|
|
2
2
|
|
|
3
|
+
## 4.0.0-beta.20
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [2e17091]
|
|
8
|
+
- @ai-sdk/provider-utils@5.0.0-beta.9
|
|
9
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.12
|
|
10
|
+
|
|
11
|
+
## 4.0.0-beta.19
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [986c6fd]
|
|
16
|
+
- Updated dependencies [493295c]
|
|
17
|
+
- @ai-sdk/provider-utils@5.0.0-beta.8
|
|
18
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.11
|
|
19
|
+
|
|
20
|
+
## 4.0.0-beta.18
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- 9f20868: fix(provider/xai): correct finish reason for tool calls
|
|
25
|
+
|
|
26
|
+
## 4.0.0-beta.17
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [1f509d4]
|
|
31
|
+
- @ai-sdk/provider-utils@5.0.0-beta.7
|
|
32
|
+
- @ai-sdk/provider@4.0.0-beta.5
|
|
33
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.10
|
|
34
|
+
|
|
35
|
+
## 4.0.0-beta.16
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- 4f91b5d: chore(provider/xai): update Grok 4.20 model IDs to their non-beta versions
|
|
40
|
+
|
|
41
|
+
## 4.0.0-beta.15
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- 74d520f: feat: migrate providers to support new top-level `reasoning` parameter
|
|
46
|
+
- Updated dependencies [74d520f]
|
|
47
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.9
|
|
48
|
+
|
|
49
|
+
## 4.0.0-beta.14
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- Updated dependencies [3887c70]
|
|
54
|
+
- @ai-sdk/provider-utils@5.0.0-beta.6
|
|
55
|
+
- @ai-sdk/provider@4.0.0-beta.4
|
|
56
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.8
|
|
57
|
+
|
|
58
|
+
## 4.0.0-beta.13
|
|
59
|
+
|
|
60
|
+
### Major Changes
|
|
61
|
+
|
|
62
|
+
- 776b617: feat(provider): adding new 'custom' content type
|
|
63
|
+
|
|
64
|
+
### Patch Changes
|
|
65
|
+
|
|
66
|
+
- Updated dependencies [776b617]
|
|
67
|
+
- @ai-sdk/provider-utils@5.0.0-beta.5
|
|
68
|
+
- @ai-sdk/provider@4.0.0-beta.3
|
|
69
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.7
|
|
70
|
+
|
|
71
|
+
## 4.0.0-beta.12
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- d20829e: feat(provider/xai): add moderation error, and costInUsdTicks to video model
|
|
76
|
+
- Updated dependencies [61753c3]
|
|
77
|
+
- @ai-sdk/provider-utils@5.0.0-beta.4
|
|
78
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.6
|
|
79
|
+
|
|
80
|
+
## 4.0.0-beta.11
|
|
81
|
+
|
|
82
|
+
### Patch Changes
|
|
83
|
+
|
|
84
|
+
- f7d4f01: feat(provider): add support for `reasoning-file` type for files that are part of reasoning
|
|
85
|
+
- Updated dependencies [f7d4f01]
|
|
86
|
+
- @ai-sdk/provider-utils@5.0.0-beta.3
|
|
87
|
+
- @ai-sdk/provider@4.0.0-beta.2
|
|
88
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.5
|
|
89
|
+
|
|
90
|
+
## 4.0.0-beta.10
|
|
91
|
+
|
|
92
|
+
### Patch Changes
|
|
93
|
+
|
|
94
|
+
- Updated dependencies [5c2a5a2]
|
|
95
|
+
- @ai-sdk/provider@4.0.0-beta.1
|
|
96
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.4
|
|
97
|
+
- @ai-sdk/provider-utils@5.0.0-beta.2
|
|
98
|
+
|
|
99
|
+
## 4.0.0-beta.9
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- Updated dependencies [8f3e1da]
|
|
104
|
+
- @ai-sdk/openai-compatible@3.0.0-beta.3
|
|
105
|
+
|
|
106
|
+
## 4.0.0-beta.8
|
|
107
|
+
|
|
108
|
+
### Patch Changes
|
|
109
|
+
|
|
110
|
+
- 4799fa5: chore(provider/xai): update provider to use v4 types
|
|
111
|
+
|
|
112
|
+
## 4.0.0-beta.7
|
|
113
|
+
|
|
114
|
+
### Patch Changes
|
|
115
|
+
|
|
116
|
+
- 0f11f10: add reasoningSummary to responses API provider options
|
|
117
|
+
- 12115e9: fix reasoning text extraction from content in responses doGenerate
|
|
118
|
+
|
|
119
|
+
## 4.0.0-beta.6
|
|
120
|
+
|
|
121
|
+
### Major Changes
|
|
122
|
+
|
|
123
|
+
- f62681f: feat(provider/xai): make responses api the default
|
|
124
|
+
|
|
125
|
+
## 4.0.0-beta.5
|
|
126
|
+
|
|
127
|
+
### Patch Changes
|
|
128
|
+
|
|
129
|
+
- aa5a583: chore(provider/xai): remove obsolete Grok 2 models now that they are shut down in their API
|
|
130
|
+
|
|
131
|
+
## 4.0.0-beta.4
|
|
132
|
+
|
|
133
|
+
### Patch Changes
|
|
134
|
+
|
|
135
|
+
- 25f1837: feat(xai): add b64_json response format, usage cost tracking, and quality/user parameters for image models
|
|
136
|
+
|
|
137
|
+
## 4.0.0-beta.3
|
|
138
|
+
|
|
139
|
+
### Patch Changes
|
|
140
|
+
|
|
141
|
+
- f5181ad: feat(provider/xai): support multiple input images for image editing
|
|
142
|
+
|
|
3
143
|
## 4.0.0-beta.2
|
|
4
144
|
|
|
5
145
|
### Patch Changes
|
|
@@ -524,13 +664,13 @@
|
|
|
524
664
|
Before
|
|
525
665
|
|
|
526
666
|
```ts
|
|
527
|
-
model.textEmbeddingModel(
|
|
667
|
+
model.textEmbeddingModel("my-model-id");
|
|
528
668
|
```
|
|
529
669
|
|
|
530
670
|
After
|
|
531
671
|
|
|
532
672
|
```ts
|
|
533
|
-
model.embeddingModel(
|
|
673
|
+
model.embeddingModel("my-model-id");
|
|
534
674
|
```
|
|
535
675
|
|
|
536
676
|
- 2625a04: feat(openai); update spec for mcp approval
|
|
@@ -788,13 +928,13 @@
|
|
|
788
928
|
Before
|
|
789
929
|
|
|
790
930
|
```ts
|
|
791
|
-
model.textEmbeddingModel(
|
|
931
|
+
model.textEmbeddingModel("my-model-id");
|
|
792
932
|
```
|
|
793
933
|
|
|
794
934
|
After
|
|
795
935
|
|
|
796
936
|
```ts
|
|
797
|
-
model.embeddingModel(
|
|
937
|
+
model.embeddingModel("my-model-id");
|
|
798
938
|
```
|
|
799
939
|
|
|
800
940
|
- 8514146: add grok-4-1 model IDs
|
|
@@ -1337,7 +1477,7 @@
|
|
|
1337
1477
|
|
|
1338
1478
|
```js
|
|
1339
1479
|
await generateImage({
|
|
1340
|
-
model: luma.image(
|
|
1480
|
+
model: luma.image("photon-flash-1", {
|
|
1341
1481
|
maxImagesPerCall: 5,
|
|
1342
1482
|
pollIntervalMillis: 500,
|
|
1343
1483
|
}),
|
|
@@ -1350,7 +1490,7 @@
|
|
|
1350
1490
|
|
|
1351
1491
|
```js
|
|
1352
1492
|
await generateImage({
|
|
1353
|
-
model: luma.image(
|
|
1493
|
+
model: luma.image("photon-flash-1"),
|
|
1354
1494
|
prompt,
|
|
1355
1495
|
n: 10,
|
|
1356
1496
|
maxImagesPerCall: 5,
|
|
@@ -1666,7 +1806,7 @@
|
|
|
1666
1806
|
|
|
1667
1807
|
```js
|
|
1668
1808
|
await generateImage({
|
|
1669
|
-
model: luma.image(
|
|
1809
|
+
model: luma.image("photon-flash-1", {
|
|
1670
1810
|
maxImagesPerCall: 5,
|
|
1671
1811
|
pollIntervalMillis: 500,
|
|
1672
1812
|
}),
|
|
@@ -1679,7 +1819,7 @@
|
|
|
1679
1819
|
|
|
1680
1820
|
```js
|
|
1681
1821
|
await generateImage({
|
|
1682
|
-
model: luma.image(
|
|
1822
|
+
model: luma.image("photon-flash-1"),
|
|
1683
1823
|
prompt,
|
|
1684
1824
|
n: 10,
|
|
1685
1825
|
maxImagesPerCall: 5,
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
-
import {
|
|
2
|
+
import { ProviderV4, LanguageModelV4, ImageModelV4, Experimental_VideoModelV4 } from '@ai-sdk/provider';
|
|
3
3
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
4
4
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
5
5
|
|
|
6
|
-
type XaiChatModelId = 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-
|
|
6
|
+
type XaiChatModelId = 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-code-fast-1' | 'grok-4' | 'grok-4-0709' | 'grok-4-latest' | 'grok-3' | 'grok-3-latest' | 'grok-3-mini' | 'grok-3-mini-latest' | (string & {});
|
|
7
7
|
declare const xaiLanguageModelChatOptions: z.ZodObject<{
|
|
8
8
|
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
9
9
|
low: "low";
|
|
@@ -58,7 +58,7 @@ declare const xaiErrorDataSchema: z.ZodObject<{
|
|
|
58
58
|
}, z.core.$strip>;
|
|
59
59
|
type XaiErrorData = z.infer<typeof xaiErrorDataSchema>;
|
|
60
60
|
|
|
61
|
-
type XaiResponsesModelId = 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | (string & {});
|
|
61
|
+
type XaiResponsesModelId = 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | (string & {});
|
|
62
62
|
/**
|
|
63
63
|
* @see https://docs.x.ai/docs/api-reference#create-new-response
|
|
64
64
|
*/
|
|
@@ -68,6 +68,11 @@ declare const xaiLanguageModelResponsesOptions: z.ZodObject<{
|
|
|
68
68
|
high: "high";
|
|
69
69
|
medium: "medium";
|
|
70
70
|
}>>;
|
|
71
|
+
reasoningSummary: z.ZodOptional<z.ZodEnum<{
|
|
72
|
+
auto: "auto";
|
|
73
|
+
concise: "concise";
|
|
74
|
+
detailed: "detailed";
|
|
75
|
+
}>>;
|
|
71
76
|
logprobs: z.ZodOptional<z.ZodBoolean>;
|
|
72
77
|
topLogprobs: z.ZodOptional<z.ZodNumber>;
|
|
73
78
|
store: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -86,6 +91,12 @@ declare const xaiImageModelOptions: z.ZodObject<{
|
|
|
86
91
|
"1k": "1k";
|
|
87
92
|
"2k": "2k";
|
|
88
93
|
}>>;
|
|
94
|
+
quality: z.ZodOptional<z.ZodEnum<{
|
|
95
|
+
low: "low";
|
|
96
|
+
high: "high";
|
|
97
|
+
medium: "medium";
|
|
98
|
+
}>>;
|
|
99
|
+
user: z.ZodOptional<z.ZodString>;
|
|
89
100
|
}, z.core.$strip>;
|
|
90
101
|
type XaiImageModelOptions = z.infer<typeof xaiImageModelOptions>;
|
|
91
102
|
|
|
@@ -99,16 +110,16 @@ type XaiVideoModelOptions = {
|
|
|
99
110
|
[key: string]: unknown;
|
|
100
111
|
};
|
|
101
112
|
|
|
102
|
-
type XaiImageModelId = 'grok-
|
|
113
|
+
type XaiImageModelId = 'grok-imagine-image' | 'grok-imagine-image-pro' | (string & {});
|
|
103
114
|
|
|
104
115
|
declare const codeExecutionToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
105
116
|
output: string;
|
|
106
117
|
error?: string | undefined;
|
|
107
|
-
}, object>;
|
|
118
|
+
}, object, {}>;
|
|
108
119
|
declare const codeExecution: (args?: Parameters<typeof codeExecutionToolFactory>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
109
120
|
output: string;
|
|
110
121
|
error?: string | undefined;
|
|
111
|
-
}>;
|
|
122
|
+
}, {}>;
|
|
112
123
|
|
|
113
124
|
declare const mcpServerToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
114
125
|
name: string;
|
|
@@ -121,32 +132,32 @@ declare const mcpServerToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWi
|
|
|
121
132
|
allowedTools?: string[];
|
|
122
133
|
headers?: Record<string, string>;
|
|
123
134
|
authorization?: string;
|
|
124
|
-
}>;
|
|
135
|
+
}, {}>;
|
|
125
136
|
declare const mcpServer: (args: Parameters<typeof mcpServerToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
126
137
|
name: string;
|
|
127
138
|
arguments: string;
|
|
128
139
|
result: unknown;
|
|
129
|
-
}>;
|
|
140
|
+
}, {}>;
|
|
130
141
|
|
|
131
142
|
declare const viewImageToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
132
143
|
description: string;
|
|
133
144
|
objects?: string[] | undefined;
|
|
134
|
-
}, object>;
|
|
145
|
+
}, object, {}>;
|
|
135
146
|
declare const viewImage: (args?: Parameters<typeof viewImageToolFactory>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
136
147
|
description: string;
|
|
137
148
|
objects?: string[] | undefined;
|
|
138
|
-
}>;
|
|
149
|
+
}, {}>;
|
|
139
150
|
|
|
140
151
|
declare const viewXVideoToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
141
152
|
description: string;
|
|
142
153
|
transcript?: string | undefined;
|
|
143
154
|
duration?: number | undefined;
|
|
144
|
-
}, object>;
|
|
155
|
+
}, object, {}>;
|
|
145
156
|
declare const viewXVideo: (args?: Parameters<typeof viewXVideoToolFactory>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
146
157
|
description: string;
|
|
147
158
|
transcript?: string | undefined;
|
|
148
159
|
duration?: number | undefined;
|
|
149
|
-
}>;
|
|
160
|
+
}, {}>;
|
|
150
161
|
|
|
151
162
|
declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
152
163
|
query: string;
|
|
@@ -159,7 +170,7 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWi
|
|
|
159
170
|
allowedDomains?: string[];
|
|
160
171
|
excludedDomains?: string[];
|
|
161
172
|
enableImageUnderstanding?: boolean;
|
|
162
|
-
}>;
|
|
173
|
+
}, {}>;
|
|
163
174
|
declare const webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
164
175
|
query: string;
|
|
165
176
|
sources: Array<{
|
|
@@ -167,7 +178,7 @@ declare const webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) =>
|
|
|
167
178
|
url: string;
|
|
168
179
|
snippet: string;
|
|
169
180
|
}>;
|
|
170
|
-
}>;
|
|
181
|
+
}, {}>;
|
|
171
182
|
|
|
172
183
|
declare const xSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
173
184
|
query: string;
|
|
@@ -184,7 +195,7 @@ declare const xSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWith
|
|
|
184
195
|
toDate?: string;
|
|
185
196
|
enableImageUnderstanding?: boolean;
|
|
186
197
|
enableVideoUnderstanding?: boolean;
|
|
187
|
-
}>;
|
|
198
|
+
}, {}>;
|
|
188
199
|
declare const xSearch: (args?: Parameters<typeof xSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
189
200
|
query: string;
|
|
190
201
|
posts: Array<{
|
|
@@ -193,16 +204,16 @@ declare const xSearch: (args?: Parameters<typeof xSearchToolFactory>[0]) => _ai_
|
|
|
193
204
|
url: string;
|
|
194
205
|
likes: number;
|
|
195
206
|
}>;
|
|
196
|
-
}>;
|
|
207
|
+
}, {}>;
|
|
197
208
|
|
|
198
209
|
declare const xaiTools: {
|
|
199
210
|
codeExecution: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
200
211
|
output: string;
|
|
201
212
|
error?: string | undefined;
|
|
202
|
-
}, object>>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
213
|
+
}, object, {}>>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
203
214
|
output: string;
|
|
204
215
|
error?: string | undefined;
|
|
205
|
-
}>;
|
|
216
|
+
}, {}>;
|
|
206
217
|
fileSearch: (args: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
207
218
|
queries: string[];
|
|
208
219
|
results: null | {
|
|
@@ -214,7 +225,7 @@ declare const xaiTools: {
|
|
|
214
225
|
}, {
|
|
215
226
|
vectorStoreIds: string[];
|
|
216
227
|
maxNumResults?: number;
|
|
217
|
-
}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
228
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
218
229
|
queries: string[];
|
|
219
230
|
results: null | {
|
|
220
231
|
fileId: string;
|
|
@@ -222,7 +233,7 @@ declare const xaiTools: {
|
|
|
222
233
|
score: number;
|
|
223
234
|
text: string;
|
|
224
235
|
}[];
|
|
225
|
-
}>;
|
|
236
|
+
}, {}>;
|
|
226
237
|
mcpServer: (args: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
227
238
|
name: string;
|
|
228
239
|
arguments: string;
|
|
@@ -234,27 +245,27 @@ declare const xaiTools: {
|
|
|
234
245
|
allowedTools?: string[];
|
|
235
246
|
headers?: Record<string, string>;
|
|
236
247
|
authorization?: string;
|
|
237
|
-
}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
248
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
238
249
|
name: string;
|
|
239
250
|
arguments: string;
|
|
240
251
|
result: unknown;
|
|
241
|
-
}>;
|
|
252
|
+
}, {}>;
|
|
242
253
|
viewImage: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
243
254
|
description: string;
|
|
244
255
|
objects?: string[] | undefined;
|
|
245
|
-
}, object>>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
256
|
+
}, object, {}>>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
246
257
|
description: string;
|
|
247
258
|
objects?: string[] | undefined;
|
|
248
|
-
}>;
|
|
259
|
+
}, {}>;
|
|
249
260
|
viewXVideo: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
250
261
|
description: string;
|
|
251
262
|
transcript?: string | undefined;
|
|
252
263
|
duration?: number | undefined;
|
|
253
|
-
}, object>>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
264
|
+
}, object, {}>>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
254
265
|
description: string;
|
|
255
266
|
transcript?: string | undefined;
|
|
256
267
|
duration?: number | undefined;
|
|
257
|
-
}>;
|
|
268
|
+
}, {}>;
|
|
258
269
|
webSearch: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
259
270
|
query: string;
|
|
260
271
|
sources: Array<{
|
|
@@ -266,14 +277,14 @@ declare const xaiTools: {
|
|
|
266
277
|
allowedDomains?: string[];
|
|
267
278
|
excludedDomains?: string[];
|
|
268
279
|
enableImageUnderstanding?: boolean;
|
|
269
|
-
}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
280
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
270
281
|
query: string;
|
|
271
282
|
sources: Array<{
|
|
272
283
|
title: string;
|
|
273
284
|
url: string;
|
|
274
285
|
snippet: string;
|
|
275
286
|
}>;
|
|
276
|
-
}>;
|
|
287
|
+
}, {}>;
|
|
277
288
|
xSearch: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
278
289
|
query: string;
|
|
279
290
|
posts: Array<{
|
|
@@ -289,7 +300,7 @@ declare const xaiTools: {
|
|
|
289
300
|
toDate?: string;
|
|
290
301
|
enableImageUnderstanding?: boolean;
|
|
291
302
|
enableVideoUnderstanding?: boolean;
|
|
292
|
-
}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
303
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
293
304
|
query: string;
|
|
294
305
|
posts: Array<{
|
|
295
306
|
author: string;
|
|
@@ -297,42 +308,39 @@ declare const xaiTools: {
|
|
|
297
308
|
url: string;
|
|
298
309
|
likes: number;
|
|
299
310
|
}>;
|
|
300
|
-
}>;
|
|
311
|
+
}, {}>;
|
|
301
312
|
};
|
|
302
313
|
|
|
303
|
-
interface XaiProvider extends
|
|
304
|
-
|
|
305
|
-
* Creates an Xai chat model for text generation.
|
|
306
|
-
*/
|
|
307
|
-
(modelId: XaiChatModelId): LanguageModelV3;
|
|
314
|
+
interface XaiProvider extends ProviderV4 {
|
|
315
|
+
(modelId: XaiResponsesModelId): LanguageModelV4;
|
|
308
316
|
/**
|
|
309
317
|
* Creates an Xai language model for text generation.
|
|
310
318
|
*/
|
|
311
|
-
languageModel(modelId:
|
|
319
|
+
languageModel(modelId: XaiResponsesModelId): LanguageModelV4;
|
|
312
320
|
/**
|
|
313
321
|
* Creates an Xai chat model for text generation.
|
|
314
322
|
*/
|
|
315
|
-
chat: (modelId: XaiChatModelId) =>
|
|
323
|
+
chat: (modelId: XaiChatModelId) => LanguageModelV4;
|
|
316
324
|
/**
|
|
317
|
-
* Creates an Xai responses model for
|
|
325
|
+
* Creates an Xai responses model for text generation.
|
|
318
326
|
*/
|
|
319
|
-
responses: (modelId: XaiResponsesModelId) =>
|
|
327
|
+
responses: (modelId: XaiResponsesModelId) => LanguageModelV4;
|
|
320
328
|
/**
|
|
321
329
|
* Creates an Xai image model for image generation.
|
|
322
330
|
*/
|
|
323
|
-
image(modelId: XaiImageModelId):
|
|
331
|
+
image(modelId: XaiImageModelId): ImageModelV4;
|
|
324
332
|
/**
|
|
325
333
|
* Creates an Xai image model for image generation.
|
|
326
334
|
*/
|
|
327
|
-
imageModel(modelId: XaiImageModelId):
|
|
335
|
+
imageModel(modelId: XaiImageModelId): ImageModelV4;
|
|
328
336
|
/**
|
|
329
337
|
* Creates an Xai video model for video generation.
|
|
330
338
|
*/
|
|
331
|
-
video(modelId: XaiVideoModelId):
|
|
339
|
+
video(modelId: XaiVideoModelId): Experimental_VideoModelV4;
|
|
332
340
|
/**
|
|
333
341
|
* Creates an Xai video model for video generation.
|
|
334
342
|
*/
|
|
335
|
-
videoModel(modelId: XaiVideoModelId):
|
|
343
|
+
videoModel(modelId: XaiVideoModelId): Experimental_VideoModelV4;
|
|
336
344
|
/**
|
|
337
345
|
* Server-side agentic tools for use with the responses API.
|
|
338
346
|
*/
|