@ai-sdk/xai
Advanced tools
+6
-0
| # @ai-sdk/xai | ||
| ## 3.0.97 | ||
| ### Patch Changes | ||
| - 9300b02: xai: support 'none' and 'medium' reasoning effort and curate model ids to xai's current lineup (add grok-4.3, grok-build-0.1, grok-imagine-image-quality) | ||
| ## 3.0.96 | ||
@@ -4,0 +10,0 @@ |
+8
-5
@@ -6,6 +6,8 @@ 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-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-code-fast-1' | 'grok-4' | 'grok-4-0709' | 'grok-4-latest' | 'grok-3' | 'grok-3-latest' | 'grok-3-mini' | 'grok-3-mini-latest' | (string & {}); | ||
| type XaiChatModelId = 'grok-4.3' | 'grok-4.20-0309-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-build-0.1' | (string & {}); | ||
| declare const xaiLanguageModelChatOptions: z.ZodObject<{ | ||
| reasoningEffort: z.ZodOptional<z.ZodEnum<{ | ||
| none: "none"; | ||
| low: "low"; | ||
| medium: "medium"; | ||
| high: "high"; | ||
@@ -65,3 +67,3 @@ }>>; | ||
| type XaiResponsesModelId = 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | (string & {}); | ||
| type XaiResponsesModelId = 'grok-4.3' | 'grok-4.20-0309-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-build-0.1' | (string & {}); | ||
| /** | ||
@@ -72,5 +74,6 @@ * @see https://docs.x.ai/docs/api-reference#create-new-response | ||
| reasoningEffort: z.ZodOptional<z.ZodEnum<{ | ||
| none: "none"; | ||
| low: "low"; | ||
| medium: "medium"; | ||
| high: "high"; | ||
| medium: "medium"; | ||
| }>>; | ||
@@ -97,4 +100,4 @@ logprobs: z.ZodOptional<z.ZodBoolean>; | ||
| low: "low"; | ||
| medium: "medium"; | ||
| high: "high"; | ||
| medium: "medium"; | ||
| }>>; | ||
@@ -178,3 +181,3 @@ user: z.ZodOptional<z.ZodString>; | ||
| type XaiImageModelId = 'grok-imagine-image' | 'grok-imagine-image-pro' | (string & {}); | ||
| type XaiImageModelId = 'grok-imagine-image' | 'grok-imagine-image-quality' | (string & {}); | ||
@@ -181,0 +184,0 @@ declare const codeExecutionToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, { |
+8
-5
@@ -6,6 +6,8 @@ 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-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-code-fast-1' | 'grok-4' | 'grok-4-0709' | 'grok-4-latest' | 'grok-3' | 'grok-3-latest' | 'grok-3-mini' | 'grok-3-mini-latest' | (string & {}); | ||
| type XaiChatModelId = 'grok-4.3' | 'grok-4.20-0309-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-build-0.1' | (string & {}); | ||
| declare const xaiLanguageModelChatOptions: z.ZodObject<{ | ||
| reasoningEffort: z.ZodOptional<z.ZodEnum<{ | ||
| none: "none"; | ||
| low: "low"; | ||
| medium: "medium"; | ||
| high: "high"; | ||
@@ -65,3 +67,3 @@ }>>; | ||
| type XaiResponsesModelId = 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | (string & {}); | ||
| type XaiResponsesModelId = 'grok-4.3' | 'grok-4.20-0309-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-build-0.1' | (string & {}); | ||
| /** | ||
@@ -72,5 +74,6 @@ * @see https://docs.x.ai/docs/api-reference#create-new-response | ||
| reasoningEffort: z.ZodOptional<z.ZodEnum<{ | ||
| none: "none"; | ||
| low: "low"; | ||
| medium: "medium"; | ||
| high: "high"; | ||
| medium: "medium"; | ||
| }>>; | ||
@@ -97,4 +100,4 @@ logprobs: z.ZodOptional<z.ZodBoolean>; | ||
| low: "low"; | ||
| medium: "medium"; | ||
| high: "high"; | ||
| medium: "medium"; | ||
| }>>; | ||
@@ -178,3 +181,3 @@ user: z.ZodOptional<z.ZodString>; | ||
| type XaiImageModelId = 'grok-imagine-image' | 'grok-imagine-image-pro' | (string & {}); | ||
| type XaiImageModelId = 'grok-imagine-image' | 'grok-imagine-image-quality' | (string & {}); | ||
@@ -181,0 +184,0 @@ declare const codeExecutionToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, { |
+1
-1
| { | ||
| "name": "@ai-sdk/xai", | ||
| "version": "3.0.96", | ||
| "version": "3.0.97", | ||
| "license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
| import { z } from 'zod/v4'; | ||
| export type XaiResponsesModelId = | ||
| | 'grok-4-1-fast-reasoning' | ||
| | 'grok-4-1-fast-non-reasoning' | ||
| | 'grok-4' | ||
| | 'grok-4-fast-non-reasoning' | ||
| | 'grok-4-fast-reasoning' | ||
| | 'grok-4.3' | ||
| | 'grok-4.20-0309-reasoning' | ||
| | 'grok-4.20-0309-non-reasoning' | ||
| | 'grok-4.20-0309-reasoning' | ||
| | 'grok-4.20-multi-agent-0309' | ||
| | 'grok-build-0.1' | ||
| | (string & {}); | ||
@@ -20,5 +17,7 @@ | ||
| * Constrains how hard a reasoning model thinks before responding. | ||
| * Possible values are `low` (uses fewer reasoning tokens), `medium` and `high` (uses more reasoning tokens). | ||
| * Possible values are `none` (disables reasoning), `low` (uses fewer reasoning | ||
| * tokens), `medium` and `high` (uses more reasoning tokens). Not all models | ||
| * support reasoning effort; see xAI's docs for the values each model accepts. | ||
| */ | ||
| reasoningEffort: z.enum(['low', 'medium', 'high']).optional(), | ||
| reasoningEffort: z.enum(['none', 'low', 'medium', 'high']).optional(), | ||
| logprobs: z.boolean().optional(), | ||
@@ -25,0 +24,0 @@ topLogprobs: z.number().int().min(0).max(8).optional(), |
@@ -5,17 +5,7 @@ import { z } from 'zod/v4'; | ||
| export type XaiChatModelId = | ||
| | 'grok-4-1-fast-reasoning' | ||
| | 'grok-4-1-fast-non-reasoning' | ||
| | 'grok-4-fast-non-reasoning' | ||
| | 'grok-4-fast-reasoning' | ||
| | 'grok-4.3' | ||
| | 'grok-4.20-0309-reasoning' | ||
| | 'grok-4.20-0309-non-reasoning' | ||
| | 'grok-4.20-0309-reasoning' | ||
| | 'grok-4.20-multi-agent-0309' | ||
| | 'grok-code-fast-1' | ||
| | 'grok-4' | ||
| | 'grok-4-0709' | ||
| | 'grok-4-latest' | ||
| | 'grok-3' | ||
| | 'grok-3-latest' | ||
| | 'grok-3-mini' | ||
| | 'grok-3-mini-latest' | ||
| | 'grok-build-0.1' | ||
| | (string & {}); | ||
@@ -65,3 +55,3 @@ | ||
| export const xaiLanguageModelChatOptions = z.object({ | ||
| reasoningEffort: z.enum(['low', 'high']).optional(), | ||
| reasoningEffort: z.enum(['none', 'low', 'medium', 'high']).optional(), | ||
| logprobs: z.boolean().optional(), | ||
@@ -68,0 +58,0 @@ topLogprobs: z.number().int().min(0).max(8).optional(), |
| export type XaiImageModelId = | ||
| | 'grok-imagine-image' | ||
| | 'grok-imagine-image-pro' | ||
| | 'grok-imagine-image-quality' | ||
| | (string & {}); |
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
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
898823
0.01%11149
-0.04%