@ai-sdk/xai 3.0.57 → 3.0.59

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/docs/01-xai.mdx CHANGED
@@ -95,7 +95,8 @@ const { text } = await generateText({
95
95
  });
96
96
  ```
97
97
 
98
- xAI language models can also be used in the `streamText`, `generateObject`, and `streamObject` functions
98
+ xAI language models can also be used in the `streamText` function
99
+ and support structured data generation with [`Output`](/docs/reference/ai-sdk-core/output)
99
100
  (see [AI SDK Core](/docs/ai-sdk-core)).
100
101
 
101
102
  ### Provider Options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/xai",
3
- "version": "3.0.57",
3
+ "version": "3.0.59",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -29,8 +29,8 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@ai-sdk/provider-utils": "4.0.15",
33
32
  "@ai-sdk/openai-compatible": "2.0.30",
33
+ "@ai-sdk/provider-utils": "4.0.15",
34
34
  "@ai-sdk/provider": "3.0.8"
35
35
  },
36
36
  "devDependencies": {
@@ -123,6 +123,10 @@ export class XaiImageModel implements ImageModelV3 {
123
123
  body.aspect_ratio = xaiOptions.aspect_ratio;
124
124
  }
125
125
 
126
+ if (xaiOptions?.resolution != null) {
127
+ body.resolution = xaiOptions.resolution;
128
+ }
129
+
126
130
  if (imageUrl != null) {
127
131
  body.image = { url: imageUrl, type: 'image_url' };
128
132
  }
@@ -4,6 +4,7 @@ export const xaiImageModelOptions = z.object({
4
4
  aspect_ratio: z.string().optional(),
5
5
  output_format: z.string().optional(),
6
6
  sync_mode: z.boolean().optional(),
7
+ resolution: z.enum(['1k', '2k']).optional(),
7
8
  });
8
9
 
9
10
  export type XaiImageModelOptions = z.infer<typeof xaiImageModelOptions>;
@@ -1,4 +1,6 @@
1
1
  export type XaiImageModelId =
2
2
  | 'grok-2-image'
3
+ | 'grok-2-image-1212'
3
4
  | 'grok-imagine-image'
5
+ | 'grok-imagine-image-pro'
4
6
  | (string & {});