@ai-sdk/xai 4.0.0-beta.7 → 4.0.0-beta.75

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +660 -9
  2. package/README.md +2 -0
  3. package/dist/index.d.ts +213 -68
  4. package/dist/index.js +2074 -781
  5. package/dist/index.js.map +1 -1
  6. package/docs/01-xai.mdx +445 -54
  7. package/package.json +15 -15
  8. package/src/convert-to-xai-chat-messages.ts +48 -27
  9. package/src/convert-xai-chat-usage.ts +3 -3
  10. package/src/files/xai-files-api.ts +16 -0
  11. package/src/files/xai-files-options.ts +19 -0
  12. package/src/files/xai-files.ts +94 -0
  13. package/src/index.ts +9 -4
  14. package/src/map-xai-finish-reason.ts +2 -2
  15. package/src/realtime/index.ts +2 -0
  16. package/src/realtime/xai-realtime-event-mapper.ts +399 -0
  17. package/src/realtime/xai-realtime-model-options.ts +3 -0
  18. package/src/realtime/xai-realtime-model.ts +101 -0
  19. package/src/remove-additional-properties.ts +24 -0
  20. package/src/responses/convert-to-xai-responses-input.ts +100 -23
  21. package/src/responses/convert-xai-responses-usage.ts +3 -3
  22. package/src/responses/map-xai-responses-finish-reason.ts +3 -2
  23. package/src/responses/xai-responses-api.ts +31 -1
  24. package/src/responses/{xai-responses-options.ts → xai-responses-language-model-options.ts} +12 -7
  25. package/src/responses/xai-responses-language-model.ts +157 -60
  26. package/src/responses/xai-responses-prepare-tools.ts +10 -8
  27. package/src/tool/code-execution.ts +2 -2
  28. package/src/tool/file-search.ts +2 -2
  29. package/src/tool/mcp-server.ts +2 -2
  30. package/src/tool/view-image.ts +2 -2
  31. package/src/tool/view-x-video.ts +2 -2
  32. package/src/tool/web-search.ts +4 -2
  33. package/src/tool/x-search.ts +2 -2
  34. package/src/{xai-chat-options.ts → xai-chat-language-model-options.ts} +28 -13
  35. package/src/xai-chat-language-model.ts +65 -29
  36. package/src/xai-chat-prompt.ts +2 -1
  37. package/src/xai-error.ts +13 -3
  38. package/src/xai-image-model.ts +28 -11
  39. package/src/xai-prepare-tools.ts +9 -8
  40. package/src/xai-provider.ts +115 -19
  41. package/src/xai-speech-model-options.ts +55 -0
  42. package/src/xai-speech-model.ts +167 -0
  43. package/src/xai-transcription-model-options.ts +70 -0
  44. package/src/xai-transcription-model.ts +166 -0
  45. package/src/xai-video-model-options.ts +145 -0
  46. package/src/xai-video-model.ts +129 -22
  47. package/dist/index.d.mts +0 -377
  48. package/dist/index.mjs +0 -3070
  49. package/dist/index.mjs.map +0 -1
  50. package/src/xai-video-options.ts +0 -23
  51. /package/src/{xai-image-options.ts → xai-image-model-options.ts} +0 -0
