@ai-sdk/xai 4.0.0-beta.43 → 4.0.0-beta.44
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 +16 -0
- package/dist/index.d.ts +13 -13
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
- package/src/convert-to-xai-chat-messages.ts +1 -1
- package/src/tool/code-execution.ts +2 -2
- package/src/tool/file-search.ts +2 -2
- package/src/tool/mcp-server.ts +2 -2
- package/src/tool/view-image.ts +2 -2
- package/src/tool/view-x-video.ts +2 -2
- package/src/tool/web-search.ts +2 -2
- package/src/tool/x-search.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/xai",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.44",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@ai-sdk/openai-compatible": "3.0.0-beta.
|
|
32
|
+
"@ai-sdk/openai-compatible": "3.0.0-beta.32",
|
|
33
33
|
"@ai-sdk/provider": "4.0.0-beta.12",
|
|
34
|
-
"@ai-sdk/provider-utils": "5.0.0-beta.
|
|
34
|
+
"@ai-sdk/provider-utils": "5.0.0-beta.27"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "20.17.24",
|
|
38
38
|
"tsup": "^8",
|
|
39
39
|
"typescript": "5.8.3",
|
|
40
40
|
"zod": "3.25.76",
|
|
41
|
-
"@ai-
|
|
42
|
-
"@
|
|
41
|
+
"@vercel/ai-tsconfig": "0.0.0",
|
|
42
|
+
"@ai-sdk/test-server": "2.0.0-beta.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"zod": "^3.25.76 || ^4.1.8"
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"node": ">=18"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
|
-
"access": "public"
|
|
51
|
+
"access": "public",
|
|
52
|
+
"provenance": true
|
|
52
53
|
},
|
|
53
54
|
"homepage": "https://ai-sdk.dev/docs",
|
|
54
55
|
"repository": {
|
|
@@ -129,7 +129,7 @@ export function convertToXaiChatMessages(prompt: LanguageModelV4Prompt): {
|
|
|
129
129
|
contentValue = output.value;
|
|
130
130
|
break;
|
|
131
131
|
case 'execution-denied':
|
|
132
|
-
contentValue = output.reason ?? 'Tool execution denied.';
|
|
132
|
+
contentValue = output.reason ?? 'Tool call execution denied.';
|
|
133
133
|
break;
|
|
134
134
|
case 'content':
|
|
135
135
|
case 'json':
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createProviderExecutedToolFactory } from '@ai-sdk/provider-utils';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
|
|
4
4
|
const codeExecutionOutputSchema = z.object({
|
|
@@ -6,7 +6,7 @@ const codeExecutionOutputSchema = z.object({
|
|
|
6
6
|
error: z.string().optional().describe('any error that occurred'),
|
|
7
7
|
});
|
|
8
8
|
|
|
9
|
-
const codeExecutionToolFactory =
|
|
9
|
+
const codeExecutionToolFactory = createProviderExecutedToolFactory({
|
|
10
10
|
id: 'xai.code_execution',
|
|
11
11
|
inputSchema: z.object({}).describe('no input parameters'),
|
|
12
12
|
outputSchema: codeExecutionOutputSchema,
|
package/src/tool/file-search.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
createProviderExecutedToolFactory,
|
|
3
3
|
lazySchema,
|
|
4
4
|
zodSchema,
|
|
5
5
|
} from '@ai-sdk/provider-utils';
|
|
@@ -36,7 +36,7 @@ const fileSearchOutputSchema = lazySchema(() =>
|
|
|
36
36
|
),
|
|
37
37
|
);
|
|
38
38
|
|
|
39
|
-
const fileSearchToolFactory =
|
|
39
|
+
const fileSearchToolFactory = createProviderExecutedToolFactory<
|
|
40
40
|
{},
|
|
41
41
|
{
|
|
42
42
|
/**
|
package/src/tool/mcp-server.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
createProviderExecutedToolFactory,
|
|
3
3
|
lazySchema,
|
|
4
4
|
zodSchema,
|
|
5
5
|
} from '@ai-sdk/provider-utils';
|
|
@@ -41,7 +41,7 @@ const mcpServerOutputSchema = lazySchema(() =>
|
|
|
41
41
|
),
|
|
42
42
|
);
|
|
43
43
|
|
|
44
|
-
const mcpServerToolFactory =
|
|
44
|
+
const mcpServerToolFactory = createProviderExecutedToolFactory<
|
|
45
45
|
{},
|
|
46
46
|
{
|
|
47
47
|
name: string;
|
package/src/tool/view-image.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createProviderExecutedToolFactory } from '@ai-sdk/provider-utils';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
|
|
4
4
|
const viewImageOutputSchema = z.object({
|
|
@@ -9,7 +9,7 @@ const viewImageOutputSchema = z.object({
|
|
|
9
9
|
.describe('objects detected in the image'),
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
const viewImageToolFactory =
|
|
12
|
+
const viewImageToolFactory = createProviderExecutedToolFactory({
|
|
13
13
|
id: 'xai.view_image',
|
|
14
14
|
inputSchema: z.object({}).describe('no input parameters'),
|
|
15
15
|
outputSchema: viewImageOutputSchema,
|
package/src/tool/view-x-video.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createProviderExecutedToolFactory } from '@ai-sdk/provider-utils';
|
|
2
2
|
import { z } from 'zod/v4';
|
|
3
3
|
|
|
4
4
|
const viewXVideoOutputSchema = z.object({
|
|
@@ -7,7 +7,7 @@ const viewXVideoOutputSchema = z.object({
|
|
|
7
7
|
duration: z.number().optional().describe('duration in seconds'),
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
const viewXVideoToolFactory =
|
|
10
|
+
const viewXVideoToolFactory = createProviderExecutedToolFactory({
|
|
11
11
|
id: 'xai.view_x_video',
|
|
12
12
|
inputSchema: z.object({}).describe('no input parameters'),
|
|
13
13
|
outputSchema: viewXVideoOutputSchema,
|
package/src/tool/web-search.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
createProviderExecutedToolFactory,
|
|
3
3
|
lazySchema,
|
|
4
4
|
zodSchema,
|
|
5
5
|
} from '@ai-sdk/provider-utils';
|
|
@@ -30,7 +30,7 @@ const webSearchOutputSchema = lazySchema(() =>
|
|
|
30
30
|
),
|
|
31
31
|
);
|
|
32
32
|
|
|
33
|
-
const webSearchToolFactory =
|
|
33
|
+
const webSearchToolFactory = createProviderExecutedToolFactory<
|
|
34
34
|
{},
|
|
35
35
|
{
|
|
36
36
|
query: string;
|
package/src/tool/x-search.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
createProviderExecutedToolFactory,
|
|
3
3
|
lazySchema,
|
|
4
4
|
zodSchema,
|
|
5
5
|
} from '@ai-sdk/provider-utils';
|
|
@@ -34,7 +34,7 @@ const xSearchOutputSchema = lazySchema(() =>
|
|
|
34
34
|
),
|
|
35
35
|
);
|
|
36
36
|
|
|
37
|
-
const xSearchToolFactory =
|
|
37
|
+
const xSearchToolFactory = createProviderExecutedToolFactory<
|
|
38
38
|
{},
|
|
39
39
|
{
|
|
40
40
|
query: string;
|