@ai-sdk/xai 3.0.104 → 3.0.105
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 +6 -0
- package/dist/index.d.mts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +630 -591
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +640 -601
- package/dist/index.mjs.map +1 -1
- package/docs/01-xai.mdx +36 -0
- package/package.json +3 -3
- package/src/convert-to-xai-chat-messages.ts +47 -34
- package/src/index.ts +1 -0
- package/src/responses/convert-to-xai-responses-input.ts +15 -2
- package/src/responses/xai-responses-api.ts +5 -1
- package/src/xai-chat-language-model.ts +1 -1
- package/src/xai-chat-prompt.ts +4 -1
- package/src/xai-file-part-options.ts +21 -0
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -63,6 +63,15 @@ declare const xaiErrorDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
63
63
|
}, z.core.$strip>]>;
|
|
64
64
|
type XaiErrorData = z.infer<typeof xaiErrorDataSchema>;
|
|
65
65
|
|
|
66
|
+
declare const xaiFilePartProviderOptions: z.ZodObject<{
|
|
67
|
+
imageDetail: z.ZodOptional<z.ZodEnum<{
|
|
68
|
+
low: "low";
|
|
69
|
+
high: "high";
|
|
70
|
+
auto: "auto";
|
|
71
|
+
}>>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
type XaiFilePartProviderOptions = z.infer<typeof xaiFilePartProviderOptions>;
|
|
74
|
+
|
|
66
75
|
type XaiResponsesModelId = 'grok-4.3' | 'grok-4.20-0309-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-build-0.1' | (string & {});
|
|
67
76
|
/**
|
|
68
77
|
* @see https://docs.x.ai/docs/api-reference#create-new-response
|
|
@@ -443,4 +452,4 @@ declare const xai: XaiProvider;
|
|
|
443
452
|
|
|
444
453
|
declare const VERSION: string;
|
|
445
454
|
|
|
446
|
-
export { VERSION, type XaiErrorData, type XaiImageModelOptions, type XaiImageModelOptions as XaiImageProviderOptions, type XaiLanguageModelChatOptions, type XaiLanguageModelResponsesOptions, type XaiProvider, type XaiLanguageModelChatOptions as XaiProviderOptions, type XaiProviderSettings, type XaiLanguageModelResponsesOptions as XaiResponsesProviderOptions, type XaiVideoModelId, type XaiVideoModelOptions, type XaiVideoModelOptions as XaiVideoProviderOptions, codeExecution, createXai, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools };
|
|
455
|
+
export { VERSION, type XaiErrorData, type XaiFilePartProviderOptions, type XaiImageModelOptions, type XaiImageModelOptions as XaiImageProviderOptions, type XaiLanguageModelChatOptions, type XaiLanguageModelResponsesOptions, type XaiProvider, type XaiLanguageModelChatOptions as XaiProviderOptions, type XaiProviderSettings, type XaiLanguageModelResponsesOptions as XaiResponsesProviderOptions, type XaiVideoModelId, type XaiVideoModelOptions, type XaiVideoModelOptions as XaiVideoProviderOptions, codeExecution, createXai, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools };
|
package/dist/index.d.ts
CHANGED
|
@@ -63,6 +63,15 @@ declare const xaiErrorDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
63
63
|
}, z.core.$strip>]>;
|
|
64
64
|
type XaiErrorData = z.infer<typeof xaiErrorDataSchema>;
|
|
65
65
|
|
|
66
|
+
declare const xaiFilePartProviderOptions: z.ZodObject<{
|
|
67
|
+
imageDetail: z.ZodOptional<z.ZodEnum<{
|
|
68
|
+
low: "low";
|
|
69
|
+
high: "high";
|
|
70
|
+
auto: "auto";
|
|
71
|
+
}>>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
type XaiFilePartProviderOptions = z.infer<typeof xaiFilePartProviderOptions>;
|
|
74
|
+
|
|
66
75
|
type XaiResponsesModelId = 'grok-4.3' | 'grok-4.20-0309-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-build-0.1' | (string & {});
|
|
67
76
|
/**
|
|
68
77
|
* @see https://docs.x.ai/docs/api-reference#create-new-response
|
|
@@ -443,4 +452,4 @@ declare const xai: XaiProvider;
|
|
|
443
452
|
|
|
444
453
|
declare const VERSION: string;
|
|
445
454
|
|
|
446
|
-
export { VERSION, type XaiErrorData, type XaiImageModelOptions, type XaiImageModelOptions as XaiImageProviderOptions, type XaiLanguageModelChatOptions, type XaiLanguageModelResponsesOptions, type XaiProvider, type XaiLanguageModelChatOptions as XaiProviderOptions, type XaiProviderSettings, type XaiLanguageModelResponsesOptions as XaiResponsesProviderOptions, type XaiVideoModelId, type XaiVideoModelOptions, type XaiVideoModelOptions as XaiVideoProviderOptions, codeExecution, createXai, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools };
|
|
455
|
+
export { VERSION, type XaiErrorData, type XaiFilePartProviderOptions, type XaiImageModelOptions, type XaiImageModelOptions as XaiImageProviderOptions, type XaiLanguageModelChatOptions, type XaiLanguageModelResponsesOptions, type XaiProvider, type XaiLanguageModelChatOptions as XaiProviderOptions, type XaiProviderSettings, type XaiLanguageModelResponsesOptions as XaiResponsesProviderOptions, type XaiVideoModelId, type XaiVideoModelOptions, type XaiVideoModelOptions as XaiVideoProviderOptions, codeExecution, createXai, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools };
|