@ai-sdk/xai 3.0.124 → 3.0.125

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/dist/index.mjs CHANGED
@@ -1072,6 +1072,11 @@ var XaiImageModel = class {
1072
1072
  abortSignal,
1073
1073
  fetch: this.config.fetch
1074
1074
  });
1075
+ if (response.data.some((image) => image.respect_moderation === false)) {
1076
+ throw new Error(
1077
+ "Image generation was blocked due to a content policy violation."
1078
+ );
1079
+ }
1075
1080
  const hasAllBase64 = response.data.every((image) => image.b64_json != null);
1076
1081
  const images = hasAllBase64 ? response.data.map((image) => image.b64_json) : await Promise.all(
1077
1082
  response.data.map(
@@ -1112,7 +1117,8 @@ var xaiImageResponseSchema = z6.object({
1112
1117
  z6.object({
1113
1118
  url: z6.string().nullish(),
1114
1119
  b64_json: z6.string().nullish(),
1115
- revised_prompt: z6.string().nullish()
1120
+ revised_prompt: z6.string().nullish(),
1121
+ respect_moderation: z6.boolean().nullish()
1116
1122
  })
1117
1123
  ),
1118
1124
  usage: z6.object({
@@ -2988,7 +2994,7 @@ var xaiTools = {
2988
2994
  };
2989
2995
 
2990
2996
  // src/version.ts
2991
- var VERSION = true ? "3.0.124" : "0.0.0-test";
2997
+ var VERSION = true ? "3.0.125" : "0.0.0-test";
2992
2998
 
2993
2999
  // src/xai-video-model.ts
2994
3000
  import {