@ai-sdk/xai
Advanced tools
+3
-3
| { | ||
| "name": "@ai-sdk/xai", | ||
| "version": "4.0.38", | ||
| "version": "4.0.39", | ||
| "type": "module", | ||
@@ -32,4 +32,4 @@ "license": "Apache-2.0", | ||
| "dependencies": { | ||
| "@ai-sdk/provider-utils": "5.0.27", | ||
| "@ai-sdk/provider": "4.0.7" | ||
| "@ai-sdk/provider": "4.0.7", | ||
| "@ai-sdk/provider-utils": "5.0.27" | ||
| }, | ||
@@ -36,0 +36,0 @@ "devDependencies": { |
+1
-1
@@ -39,3 +39,3 @@ # AI SDK - xAI Grok Provider | ||
| const { text } = await generateText({ | ||
| model: xai('grok-3'), | ||
| model: xai('grok-4.6'), | ||
| prompt: 'Write a vegetarian lasagna recipe for 4 people.', | ||
@@ -42,0 +42,0 @@ }); |
@@ -584,15 +584,26 @@ import { | ||
| ) { | ||
| // Terminal outcomes, so they are reported the same way as an upstream `failed` | ||
| if (statusResponse.video?.respect_moderation === false) { | ||
| throw new AISDKError({ | ||
| name: 'XAI_VIDEO_MODERATION_ERROR', | ||
| message: | ||
| return { | ||
| status: 'error' as const, | ||
| error: | ||
| 'Video generation was blocked due to a content policy violation.', | ||
| }); | ||
| response: { | ||
| timestamp: currentDate, | ||
| modelId: this.modelId, | ||
| headers: responseHeaders, | ||
| }, | ||
| }; | ||
| } | ||
| if (!statusResponse.video?.url) { | ||
| throw new AISDKError({ | ||
| name: 'XAI_VIDEO_GENERATION_ERROR', | ||
| message: 'Video generation completed but no video URL was returned.', | ||
| }); | ||
| return { | ||
| status: 'error' as const, | ||
| error: 'Video generation completed but no video URL was returned.', | ||
| response: { | ||
| timestamp: currentDate, | ||
| modelId: this.modelId, | ||
| headers: responseHeaders, | ||
| }, | ||
| }; | ||
| } | ||
@@ -599,0 +610,0 @@ |
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.
865504
0.11%12278
0.17%