@ai-sdk/xai
Advanced tools
+8
-0
| # @ai-sdk/xai | ||
| ## 3.0.53 | ||
| ### Patch Changes | ||
| - 99fbed8: feat: normalize provider specific model options type names and ensure they are exported | ||
| - Updated dependencies [99fbed8] | ||
| - @ai-sdk/openai-compatible@2.0.29 | ||
| ## 3.0.52 | ||
@@ -4,0 +12,0 @@ |
+12
-12
@@ -7,3 +7,3 @@ import { z } from 'zod/v4'; | ||
| type XaiChatModelId = 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-code-fast-1' | 'grok-4' | 'grok-4-0709' | 'grok-4-latest' | 'grok-3' | 'grok-3-latest' | 'grok-3-fast' | 'grok-3-fast-latest' | 'grok-3-mini' | 'grok-3-mini-latest' | 'grok-3-mini-fast' | 'grok-3-mini-fast-latest' | 'grok-2-vision-1212' | 'grok-2-vision' | 'grok-2-vision-latest' | 'grok-2-image-1212' | 'grok-2-image' | 'grok-2-image-latest' | 'grok-2-1212' | 'grok-2' | 'grok-2-latest' | 'grok-vision-beta' | 'grok-beta' | (string & {}); | ||
| declare const xaiProviderOptions: z.ZodObject<{ | ||
| declare const xaiLanguageModelChatOptions: z.ZodObject<{ | ||
| reasoningEffort: z.ZodOptional<z.ZodEnum<{ | ||
@@ -48,3 +48,3 @@ low: "low"; | ||
| }, z.core.$strip>; | ||
| type XaiProviderOptions = z.infer<typeof xaiProviderOptions>; | ||
| type XaiLanguageModelChatOptions = z.infer<typeof xaiLanguageModelChatOptions>; | ||
@@ -61,9 +61,2 @@ declare const xaiErrorDataSchema: z.ZodObject<{ | ||
| declare const xaiImageProviderOptions: z.ZodObject<{ | ||
| aspect_ratio: z.ZodOptional<z.ZodString>; | ||
| output_format: z.ZodOptional<z.ZodString>; | ||
| sync_mode: z.ZodOptional<z.ZodBoolean>; | ||
| }, z.core.$strip>; | ||
| type XaiImageProviderOptions = z.infer<typeof xaiImageProviderOptions>; | ||
| type XaiResponsesModelId = 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4' | 'grok-4-fast' | 'grok-4-fast-non-reasoning' | (string & {}); | ||
@@ -73,3 +66,3 @@ /** | ||
| */ | ||
| declare const xaiResponsesProviderOptions: z.ZodObject<{ | ||
| declare const xaiLanguageModelResponsesOptions: z.ZodObject<{ | ||
| reasoningEffort: z.ZodOptional<z.ZodEnum<{ | ||
@@ -86,4 +79,11 @@ low: "low"; | ||
| }, z.core.$strip>; | ||
| type XaiResponsesProviderOptions = z.infer<typeof xaiResponsesProviderOptions>; | ||
| type XaiLanguageModelResponsesOptions = z.infer<typeof xaiLanguageModelResponsesOptions>; | ||
| declare const xaiImageModelOptions: z.ZodObject<{ | ||
| aspect_ratio: z.ZodOptional<z.ZodString>; | ||
| output_format: z.ZodOptional<z.ZodString>; | ||
| sync_mode: z.ZodOptional<z.ZodBoolean>; | ||
| }, z.core.$strip>; | ||
| type XaiImageModelOptions = z.infer<typeof xaiImageModelOptions>; | ||
| type XaiImageModelId = 'grok-2-image' | 'grok-imagine-image' | (string & {}); | ||
@@ -348,2 +348,2 @@ | ||
| export { VERSION, type XaiErrorData, type XaiImageProviderOptions, type XaiProvider, type XaiProviderOptions, type XaiProviderSettings, type XaiResponsesProviderOptions, codeExecution, createXai, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools }; | ||
| 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, codeExecution, createXai, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools }; |
+12
-12
@@ -7,3 +7,3 @@ import { z } from 'zod/v4'; | ||
| type XaiChatModelId = 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-code-fast-1' | 'grok-4' | 'grok-4-0709' | 'grok-4-latest' | 'grok-3' | 'grok-3-latest' | 'grok-3-fast' | 'grok-3-fast-latest' | 'grok-3-mini' | 'grok-3-mini-latest' | 'grok-3-mini-fast' | 'grok-3-mini-fast-latest' | 'grok-2-vision-1212' | 'grok-2-vision' | 'grok-2-vision-latest' | 'grok-2-image-1212' | 'grok-2-image' | 'grok-2-image-latest' | 'grok-2-1212' | 'grok-2' | 'grok-2-latest' | 'grok-vision-beta' | 'grok-beta' | (string & {}); | ||
| declare const xaiProviderOptions: z.ZodObject<{ | ||
| declare const xaiLanguageModelChatOptions: z.ZodObject<{ | ||
| reasoningEffort: z.ZodOptional<z.ZodEnum<{ | ||
@@ -48,3 +48,3 @@ low: "low"; | ||
| }, z.core.$strip>; | ||
| type XaiProviderOptions = z.infer<typeof xaiProviderOptions>; | ||
| type XaiLanguageModelChatOptions = z.infer<typeof xaiLanguageModelChatOptions>; | ||
@@ -61,9 +61,2 @@ declare const xaiErrorDataSchema: z.ZodObject<{ | ||
| declare const xaiImageProviderOptions: z.ZodObject<{ | ||
| aspect_ratio: z.ZodOptional<z.ZodString>; | ||
| output_format: z.ZodOptional<z.ZodString>; | ||
| sync_mode: z.ZodOptional<z.ZodBoolean>; | ||
| }, z.core.$strip>; | ||
| type XaiImageProviderOptions = z.infer<typeof xaiImageProviderOptions>; | ||
| type XaiResponsesModelId = 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4' | 'grok-4-fast' | 'grok-4-fast-non-reasoning' | (string & {}); | ||
@@ -73,3 +66,3 @@ /** | ||
| */ | ||
| declare const xaiResponsesProviderOptions: z.ZodObject<{ | ||
| declare const xaiLanguageModelResponsesOptions: z.ZodObject<{ | ||
| reasoningEffort: z.ZodOptional<z.ZodEnum<{ | ||
@@ -86,4 +79,11 @@ low: "low"; | ||
| }, z.core.$strip>; | ||
| type XaiResponsesProviderOptions = z.infer<typeof xaiResponsesProviderOptions>; | ||
| type XaiLanguageModelResponsesOptions = z.infer<typeof xaiLanguageModelResponsesOptions>; | ||
| declare const xaiImageModelOptions: z.ZodObject<{ | ||
| aspect_ratio: z.ZodOptional<z.ZodString>; | ||
| output_format: z.ZodOptional<z.ZodString>; | ||
| sync_mode: z.ZodOptional<z.ZodBoolean>; | ||
| }, z.core.$strip>; | ||
| type XaiImageModelOptions = z.infer<typeof xaiImageModelOptions>; | ||
| type XaiImageModelId = 'grok-2-image' | 'grok-imagine-image' | (string & {}); | ||
@@ -348,2 +348,2 @@ | ||
| export { VERSION, type XaiErrorData, type XaiImageProviderOptions, type XaiProvider, type XaiProviderOptions, type XaiProviderSettings, type XaiResponsesProviderOptions, codeExecution, createXai, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools }; | ||
| 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, codeExecution, createXai, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools }; |
+3
-3
| { | ||
| "name": "@ai-sdk/xai", | ||
| "version": "3.0.52", | ||
| "version": "3.0.53", | ||
| "license": "Apache-2.0", | ||
@@ -32,5 +32,5 @@ "sideEffects": false, | ||
| "dependencies": { | ||
| "@ai-sdk/openai-compatible": "2.0.28", | ||
| "@ai-sdk/provider": "3.0.8", | ||
| "@ai-sdk/provider-utils": "4.0.14" | ||
| "@ai-sdk/provider-utils": "4.0.14", | ||
| "@ai-sdk/openai-compatible": "2.0.29" | ||
| }, | ||
@@ -37,0 +37,0 @@ "devDependencies": { |
+15
-3
@@ -1,5 +0,17 @@ | ||
| export type { XaiProviderOptions } from './xai-chat-options'; | ||
| export type { | ||
| XaiLanguageModelChatOptions, | ||
| /** @deprecated Use `XaiLanguageModelChatOptions` instead. */ | ||
| XaiLanguageModelChatOptions as XaiProviderOptions, | ||
| } from './xai-chat-options'; | ||
| export type { XaiErrorData } from './xai-error'; | ||
| export type { XaiImageProviderOptions } from './xai-image-options'; | ||
| export type { XaiResponsesProviderOptions } from './responses/xai-responses-options'; | ||
| export type { | ||
| XaiLanguageModelResponsesOptions, | ||
| /** @deprecated Use `XaiLanguageModelResponsesOptions` instead. */ | ||
| XaiLanguageModelResponsesOptions as XaiResponsesProviderOptions, | ||
| } from './responses/xai-responses-options'; | ||
| export type { | ||
| XaiImageModelOptions, | ||
| /** @deprecated Use `XaiImageModelOptions` instead. */ | ||
| XaiImageModelOptions as XaiImageProviderOptions, | ||
| } from './xai-image-options'; | ||
| export { createXai, xai } from './xai-provider'; | ||
@@ -6,0 +18,0 @@ export type { XaiProvider, XaiProviderSettings } from './xai-provider'; |
@@ -34,3 +34,3 @@ import { | ||
| XaiResponsesModelId, | ||
| xaiResponsesProviderOptions, | ||
| xaiLanguageModelResponsesOptions, | ||
| } from './xai-responses-options'; | ||
@@ -85,3 +85,3 @@ import { prepareResponsesTools } from './xai-responses-prepare-tools'; | ||
| providerOptions, | ||
| schema: xaiResponsesProviderOptions, | ||
| schema: xaiLanguageModelResponsesOptions, | ||
| })) ?? {}; | ||
@@ -88,0 +88,0 @@ |
@@ -14,3 +14,3 @@ import { z } from 'zod/v4'; | ||
| */ | ||
| export const xaiResponsesProviderOptions = z.object({ | ||
| export const xaiLanguageModelResponsesOptions = z.object({ | ||
| /** | ||
@@ -37,4 +37,4 @@ * Constrains how hard a reasoning model thinks before responding. | ||
| export type XaiResponsesProviderOptions = z.infer< | ||
| typeof xaiResponsesProviderOptions | ||
| export type XaiLanguageModelResponsesOptions = z.infer< | ||
| typeof xaiLanguageModelResponsesOptions | ||
| >; |
@@ -29,3 +29,6 @@ import { | ||
| import { mapXaiFinishReason } from './map-xai-finish-reason'; | ||
| import { XaiChatModelId, xaiProviderOptions } from './xai-chat-options'; | ||
| import { | ||
| XaiChatModelId, | ||
| xaiLanguageModelChatOptions, | ||
| } from './xai-chat-options'; | ||
| import { xaiFailedResponseHandler } from './xai-error'; | ||
@@ -84,3 +87,3 @@ import { prepareTools } from './xai-prepare-tools'; | ||
| providerOptions, | ||
| schema: xaiProviderOptions, | ||
| schema: xaiLanguageModelChatOptions, | ||
| })) ?? {}; | ||
@@ -87,0 +90,0 @@ |
@@ -75,3 +75,3 @@ import { z } from 'zod/v4'; | ||
| // xai-specific provider options | ||
| export const xaiProviderOptions = z.object({ | ||
| export const xaiLanguageModelChatOptions = z.object({ | ||
| reasoningEffort: z.enum(['low', 'high']).optional(), | ||
@@ -131,2 +131,4 @@ | ||
| export type XaiProviderOptions = z.infer<typeof xaiProviderOptions>; | ||
| export type XaiLanguageModelChatOptions = z.infer< | ||
| typeof xaiLanguageModelChatOptions | ||
| >; |
@@ -15,3 +15,3 @@ import { ImageModelV3, SharedV3Warning } from '@ai-sdk/provider'; | ||
| import { xaiFailedResponseHandler } from './xai-error'; | ||
| import { xaiImageProviderOptions } from './xai-image-options'; | ||
| import { xaiImageModelOptions } from './xai-image-options'; | ||
| import { XaiImageModelId } from './xai-image-settings'; | ||
@@ -84,3 +84,3 @@ | ||
| providerOptions, | ||
| schema: xaiImageProviderOptions, | ||
| schema: xaiImageModelOptions, | ||
| }); | ||
@@ -87,0 +87,0 @@ |
| import { z } from 'zod/v4'; | ||
| export const xaiImageProviderOptions = z.object({ | ||
| export const xaiImageModelOptions = z.object({ | ||
| aspect_ratio: z.string().optional(), | ||
@@ -9,2 +9,2 @@ output_format: z.string().optional(), | ||
| export type XaiImageProviderOptions = z.infer<typeof xaiImageProviderOptions>; | ||
| export type XaiImageModelOptions = z.infer<typeof xaiImageModelOptions>; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
722621
0.38%9245
0.2%+ Added
- Removed