@ai-sdk/xai 4.0.59 → 5.0.1

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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @ai-sdk/xai
2
2
 
3
+ ## 5.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [91c2128]
8
+ - Updated dependencies [2cd80b3]
9
+ - Updated dependencies [d06bb2a]
10
+ - Updated dependencies [123d71f]
11
+ - Updated dependencies [2fa5e0e]
12
+ - @ai-sdk/provider-utils@5.0.42
13
+ - @ai-sdk/provider@4.0.16
14
+
15
+ ## 5.0.0
16
+
17
+ ### Major Changes
18
+
19
+ - 1f20dba: feat(xai)!: remove Chat Completions API
20
+
3
21
  ## 4.0.59
4
22
 
5
23
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -3,58 +3,6 @@ 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, Experimental_BatchV4, 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-4.5' | 'grok-4.6' | 'grok-latest' | (string & {});
7
- declare const xaiLanguageModelChatOptions: z.ZodObject<{
8
- reasoningEffort: z.ZodOptional<z.ZodEnum<{
9
- none: "none";
10
- low: "low";
11
- medium: "medium";
12
- high: "high";
13
- xhigh: "xhigh";
14
- }>>;
15
- logprobs: z.ZodOptional<z.ZodBoolean>;
16
- topLogprobs: z.ZodOptional<z.ZodNumber>;
17
- serviceTier: z.ZodOptional<z.ZodEnum<{
18
- default: "default";
19
- priority: "priority";
20
- }>>;
21
- parallel_function_calling: z.ZodOptional<z.ZodBoolean>;
22
- searchParameters: z.ZodOptional<z.ZodObject<{
23
- mode: z.ZodEnum<{
24
- off: "off";
25
- auto: "auto";
26
- on: "on";
27
- }>;
28
- returnCitations: z.ZodOptional<z.ZodBoolean>;
29
- fromDate: z.ZodOptional<z.ZodString>;
30
- toDate: z.ZodOptional<z.ZodString>;
31
- maxSearchResults: z.ZodOptional<z.ZodNumber>;
32
- sources: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
33
- type: z.ZodLiteral<"web">;
34
- country: z.ZodOptional<z.ZodString>;
35
- excludedWebsites: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
- allowedWebsites: z.ZodOptional<z.ZodArray<z.ZodString>>;
37
- safeSearch: z.ZodOptional<z.ZodBoolean>;
38
- }, z.core.$strip>, z.ZodObject<{
39
- type: z.ZodLiteral<"x">;
40
- excludedXHandles: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
- includedXHandles: z.ZodOptional<z.ZodArray<z.ZodString>>;
42
- postFavoriteCount: z.ZodOptional<z.ZodNumber>;
43
- postViewCount: z.ZodOptional<z.ZodNumber>;
44
- xHandles: z.ZodOptional<z.ZodArray<z.ZodString>>;
45
- }, z.core.$strip>, z.ZodObject<{
46
- type: z.ZodLiteral<"news">;
47
- country: z.ZodOptional<z.ZodString>;
48
- excludedWebsites: z.ZodOptional<z.ZodArray<z.ZodString>>;
49
- safeSearch: z.ZodOptional<z.ZodBoolean>;
50
- }, z.core.$strip>, z.ZodObject<{
51
- type: z.ZodLiteral<"rss">;
52
- links: z.ZodArray<z.ZodString>;
53
- }, z.core.$strip>]>>>;
54
- }, z.core.$strip>>;
55
- }, z.core.$strip>;
56
- type XaiLanguageModelChatOptions = z.infer<typeof xaiLanguageModelChatOptions>;
57
-
58
6
  declare const xaiErrorDataSchema: z.ZodUnion<readonly [z.ZodObject<{
59
7
  error: z.ZodObject<{
60
8
  message: z.ZodString;
@@ -85,10 +33,10 @@ type XaiResponsesModelId = 'grok-4.20-non-reasoning' | 'grok-4.20-reasoning' | '
85
33
  */
86
34
  declare const xaiLanguageModelResponsesOptions: z.ZodObject<{
87
35
  reasoningEffort: z.ZodOptional<z.ZodEnum<{
88
- none: "none";
89
36
  low: "low";
90
- medium: "medium";
91
37
  high: "high";
38
+ none: "none";
39
+ medium: "medium";
92
40
  xhigh: "xhigh";
93
41
  }>>;
94
42
  reasoningSummary: z.ZodOptional<z.ZodEnum<{
@@ -120,8 +68,8 @@ declare const xaiImageModelOptions: z.ZodObject<{
120
68
  }>>;
121
69
  quality: z.ZodOptional<z.ZodEnum<{
122
70
  low: "low";
123
- medium: "medium";
124
71
  high: "high";
72
+ medium: "medium";
125
73
  }>>;
126
74
  user: z.ZodOptional<z.ZodString>;
127
75
  }, z.core.$strip>;
@@ -218,7 +166,7 @@ type XaiVideoModelOptions = XaiVideoGenerationOptions | XaiVideoEditModeOptions
218
166
  declare const xaiSpeechModelOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
219
167
  sampleRate?: 8000 | 16000 | 22050 | 24000 | 44100 | 48000 | null | undefined;
220
168
  bitRate?: 32000 | 64000 | 96000 | 128000 | 192000 | null | undefined;
221
- optimizeStreamingLatency?: 0 | 1 | 2 | null | undefined;
169
+ optimizeStreamingLatency?: 0 | 2 | 1 | null | undefined;
222
170
  textNormalization?: boolean | null | undefined;
223
171
  withTimestamps?: boolean | null | undefined;
224
172
  replace?: Record<string, string> | null | undefined;
@@ -540,10 +488,6 @@ interface XaiProvider extends ProviderV4 {
540
488
  * Creates an Xai language model for text generation.
541
489
  */
542
490
  languageModel(modelId: XaiResponsesModelId): LanguageModelV4;
543
- /**
544
- * Creates an Xai chat model for text generation.
545
- */
546
- chat: (modelId: XaiChatModelId) => LanguageModelV4;
547
491
  /**
548
492
  * Creates an Xai responses model for text generation.
549
493
  */
@@ -655,4 +599,4 @@ declare class XaiRealtimeModel implements Experimental_RealtimeModelV4 {
655
599
 
656
600
  declare const VERSION: string;
657
601
 
658
- 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, imageGeneration, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools };
602
+ export { XaiRealtimeModel as Experimental_XaiRealtimeModel, type XaiRealtimeModelConfig as Experimental_XaiRealtimeModelConfig, VERSION, type XaiErrorData, type XaiFilePartProviderOptions, type XaiFilesOptions, type XaiImageModelOptions, type XaiImageModelOptions as XaiImageProviderOptions, type XaiLanguageModelResponsesOptions, type XaiProvider, type XaiProviderSettings, type XaiLanguageModelResponsesOptions as XaiResponsesProviderOptions, type XaiSpeechModelOptions, type XaiTranscriptionModelOptions, type XaiVideoModelId, type XaiVideoModelOptions, type XaiVideoModelOptions as XaiVideoProviderOptions, codeExecution, createXai, imageGeneration, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools };