@ai-sdk/xai 4.0.8 → 4.0.10
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 +20 -0
- package/dist/index.d.ts +12 -3
- package/dist/index.js +760 -694
- package/dist/index.js.map +1 -1
- package/docs/01-xai.mdx +63 -40
- package/package.json +4 -4
- 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-options.ts +1 -0
- package/src/xai-chat-language-model-options.ts +1 -0
- 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/src/xai-video-model.ts +51 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @ai-sdk/xai
|
|
2
2
|
|
|
3
|
+
## 4.0.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0f93c57: feat (video): support video (not just image) reference inputs in `inputReferences` for reference-to-video generation
|
|
8
|
+
- d25a084: feat (provider/xai): add grok-4.5 model id
|
|
9
|
+
- Updated dependencies [0f93c57]
|
|
10
|
+
- @ai-sdk/provider@4.0.3
|
|
11
|
+
- @ai-sdk/openai-compatible@3.0.7
|
|
12
|
+
- @ai-sdk/provider-utils@5.0.7
|
|
13
|
+
|
|
14
|
+
## 4.0.9
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 72eee24: feat: support `imageDetail` provider option on image file parts to control image processing resolution
|
|
19
|
+
- Updated dependencies [ac306ed]
|
|
20
|
+
- @ai-sdk/provider-utils@5.0.6
|
|
21
|
+
- @ai-sdk/openai-compatible@3.0.6
|
|
22
|
+
|
|
3
23
|
## 4.0.8
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
|
3
3
|
import { InferSchema, FetchFunction, WebSocketConstructor } from '@ai-sdk/provider-utils';
|
|
4
4
|
import { ProviderV4, LanguageModelV4, ImageModelV4, Experimental_VideoModelV4, Experimental_RealtimeFactoryV4, SpeechModelV4, TranscriptionModelV4, FilesV4, Experimental_RealtimeModelV4, Experimental_RealtimeModelV4ClientSecretOptions, Experimental_RealtimeModelV4ClientSecretResult, Experimental_RealtimeModelV4ServerEvent, Experimental_RealtimeModelV4ClientEvent, Experimental_RealtimeModelV4SessionConfig } from '@ai-sdk/provider';
|
|
5
5
|
|
|
6
|
-
type XaiChatModelId = 'grok-4.20-non-reasoning' | 'grok-4.20-reasoning' | 'grok-4.3' | 'grok-latest' | (string & {});
|
|
6
|
+
type XaiChatModelId = 'grok-4.20-non-reasoning' | 'grok-4.20-reasoning' | 'grok-4.3' | 'grok-4.5' | 'grok-latest' | (string & {});
|
|
7
7
|
declare const xaiLanguageModelChatOptions: z.ZodObject<{
|
|
8
8
|
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
9
9
|
none: "none";
|
|
@@ -63,7 +63,16 @@ declare const xaiErrorDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
63
63
|
}, z.core.$strip>]>;
|
|
64
64
|
type XaiErrorData = z.infer<typeof xaiErrorDataSchema>;
|
|
65
65
|
|
|
66
|
-
|
|
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
|
+
|
|
75
|
+
type XaiResponsesModelId = 'grok-4.20-non-reasoning' | 'grok-4.20-reasoning' | 'grok-4.3' | 'grok-4.5' | 'grok-latest' | (string & {});
|
|
67
76
|
/**
|
|
68
77
|
* @see https://docs.x.ai/docs/api-reference#create-new-response
|
|
69
78
|
*/
|
|
@@ -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 };
|