@shop-os/modelkit 0.3.1 → 0.3.2

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.d.cts CHANGED
@@ -11,7 +11,7 @@ import { LanguageModelV3, LanguageModelV2 } from '@ai-sdk/provider';
11
11
 
12
12
  /** The AI SDK video model spelling: a catalog id or a provider video model instance. */
13
13
  type VideoModel = Parameters<typeof experimental_generateVideo>[0]["model"];
14
- type AspectRatio = "1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "3:2" | "2:3" | "4:5" | "5:4" | "21:9" | "9:21" | "97:30" | "adaptive";
14
+ type AspectRatio = "1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "3:2" | "2:3" | "4:5" | "5:4" | "21:9" | "9:21" | "97:30" | "1:4" | "4:1" | "1:8" | "8:1" | "adaptive";
15
15
  type ImageSize = "512" | "1K" | "2K" | "4K";
16
16
  type VideoResolution = "360p" | "480p" | "720p" | "768p" | "1080p" | "2k" | "4k";
17
17
  /** "xhigh" and "max" exist only on gpt-image-2.5; gpt-image-2 rejects them at the provider. */
@@ -716,6 +716,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
716
716
  "21:9": "21:9";
717
717
  "9:21": "9:21";
718
718
  "97:30": "97:30";
719
+ "1:4": "1:4";
720
+ "4:1": "4:1";
721
+ "1:8": "1:8";
722
+ "8:1": "8:1";
719
723
  adaptive: "adaptive";
720
724
  }>>>;
721
725
  sizes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
@@ -851,6 +855,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
851
855
  "21:9": "21:9";
852
856
  "9:21": "9:21";
853
857
  "97:30": "97:30";
858
+ "1:4": "1:4";
859
+ "4:1": "4:1";
860
+ "1:8": "1:8";
861
+ "8:1": "8:1";
854
862
  adaptive: "adaptive";
855
863
  }>>;
856
864
  size: z.ZodOptional<z.ZodEnum<{
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ import { LanguageModelV3, LanguageModelV2 } from '@ai-sdk/provider';
11
11
 
12
12
  /** The AI SDK video model spelling: a catalog id or a provider video model instance. */
13
13
  type VideoModel = Parameters<typeof experimental_generateVideo>[0]["model"];
14
- type AspectRatio = "1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "3:2" | "2:3" | "4:5" | "5:4" | "21:9" | "9:21" | "97:30" | "adaptive";
14
+ type AspectRatio = "1:1" | "16:9" | "9:16" | "4:3" | "3:4" | "3:2" | "2:3" | "4:5" | "5:4" | "21:9" | "9:21" | "97:30" | "1:4" | "4:1" | "1:8" | "8:1" | "adaptive";
15
15
  type ImageSize = "512" | "1K" | "2K" | "4K";
16
16
  type VideoResolution = "360p" | "480p" | "720p" | "768p" | "1080p" | "2k" | "4k";
17
17
  /** "xhigh" and "max" exist only on gpt-image-2.5; gpt-image-2 rejects them at the provider. */
@@ -716,6 +716,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
716
716
  "21:9": "21:9";
717
717
  "9:21": "9:21";
718
718
  "97:30": "97:30";
719
+ "1:4": "1:4";
720
+ "4:1": "4:1";
721
+ "1:8": "1:8";
722
+ "8:1": "8:1";
719
723
  adaptive: "adaptive";
720
724
  }>>>;
721
725
  sizes: z.ZodOptional<z.ZodArray<z.ZodEnum<{
@@ -851,6 +855,10 @@ declare const CatalogModelSchemaBase: z.ZodObject<{
851
855
  "21:9": "21:9";
852
856
  "9:21": "9:21";
853
857
  "97:30": "97:30";
858
+ "1:4": "1:4";
859
+ "4:1": "4:1";
860
+ "1:8": "1:8";
861
+ "8:1": "8:1";
854
862
  adaptive: "adaptive";
855
863
  }>>;
856
864
  size: z.ZodOptional<z.ZodEnum<{
package/dist/index.js CHANGED
@@ -169,13 +169,21 @@ var GEMINI_RATIOS = [
169
169
  "5:4",
170
170
  "adaptive"
171
171
  ];
172
+ var NANO_BANANA_2_1_RATIOS = [
173
+ ...GEMINI_RATIOS.filter((r) => r !== "adaptive"),
174
+ "1:4",
175
+ "4:1",
176
+ "1:8",
177
+ "8:1",
178
+ "adaptive"
179
+ ];
172
180
  var GEMINI_PROMPT_MAX_CHARS = 5e4;
173
181
  var GPT_IMAGE_PROMPT = { referenceSyntax: "numbered", maxChars: 32e3 };
174
- function geminiImage(id, label, aliases, sizes, display, exposure, references, promptMaxChars) {
182
+ function geminiImage(id, label, aliases, sizes, display, exposure, references, promptMaxChars, aspectRatios = GEMINI_RATIOS) {
175
183
  const prompt = { referenceSyntax: "caption" };
176
184
  if (promptMaxChars !== void 0) prompt.maxChars = promptMaxChars;
177
185
  const constraints = {
178
- aspectRatios: [...GEMINI_RATIOS],
186
+ aspectRatios: [...aspectRatios],
179
187
  sizes,
180
188
  supports: ["safetySettings", "temperature"],
181
189
  prompt
@@ -199,6 +207,21 @@ function geminiImage(id, label, aliases, sizes, display, exposure, references, p
199
207
  return model;
200
208
  }
201
209
  var IMAGE_MODELS = [
210
+ geminiImage(
211
+ "gemini-nano-banana-2.1",
212
+ "Nano Banana 2.1",
213
+ ["nb-2.1"],
214
+ ["1K", "2K", "4K"],
215
+ {
216
+ provider: "google",
217
+ description: "Latest high-efficiency Nano Banana. Better realism, prompt adherence, text rendering and character consistency at Flash speed. Great for campaigns, infographics, and iterative edits.",
218
+ logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png"
219
+ },
220
+ ["cowork", "space_builder"],
221
+ { images: 14 },
222
+ GEMINI_PROMPT_MAX_CHARS,
223
+ NANO_BANANA_2_1_RATIOS
224
+ ),
202
225
  geminiImage(
203
226
  "gemini-3-pro-image-preview",
204
227
  "Nano Banana Pro",
@@ -2445,6 +2468,10 @@ var AspectRatioSchema = z3.enum([
2445
2468
  "21:9",
2446
2469
  "9:21",
2447
2470
  "97:30",
2471
+ "1:4",
2472
+ "4:1",
2473
+ "1:8",
2474
+ "8:1",
2448
2475
  "adaptive"
2449
2476
  ]);
2450
2477
  var ImageSizeSchema = z3.enum(["512", "1K", "2K", "4K"]);