@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/CHANGELOG.md +12 -0
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/index.mjs.map +1 -1
- package/docs/01-xai.mdx +2 -1
- package/package.json +2 -2
- package/src/xai-image-model.ts +4 -0
- package/src/xai-image-options.ts +1 -0
- package/src/xai-image-settings.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/xai
|
|
2
2
|
|
|
3
|
+
## 3.0.59
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8641667: Added `resolution` provider option (`"1k"` or `"2k"`) for xAI image models, enabling higher resolution output for grok-imagine models.
|
|
8
|
+
|
|
9
|
+
## 3.0.58
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 6af6c5c: Added `grok-imagine-image-pro` and `grok-2-image-1212` to XaiImageModelId type for better autocomplete support.
|
|
14
|
+
|
|
3
15
|
## 3.0.57
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -78,6 +78,10 @@ declare const xaiImageModelOptions: z.ZodObject<{
|
|
|
78
78
|
aspect_ratio: z.ZodOptional<z.ZodString>;
|
|
79
79
|
output_format: z.ZodOptional<z.ZodString>;
|
|
80
80
|
sync_mode: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
resolution: z.ZodOptional<z.ZodEnum<{
|
|
82
|
+
"1k": "1k";
|
|
83
|
+
"2k": "2k";
|
|
84
|
+
}>>;
|
|
81
85
|
}, z.core.$strip>;
|
|
82
86
|
type XaiImageModelOptions = z.infer<typeof xaiImageModelOptions>;
|
|
83
87
|
|
|
@@ -91,7 +95,7 @@ type XaiVideoModelOptions = {
|
|
|
91
95
|
[key: string]: unknown;
|
|
92
96
|
};
|
|
93
97
|
|
|
94
|
-
type XaiImageModelId = 'grok-2-image' | 'grok-imagine-image' | (string & {});
|
|
98
|
+
type XaiImageModelId = 'grok-2-image' | 'grok-2-image-1212' | 'grok-imagine-image' | 'grok-imagine-image-pro' | (string & {});
|
|
95
99
|
|
|
96
100
|
declare const codeExecutionToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
97
101
|
output: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -78,6 +78,10 @@ declare const xaiImageModelOptions: z.ZodObject<{
|
|
|
78
78
|
aspect_ratio: z.ZodOptional<z.ZodString>;
|
|
79
79
|
output_format: z.ZodOptional<z.ZodString>;
|
|
80
80
|
sync_mode: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
resolution: z.ZodOptional<z.ZodEnum<{
|
|
82
|
+
"1k": "1k";
|
|
83
|
+
"2k": "2k";
|
|
84
|
+
}>>;
|
|
81
85
|
}, z.core.$strip>;
|
|
82
86
|
type XaiImageModelOptions = z.infer<typeof xaiImageModelOptions>;
|
|
83
87
|
|
|
@@ -91,7 +95,7 @@ type XaiVideoModelOptions = {
|
|
|
91
95
|
[key: string]: unknown;
|
|
92
96
|
};
|
|
93
97
|
|
|
94
|
-
type XaiImageModelId = 'grok-2-image' | 'grok-imagine-image' | (string & {});
|
|
98
|
+
type XaiImageModelId = 'grok-2-image' | 'grok-2-image-1212' | 'grok-imagine-image' | 'grok-imagine-image-pro' | (string & {});
|
|
95
99
|
|
|
96
100
|
declare const codeExecutionToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
97
101
|
output: string;
|
package/dist/index.js
CHANGED
|
@@ -887,7 +887,8 @@ var import_v44 = require("zod/v4");
|
|
|
887
887
|
var xaiImageModelOptions = import_v44.z.object({
|
|
888
888
|
aspect_ratio: import_v44.z.string().optional(),
|
|
889
889
|
output_format: import_v44.z.string().optional(),
|
|
890
|
-
sync_mode: import_v44.z.boolean().optional()
|
|
890
|
+
sync_mode: import_v44.z.boolean().optional(),
|
|
891
|
+
resolution: import_v44.z.enum(["1k", "2k"]).optional()
|
|
891
892
|
});
|
|
892
893
|
|
|
893
894
|
// src/xai-image-model.ts
|
|
@@ -969,6 +970,9 @@ var XaiImageModel = class {
|
|
|
969
970
|
if ((xaiOptions == null ? void 0 : xaiOptions.aspect_ratio) != null && aspectRatio == null) {
|
|
970
971
|
body.aspect_ratio = xaiOptions.aspect_ratio;
|
|
971
972
|
}
|
|
973
|
+
if ((xaiOptions == null ? void 0 : xaiOptions.resolution) != null) {
|
|
974
|
+
body.resolution = xaiOptions.resolution;
|
|
975
|
+
}
|
|
972
976
|
if (imageUrl != null) {
|
|
973
977
|
body.image = { url: imageUrl, type: "image_url" };
|
|
974
978
|
}
|
|
@@ -2692,7 +2696,7 @@ var xaiTools = {
|
|
|
2692
2696
|
};
|
|
2693
2697
|
|
|
2694
2698
|
// src/version.ts
|
|
2695
|
-
var VERSION = true ? "3.0.
|
|
2699
|
+
var VERSION = true ? "3.0.59" : "0.0.0-test";
|
|
2696
2700
|
|
|
2697
2701
|
// src/xai-video-model.ts
|
|
2698
2702
|
var import_provider6 = require("@ai-sdk/provider");
|