@@ -0,0 +1,55 @@
1
+ import {
2
+ lazySchema,
3
+ zodSchema,
4
+ type InferSchema,
5
+ } from '@ai-sdk/provider-utils';
6
+ import { z } from 'zod/v4';
7
+
8
+ export const xaiSpeechModelOptionsSchema = lazySchema(() =>
9
+ zodSchema(
10
+ z.object({
11
+ /**
12
+ * Sample rate of the generated audio in Hz.
13
+ */
14
+ sampleRate: z
15
+ .union([
16
+ z.literal(8000),
17
+ z.literal(16000),
18
+ z.literal(22050),
19
+ z.literal(24000),
20
+ z.literal(44100),
21
+ z.literal(48000),
22
+ ])
23
+ .nullish(),
24
+
25
+ /**
26
+ * MP3 bit rate in bits per second. Only applies when outputFormat is mp3.
27
+ */
28
+ bitRate: z
29
+ .union([
30
+ z.literal(32000),
31
+ z.literal(64000),
32
+ z.literal(96000),
33
+ z.literal(128000),
34
+ z.literal(192000),
35
+ ])
36
+ .nullish(),
37
+
38
+ /**
39
+ * Reduce time to first audio chunk, trading some quality for latency.
40
+ */
41
+ optimizeStreamingLatency: z
42
+ .union([z.literal(0), z.literal(1), z.literal(2)])
43
+ .nullish(),
44
+
45
+ /**
46
+ * Normalize written-form text into spoken-form text before synthesis.
47
+ */
48
+ textNormalization: z.boolean().nullish(),
49
+ }),
50
+ ),
51
+ );
52
+
53
+ export type XaiSpeechModelOptions = InferSchema<
54
+ typeof xaiSpeechModelOptionsSchema
55
+ >;
@@ -0,0 +1,167 @@
1
+ import type { SharedV4Warning, SpeechModelV4 } from '@ai-sdk/provider';
2
+ import {
3
+ combineHeaders,
4
+ createBinaryResponseHandler,
5
+ parseProviderOptions,
6
+ postJsonToApi,
7
+ resolve,
8
+ serializeModelOptions,
9
+ WORKFLOW_DESERIALIZE,
10
+ WORKFLOW_SERIALIZE,
11
+ type FetchFunction,
12
+ type Resolvable,
13
+ } from '@ai-sdk/provider-utils';
14
+ import { xaiFailedResponseHandler } from './xai-error';
15
+ import { xaiSpeechModelOptionsSchema } from './xai-speech-model-options';
16
+
17
+ interface XaiSpeechModelConfig {
18
+ provider: string;
19
+ baseURL: string | undefined;
20
+ headers?: Resolvable<Record<string, string | undefined>>;
21
+ fetch?: FetchFunction;
22
+ _internal?: {
23
+ currentDate?: () => Date;
24
+ };
25
+ }
26
+
27
+ type XaiSpeechCodec = 'mp3' | 'wav' | 'pcm' | 'mulaw' | 'alaw';
28
+
29
+ export class XaiSpeechModel implements SpeechModelV4 {
30
+ readonly specificationVersion = 'v4';
31
+
32
+ static [WORKFLOW_SERIALIZE](model: XaiSpeechModel) {
33
+ return serializeModelOptions({
34
+ modelId: model.modelId,
35
+ config: model.config,
36
+ });
37
+ }
38
+
39
+ static [WORKFLOW_DESERIALIZE](options: {
40
+ modelId: '';
41
+ config: XaiSpeechModelConfig;
42
+ }) {
43
+ return new XaiSpeechModel(options.modelId, options.config);
44
+ }
45
+
46
+ get provider(): string {
47
+ return this.config.provider;
48
+ }
49
+
50
+ constructor(
51
+ readonly modelId: '',
52
+ private readonly config: XaiSpeechModelConfig,
53
+ ) {}
54
+
55
+ private async getArgs({
56
+ text,
57
+ voice = 'eve',
58
+ outputFormat = 'mp3',
59
+ instructions,
60
+ speed,
61
+ language = 'auto',
62
+ providerOptions,
63
+ }: Parameters<SpeechModelV4['doGenerate']>[0]) {
64
+ const warnings: SharedV4Warning[] = [];
65
+ const xaiOptions = await parseProviderOptions({
66
+ provider: 'xai',
67
+ providerOptions,
68
+ schema: xaiSpeechModelOptionsSchema,
69
+ });
70
+
71
+ let codec: XaiSpeechCodec = 'mp3';
72
+ if (['mp3', 'wav', 'pcm', 'mulaw', 'alaw'].includes(outputFormat)) {
73
+ codec = outputFormat as XaiSpeechCodec;
74
+ } else {
75
+ warnings.push({
76
+ type: 'unsupported',
77
+ feature: 'outputFormat',
78
+ details: `Unsupported output format: ${outputFormat}. Using mp3 instead.`,
79
+ });
80
+ }
81
+
82
+ if (instructions != null) {
83
+ warnings.push({
84
+ type: 'unsupported',
85
+ feature: 'instructions',
86
+ details:
87
+ 'xAI speech models do not support the `instructions` option. ' +
88
+ 'Use xAI speech tags in `text` to control delivery.',
89
+ });
90
+ }
91
+
92
+ const output_format: {
93
+ codec: XaiSpeechCodec;
94
+ sample_rate?: number;
95
+ bit_rate?: number;
96
+ } = {
97
+ codec,
98
+ };
99
+
100
+ if (xaiOptions?.sampleRate != null) {
101
+ output_format.sample_rate = xaiOptions.sampleRate;
102
+ }
103
+
104
+ if (xaiOptions?.bitRate != null) {
105
+ if (codec === 'mp3') {
106
+ output_format.bit_rate = xaiOptions.bitRate;
107
+ } else {
108
+ warnings.push({
109
+ type: 'unsupported',
110
+ feature: 'providerOptions',
111
+ details:
112
+ 'xAI `bitRate` is supported only for mp3 output. It was ignored.',
113
+ });
114
+ }
115
+ }
116
+
117
+ const requestBody = {
118
+ text,
119
+ voice_id: voice,
120
+ language,
121
+ output_format,
122
+ speed,
123
+ optimize_streaming_latency: xaiOptions?.optimizeStreamingLatency,
124
+ text_normalization: xaiOptions?.textNormalization,
125
+ };
126
+
127
+ return { requestBody, warnings };
128
+ }
129
+
130
+ async doGenerate(
131
+ options: Parameters<SpeechModelV4['doGenerate']>[0],
132
+ ): Promise<Awaited<ReturnType<SpeechModelV4['doGenerate']>>> {
133
+ const currentDate = this.config._internal?.currentDate?.() ?? new Date();
134
+ const { requestBody, warnings } = await this.getArgs(options);
135
+
136
+ const {
137
+ value: audio,
138
+ responseHeaders,
139
+ rawValue: rawResponse,
140
+ } = await postJsonToApi({
141
+ url: `${this.config.baseURL}/tts`,
142
+ headers: combineHeaders(
143
+ this.config.headers ? await resolve(this.config.headers) : undefined,
144
+ options.headers,
145
+ ),
146
+ body: requestBody,
147
+ failedResponseHandler: xaiFailedResponseHandler,
148
+ successfulResponseHandler: createBinaryResponseHandler(),
149
+ abortSignal: options.abortSignal,
150
+ fetch: this.config.fetch,
151
+ });
152
+
153
+ return {
154
+ audio,
155
+ warnings,
156
+ request: {
157
+ body: JSON.stringify(requestBody),
158
+ },
159
+ response: {
160
+ timestamp: currentDate,
161
+ modelId: this.modelId,
162
+ headers: responseHeaders,
163
+ body: rawResponse,
164
+ },
165
+ };
166
+ }
167
+ }
@@ -0,0 +1,70 @@
1
+ import {
2
+ lazySchema,
3
+ zodSchema,
4
+ type InferSchema,
5
+ } from '@ai-sdk/provider-utils';
6
+ import { z } from 'zod/v4';
7
+
8
+ export const xaiTranscriptionModelOptionsSchema = lazySchema(() =>
9
+ zodSchema(
10
+ z.object({
11
+ /**
12
+ * Audio encoding for raw, headerless input audio.
13
+ */
14
+ audioFormat: z.enum(['pcm', 'mulaw', 'alaw']).nullish(),
15
+
16
+ /**
17
+ * Sample rate of the input audio in Hz.
18
+ */
19
+ sampleRate: z
20
+ .union([
21
+ z.literal(8000),
22
+ z.literal(16000),
23
+ z.literal(22050),
24
+ z.literal(24000),
25
+ z.literal(44100),
26
+ z.literal(48000),
27
+ ])
28
+ .nullish(),
29
+
30
+ /**
31
+ * Language code used for inverse text normalization.
32
+ */
33
+ language: z.string().nullish(),
34
+
35
+ /**
36
+ * Enable inverse text normalization. Requires `language`.
37
+ */
38
+ format: z.boolean().nullish(),
39
+
40
+ /**
41
+ * Enable per-channel transcription for multichannel audio.
42
+ */
43
+ multichannel: z.boolean().nullish(),
44
+
45
+ /**
46
+ * Number of interleaved audio channels.
47
+ */
48
+ channels: z.number().int().min(2).max(8).nullish(),
49
+
50
+ /**
51
+ * Enable speaker diarization.
52
+ */
53
+ diarize: z.boolean().nullish(),
54
+
55
+ /**
56
+ * Terms to bias transcription toward.
57
+ */
58
+ keyterm: z.union([z.string(), z.array(z.string())]).nullish(),
59
+
60
+ /**
61
+ * Include filler words such as "uh" and "um" in the transcript.
62
+ */
63
+ fillerWords: z.boolean().nullish(),
64
+ }),
65
+ ),
66
+ );
67
+
68
+ export type XaiTranscriptionModelOptions = InferSchema<
69
+ typeof xaiTranscriptionModelOptionsSchema
70
+ >;
@@ -0,0 +1,166 @@
1
+ import type { SharedV4Warning, TranscriptionModelV4 } from '@ai-sdk/provider';
2
+ import {
3
+ combineHeaders,
4
+ convertBase64ToUint8Array,
5
+ createJsonResponseHandler,
6
+ mediaTypeToExtension,
7
+ parseProviderOptions,
8
+ postFormDataToApi,
9
+ serializeModelOptions,
10
+ WORKFLOW_DESERIALIZE,
11
+ WORKFLOW_SERIALIZE,
12
+ type FetchFunction,
13
+ } from '@ai-sdk/provider-utils';
14
+ import { z } from 'zod/v4';
15
+ import { xaiFailedResponseHandler } from './xai-error';
16
+ import { xaiTranscriptionModelOptionsSchema } from './xai-transcription-model-options';
17
+
18
+ interface XaiTranscriptionModelConfig {
19
+ provider: string;
20
+ baseURL: string | undefined;
21
+ headers?: () => Record<string, string | undefined>;
22
+ fetch?: FetchFunction;
23
+ _internal?: {
24
+ currentDate?: () => Date;
25
+ };
26
+ }
27
+
28
+ export class XaiTranscriptionModel implements TranscriptionModelV4 {
29
+ readonly specificationVersion = 'v4';
30
+
31
+ static [WORKFLOW_SERIALIZE](model: XaiTranscriptionModel) {
32
+ return serializeModelOptions({
33
+ modelId: model.modelId,
34
+ config: model.config,
35
+ });
36
+ }
37
+
38
+ static [WORKFLOW_DESERIALIZE](options: {
39
+ modelId: '';
40
+ config: XaiTranscriptionModelConfig;
41
+ }) {
42
+ return new XaiTranscriptionModel(options.modelId, options.config);
43
+ }
44
+
45
+ get provider(): string {
46
+ return this.config.provider;
47
+ }
48
+
49
+ constructor(
50
+ readonly modelId: '',
51
+ private readonly config: XaiTranscriptionModelConfig,
52
+ ) {}
53
+
54
+ private async getArgs({
55
+ audio,
56
+ mediaType,
57
+ providerOptions,
58
+ }: Parameters<TranscriptionModelV4['doGenerate']>[0]) {
59
+ const warnings: SharedV4Warning[] = [];
60
+ const xaiOptions = await parseProviderOptions({
61
+ provider: 'xai',
62
+ providerOptions,
63
+ schema: xaiTranscriptionModelOptionsSchema,
64
+ });
65
+
66
+ const formData = new FormData();
67
+ const transcriptionOptions = {
68
+ audio_format: xaiOptions?.audioFormat,
69
+ sample_rate: xaiOptions?.sampleRate,
70
+ language: xaiOptions?.language,
71
+ format: xaiOptions?.format,
72
+ multichannel: xaiOptions?.multichannel,
73
+ channels: xaiOptions?.channels,
74
+ diarize: xaiOptions?.diarize,
75
+ filler_words: xaiOptions?.fillerWords,
76
+ };
77
+
78
+ for (const [key, value] of Object.entries(transcriptionOptions)) {
79
+ if (value != null) {
80
+ formData.append(key, String(value));
81
+ }
82
+ }
83
+
84
+ if (xaiOptions?.keyterm != null) {
85
+ const keyterms = Array.isArray(xaiOptions.keyterm)
86
+ ? xaiOptions.keyterm
87
+ : [xaiOptions.keyterm];
88
+
89
+ for (const keyterm of keyterms) {
90
+ formData.append('keyterm', keyterm);
91
+ }
92
+ }
93
+
94
+ const blob =
95
+ audio instanceof Uint8Array
96
+ ? new Blob([audio])
97
+ : new Blob([convertBase64ToUint8Array(audio)]);
98
+ const fileExtension = mediaTypeToExtension(mediaType);
99
+
100
+ // xAI requires `file` to be the final multipart field.
101
+ formData.append(
102
+ 'file',
103
+ new File([blob], 'audio', { type: mediaType }),
104
+ `audio.${fileExtension}`,
105
+ );
106
+
107
+ return { formData, warnings };
108
+ }
109
+
110
+ async doGenerate(
111
+ options: Parameters<TranscriptionModelV4['doGenerate']>[0],
112
+ ): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>> {
113
+ const currentDate = this.config._internal?.currentDate?.() ?? new Date();
114
+ const { formData, warnings } = await this.getArgs(options);
115
+
116
+ const {
117
+ value: response,
118
+ responseHeaders,
119
+ rawValue: rawResponse,
120
+ } = await postFormDataToApi({
121
+ url: `${this.config.baseURL ?? 'https://api.x.ai/v1'}/stt`,
122
+ headers: combineHeaders(this.config.headers?.(), options.headers),
123
+ formData,
124
+ failedResponseHandler: xaiFailedResponseHandler,
125
+ successfulResponseHandler: createJsonResponseHandler(
126
+ xaiTranscriptionResponseSchema,
127
+ ),
128
+ abortSignal: options.abortSignal,
129
+ fetch: this.config.fetch,
130
+ });
131
+
132
+ return {
133
+ text: response.text,
134
+ segments:
135
+ response.words?.map(word => ({
136
+ text: word.text,
137
+ startSecond: word.start,
138
+ endSecond: word.end,
139
+ })) ?? [],
140
+ language: response.language || undefined,
141
+ durationInSeconds: response.duration ?? undefined,
142
+ warnings,
143
+ response: {
144
+ timestamp: currentDate,
145
+ modelId: this.modelId,
146
+ headers: responseHeaders,
147
+ body: rawResponse,
148
+ },
149
+ };
150
+ }
151
+ }
152
+
153
+ const xaiTranscriptionResponseSchema = z.object({
154
+ text: z.string(),
155
+ language: z.string().nullish(),
156
+ duration: z.number().nullish(),
157
+ words: z
158
+ .array(
159
+ z.object({
160
+ text: z.string(),
161
+ start: z.number(),
162
+ end: z.number(),
163
+ }),
164
+ )
165
+ .nullish(),
166
+ });
@@ -0,0 +1,145 @@
1
+ import { lazySchema, zodSchema } from '@ai-sdk/provider-utils';
2
+ import { z } from 'zod/v4';
3
+
4
+ const nonEmptyStringSchema = z.string().min(1);
5
+ const resolutionSchema = z.enum(['480p', '720p']);
6
+ const modeSchema = z.enum(['edit-video', 'extend-video', 'reference-to-video']);
7
+
8
+ export type XaiVideoMode = z.infer<typeof modeSchema>;
9
+ type XaiVideoResolution = z.infer<typeof resolutionSchema>;
10
+
11
+ interface XaiVideoSharedOptions {
12
+ pollIntervalMs?: number | null;
13
+ pollTimeoutMs?: number | null;
14
+ resolution?: XaiVideoResolution | null;
15
+ }
16
+
17
+ interface XaiVideoEditModeOptions extends XaiVideoSharedOptions {
18
+ /**
19
+ * Select edit-video mode explicitly for best autocomplete and narrowing.
20
+ */
21
+ mode: 'edit-video';
22
+ /** Source video URL to edit. */
23
+ videoUrl: string;
24
+ }
25
+
26
+ interface XaiVideoExtendModeOptions extends XaiVideoSharedOptions {
27
+ /**
28
+ * Select extend-video mode explicitly for best autocomplete and narrowing.
29
+ */
30
+ mode: 'extend-video';
31
+ /** Source video URL to extend from its last frame. */
32
+ videoUrl: string;
33
+ }
34
+
35
+ interface XaiVideoReferenceToVideoOptions extends XaiVideoSharedOptions {
36
+ /**
37
+ * Select reference-to-video mode explicitly for best autocomplete and narrowing.
38
+ */
39
+ mode: 'reference-to-video';
40
+ /** Reference image URLs (1-7) for R2V generation. */
41
+ referenceImageUrls: string[];
42
+ }
43
+
44
+ interface XaiVideoGenerationOptions extends XaiVideoSharedOptions {
45
+ mode?: undefined;
46
+ videoUrl?: undefined;
47
+ referenceImageUrls?: undefined;
48
+ }
49
+
50
+ interface XaiLegacyEditVideoOptions extends XaiVideoSharedOptions {
51
+ /**
52
+ * Legacy backward-compatible shape: omitting `mode` while providing
53
+ * `videoUrl` behaves like edit-video.
54
+ */
55
+ mode?: undefined;
56
+ videoUrl: string;
57
+ }
58
+
59
+ interface XaiLegacyReferenceToVideoOptions extends XaiVideoSharedOptions {
60
+ /**
61
+ * Legacy backward-compatible shape: omitting `mode` while providing
62
+ * `referenceImageUrls` behaves like reference-to-video.
63
+ */
64
+ mode?: undefined;
65
+ referenceImageUrls: string[];
66
+ }
67
+
68
+ /**
69
+ * Provider options for xAI video generation.
70
+ *
71
+ * Use the `mode` option to select the operation:
72
+ *
73
+ * - `'edit-video'` + `videoUrl` -- video editing (`POST /v1/videos/edits`)
74
+ * - `'extend-video'` + `videoUrl` -- video extension (`POST /v1/videos/extensions`)
75
+ * - `'reference-to-video'` + `referenceImageUrls` -- R2V generation (`POST /v1/videos/generations`)
76
+ * - no `mode` -- standard generation from text prompts or image input
77
+ *
78
+ * Runtime remains backward compatible with legacy auto-detected provider
79
+ * options, but the public TypeScript type is intentionally explicit so editors
80
+ * can suggest valid modes and flag invalid field combinations.
81
+ */
82
+ export type XaiVideoModelOptions =
83
+ | XaiVideoGenerationOptions
84
+ | XaiVideoEditModeOptions
85
+ | XaiVideoExtendModeOptions
86
+ | XaiVideoReferenceToVideoOptions
87
+ | XaiLegacyEditVideoOptions
88
+ | XaiLegacyReferenceToVideoOptions;
89
+
90
+ // ── Runtime schemas ───────────────────────────────────────────────────
91
+ const baseFields = {
92
+ pollIntervalMs: z.number().positive().nullish(),
93
+ pollTimeoutMs: z.number().positive().nullish(),
94
+ resolution: resolutionSchema.nullish(),
95
+ };
96
+
97
+ const editVideoSchema = z.object({
98
+ ...baseFields,
99
+ mode: z.literal('edit-video'),
100
+ videoUrl: nonEmptyStringSchema,
101
+ referenceImageUrls: z.undefined().optional(),
102
+ });
103
+
104
+ const extendVideoSchema = z.object({
105
+ ...baseFields,
106
+ mode: z.literal('extend-video'),
107
+ videoUrl: nonEmptyStringSchema,
108
+ referenceImageUrls: z.undefined().optional(),
109
+ });
110
+
111
+ const referenceToVideoSchema = z.object({
112
+ ...baseFields,
113
+ mode: z.literal('reference-to-video'),
114
+ referenceImageUrls: z.array(nonEmptyStringSchema).min(1).max(7),
115
+ videoUrl: z.undefined().optional(),
116
+ });
117
+
118
+ const autoDetectSchema = z.object({
119
+ ...baseFields,
120
+ mode: z.undefined().optional(),
121
+ videoUrl: nonEmptyStringSchema.optional(),
122
+ referenceImageUrls: z.array(nonEmptyStringSchema).min(1).max(7).optional(),
123
+ });
124
+
125
+ export const xaiVideoModelOptions = z.union([
126
+ editVideoSchema,
127
+ extendVideoSchema,
128
+ referenceToVideoSchema,
129
+ autoDetectSchema,
130
+ ]);
131
+
132
+ const runtimeSchema = z
133
+ .object({
134
+ mode: modeSchema.optional(),
135
+ videoUrl: nonEmptyStringSchema.optional(),
136
+ referenceImageUrls: z.array(nonEmptyStringSchema).min(1).max(7).optional(),
137
+ ...baseFields,
138
+ })
139
+ .passthrough();
140
+
141
+ export type XaiParsedVideoModelOptions = z.infer<typeof runtimeSchema>;
142
+
143
+ export const xaiVideoModelOptionsSchema = lazySchema(() =>
144
+ zodSchema(runtimeSchema),
145
+ );