@ai-sdk/xai 3.0.72 → 3.0.73

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/xai",
3
- "version": "3.0.72",
3
+ "version": "3.0.73",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -65,9 +65,7 @@
65
65
  "build": "pnpm clean && tsup --tsconfig tsconfig.build.json",
66
66
  "build:watch": "pnpm clean && tsup --watch",
67
67
  "clean": "del-cli dist docs *.tsbuildinfo",
68
- "lint": "eslint \"./**/*.ts*\"",
69
68
  "type-check": "tsc --build",
70
- "prettier-check": "prettier --check \"./**/*.ts*\"",
71
69
  "test": "pnpm test:node && pnpm test:edge",
72
70
  "test:update": "pnpm test:node -u",
73
71
  "test:watch": "vitest --config vitest.node.config.js",
@@ -239,6 +239,14 @@ export class XaiVideoModel implements Experimental_VideoModelV3 {
239
239
  statusResponse.status === 'done' ||
240
240
  (statusResponse.status == null && statusResponse.video?.url)
241
241
  ) {
242
+ if (statusResponse.video?.respect_moderation === false) {
243
+ throw new AISDKError({
244
+ name: 'XAI_VIDEO_MODERATION_ERROR',
245
+ message:
246
+ 'Video generation was blocked due to a content policy violation.',
247
+ });
248
+ }
249
+
242
250
  if (!statusResponse.video?.url) {
243
251
  throw new AISDKError({
244
252
  name: 'XAI_VIDEO_GENERATION_ERROR',
@@ -268,6 +276,9 @@ export class XaiVideoModel implements Experimental_VideoModelV3 {
268
276
  ...(statusResponse.video.duration != null
269
277
  ? { duration: statusResponse.video.duration }
270
278
  : {}),
279
+ ...(statusResponse.usage?.cost_in_usd_ticks != null
280
+ ? { costInUsdTicks: statusResponse.usage.cost_in_usd_ticks }
281
+ : {}),
271
282
  },
272
283
  },
273
284
  };
@@ -299,4 +310,9 @@ const xaiVideoStatusResponseSchema = z.object({
299
310
  })
300
311
  .nullish(),
301
312
  model: z.string().nullish(),
313
+ usage: z
314
+ .object({
315
+ cost_in_usd_ticks: z.number().nullish(),
316
+ })
317
+ .nullish(),
302
318
  });