@ai-sdk/xai 4.0.7 → 4.0.9
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 +10 -1
- package/dist/index.js +786 -713
- package/dist/index.js.map +1 -1
- package/docs/01-xai.mdx +36 -0
- package/package.json +5 -5
- package/src/convert-to-xai-chat-messages.ts +61 -43
- package/src/index.ts +1 -0
- package/src/responses/convert-to-xai-responses-input.ts +11 -0
- package/src/responses/xai-responses-api.ts +5 -1
- package/src/responses/xai-responses-language-model.ts +25 -17
- package/src/supports-reasoning-effort.ts +12 -0
- package/src/xai-chat-language-model.ts +28 -18
- package/src/xai-chat-prompt.ts +4 -1
- package/src/xai-file-part-options.ts +21 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @ai-sdk/xai
|
|
2
2
|
|
|
3
|
+
## 4.0.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 72eee24: feat: support `imageDetail` provider option on image file parts to control image processing resolution
|
|
8
|
+
- Updated dependencies [ac306ed]
|
|
9
|
+
- @ai-sdk/provider-utils@5.0.6
|
|
10
|
+
- @ai-sdk/openai-compatible@3.0.6
|
|
11
|
+
|
|
12
|
+
## 4.0.8
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 8e006de: fix: send reasoning effort `none` to the xAI API when the top-level `reasoning: 'none'` option is set
|
|
17
|
+
- 8e006de: fix: omit the reasoning effort parameter and emit an unsupported warning when the top-level `reasoning` option is used with xAI models that reject it (`grok-4.20-reasoning`, `grok-4.20-non-reasoning`, and dated variants)
|
|
18
|
+
|
|
3
19
|
## 4.0.7
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
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.20-non-reasoning' | 'grok-4.20-reasoning' | 'grok-4.3' | 'grok-latest' | (string & {});
|
|
67
76
|
/**
|
|
68
77
|
* @see https://docs.x.ai/docs/api-reference#create-new-response
|
|
@@ -530,4 +539,4 @@ declare class XaiRealtimeModel implements Experimental_RealtimeModelV4 {
|
|
|
530
539
|
|
|
531
540
|
declare const VERSION: string;
|
|
532
541
|
|
|
533
|
-
export { XaiRealtimeModel as Experimental_XaiRealtimeModel, type XaiRealtimeModelConfig as Experimental_XaiRealtimeModelConfig, VERSION, type XaiErrorData, type XaiFilesOptions, type XaiImageModelOptions, type XaiImageModelOptions as XaiImageProviderOptions, type XaiLanguageModelChatOptions, type XaiLanguageModelResponsesOptions, type XaiProvider, type XaiLanguageModelChatOptions as XaiProviderOptions, type XaiProviderSettings, type XaiLanguageModelResponsesOptions as XaiResponsesProviderOptions, type XaiSpeechModelOptions, type XaiTranscriptionModelOptions, type XaiVideoModelId, type XaiVideoModelOptions, type XaiVideoModelOptions as XaiVideoProviderOptions, codeExecution, createXai, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools };
|
|
542
|
+
export { XaiRealtimeModel as Experimental_XaiRealtimeModel, type XaiRealtimeModelConfig as Experimental_XaiRealtimeModelConfig, VERSION, type XaiErrorData, type XaiFilePartProviderOptions, type XaiFilesOptions, type XaiImageModelOptions, type XaiImageModelOptions as XaiImageProviderOptions, type XaiLanguageModelChatOptions, type XaiLanguageModelResponsesOptions, type XaiProvider, type XaiLanguageModelChatOptions as XaiProviderOptions, type XaiProviderSettings, type XaiLanguageModelResponsesOptions as XaiResponsesProviderOptions, type XaiSpeechModelOptions, type XaiTranscriptionModelOptions, type XaiVideoModelId, type XaiVideoModelOptions, type XaiVideoModelOptions as XaiVideoProviderOptions, codeExecution, createXai, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools };
|