@neta-art/generation 0.1.25 → 0.1.26
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/README.md +10 -0
- package/dist/{builtins-CYamscRp.js → builtins-Cvj5PK_9.js} +10 -4
- package/dist/builtins-Cvj5PK_9.js.map +1 -0
- package/dist/{builtins-D0tS2UtT.d.ts → builtins-jIE_k69Z.d.ts} +24 -2
- package/dist/builtins-jIE_k69Z.d.ts.map +1 -0
- package/dist/builtins.d.ts +1 -1
- package/dist/builtins.js +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/{export-config-hX4jDjSs.js → export-config-B3sM1Bxd.js} +41 -36
- package/dist/export-config-B3sM1Bxd.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/models/minimax-h3-unrestricted.yaml +1 -1
- package/models/minimax-h3.yaml +1 -1
- package/models/seedance-2-0-fast.yaml +1 -1
- package/models/seedance-2-0.yaml +1 -1
- package/package.json +1 -1
- package/dist/builtins-CYamscRp.js.map +0 -1
- package/dist/builtins-D0tS2UtT.d.ts.map +0 -1
- package/dist/export-config-hX4jDjSs.js.map +0 -1
package/README.md
CHANGED
|
@@ -440,6 +440,10 @@ schema: neta.generation.model.v1
|
|
|
440
440
|
model: gpt-image-2
|
|
441
441
|
title: GPT Image 2
|
|
442
442
|
category: image
|
|
443
|
+
pricing:
|
|
444
|
+
unit: image
|
|
445
|
+
min: 0.04
|
|
446
|
+
max: 0.73
|
|
443
447
|
adapter:
|
|
444
448
|
type: openai.images
|
|
445
449
|
content:
|
|
@@ -462,6 +466,12 @@ parameters:
|
|
|
462
466
|
default: 1024x1024
|
|
463
467
|
```
|
|
464
468
|
|
|
469
|
+
A declaration may carry a display-only `pricing` block in USD. `unit` names what one charge covers
|
|
470
|
+
(`image`, `second`, `request`, or `1m_tokens`); `amount` is the exact unit price, or a `min`/`max`
|
|
471
|
+
pair when the price depends on request parameters (resolution, duration, quality). The SDK does not
|
|
472
|
+
price or bill anything: pricing is declaration metadata for catalog surfaces, and actual charges
|
|
473
|
+
always come from the provider.
|
|
474
|
+
|
|
465
475
|
Set `hidden: true` on a declaration to hide the model from default discovery surfaces while keeping exact-ID lookup
|
|
466
476
|
and generation available. This is a discovery hint, not an authorization or runtime availability control.
|
|
467
477
|
`listModels()` returns the complete model catalog, including hidden models, so each user-facing discovery surface can
|
|
@@ -5,6 +5,12 @@ const GENERATION_MODEL_CATEGORIES = [
|
|
|
5
5
|
"video",
|
|
6
6
|
"audio"
|
|
7
7
|
];
|
|
8
|
+
const GENERATION_PRICING_UNITS = [
|
|
9
|
+
"image",
|
|
10
|
+
"second",
|
|
11
|
+
"request",
|
|
12
|
+
"1m_tokens"
|
|
13
|
+
];
|
|
8
14
|
|
|
9
15
|
//#endregion
|
|
10
16
|
//#region src/utils.ts
|
|
@@ -200,7 +206,7 @@ function seedanceVideoParameters(defaults) {
|
|
|
200
206
|
poll_interval: {
|
|
201
207
|
type: "integer",
|
|
202
208
|
optional: true,
|
|
203
|
-
default:
|
|
209
|
+
default: 1,
|
|
204
210
|
min: 1,
|
|
205
211
|
max: 30,
|
|
206
212
|
description: "Seconds between task status checks."
|
|
@@ -287,7 +293,7 @@ const minimaxH3VideoCommonParameters = {
|
|
|
287
293
|
poll_interval: {
|
|
288
294
|
type: "integer",
|
|
289
295
|
optional: true,
|
|
290
|
-
default:
|
|
296
|
+
default: 1,
|
|
291
297
|
min: 1,
|
|
292
298
|
max: 30,
|
|
293
299
|
description: "Seconds between task status checks."
|
|
@@ -1600,5 +1606,5 @@ function listBuiltinGenerationModels() {
|
|
|
1600
1606
|
}
|
|
1601
1607
|
|
|
1602
1608
|
//#endregion
|
|
1603
|
-
export { compactArray as a, slugifyFileName as c, cloneJson as i, GENERATION_MODEL_CATEGORIES as l, getBuiltinGenerationModel as n, compactObject as o, listBuiltinGenerationModels as r, getBlockMeta as s, builtinGenerationModels as t,
|
|
1604
|
-
//# sourceMappingURL=builtins-
|
|
1609
|
+
export { compactArray as a, slugifyFileName as c, MODEL_SCHEMA as d, cloneJson as i, GENERATION_MODEL_CATEGORIES as l, getBuiltinGenerationModel as n, compactObject as o, listBuiltinGenerationModels as r, getBlockMeta as s, builtinGenerationModels as t, GENERATION_PRICING_UNITS as u };
|
|
1610
|
+
//# sourceMappingURL=builtins-Cvj5PK_9.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtins-Cvj5PK_9.js","names":["parameters: GenerationModelDeclaration[\"parameters\"]","input: GenerationModelDeclaration[\"content\"][\"input\"]","parameters: NonNullable<GenerationModelDeclaration[\"parameters\"]>","builtinGenerationModels: GenerationModelDeclaration[]"],"sources":["../src/types.ts","../src/utils.ts","../src/builtins.ts"],"sourcesContent":["export const MODEL_SCHEMA = \"neta.generation.model.v1\" as const;\n\nexport const GENERATION_MODEL_CATEGORIES = [\"image\", \"video\", \"audio\"] as const;\n\nexport type GenerationModelCategory = (typeof GENERATION_MODEL_CATEGORIES)[number];\n\nexport const GENERATION_PRICING_UNITS = [\"image\", \"second\", \"request\", \"1m_tokens\"] as const;\n\nexport type GenerationPricingUnit = (typeof GENERATION_PRICING_UNITS)[number];\n\n/**\n * Display-only unit price for a model catalog. `unit` names what one charge\n * covers; `amount` is the exact unit price, or a `min`/`max` pair when the\n * price depends on request parameters (resolution, duration, quality).\n */\nexport type GenerationModelPricing = {\n unit: GenerationPricingUnit;\n /** Short qualifier shown with the price, e.g. \"std-pro\". */\n note?: string;\n} & ({ amount: number; min?: never; max?: never } | { amount?: never; min: number; max: number });\n\nexport type GenerationSource = { type: \"url\"; url: string } | { type: \"base64\"; mediaType: string; data: string };\n\nexport type GenerationContentBlockMeta = Record<string, unknown>;\n\nexport type GenerationContentBlock =\n | { type: \"text\"; text: string; meta?: GenerationContentBlockMeta }\n | { type: \"image\"; source: GenerationSource; meta?: GenerationContentBlockMeta }\n | { type: \"video\"; source: GenerationSource; meta?: GenerationContentBlockMeta }\n | { type: \"audio\"; source: GenerationSource; meta?: GenerationContentBlockMeta };\n\nexport type GenerationResult = {\n content: GenerationContentBlock[];\n requestId?: string;\n cost?: number;\n};\n\nexport type GenerationContentSpec = {\n type: \"text\" | \"image\" | \"video\" | \"audio\";\n required?: boolean;\n min?: number;\n max?: number;\n sources?: Array<GenerationSource[\"type\"]>;\n roles?: string[];\n roleRequired?: boolean;\n merge?: \"newline\" | \"space\" | \"concat\";\n meta?: Record<string, unknown>;\n description?: string;\n};\n\nexport type GenerationDimensionsSpec = {\n separator?: \"x\" | \"*\";\n min?: number;\n max?: number;\n multipleOf?: number;\n};\n\nexport type GenerationParameterSpec =\n | {\n type: \"string\";\n optional?: boolean;\n default?: string;\n enum?: string[];\n dimensions?: GenerationDimensionsSpec;\n description?: string;\n examples?: string[];\n }\n | {\n type: \"number\";\n optional?: boolean;\n default?: number;\n min?: number;\n max?: number;\n description?: string;\n examples?: number[];\n }\n | {\n type: \"integer\";\n optional?: boolean;\n default?: number;\n min?: number;\n max?: number;\n description?: string;\n examples?: number[];\n }\n | {\n type: \"boolean\";\n optional?: boolean;\n default?: boolean;\n description?: string;\n examples?: boolean[];\n };\n\nexport type GenerationMetaFieldSpec =\n | GenerationParameterSpec\n | { type: \"object\"; optional?: boolean; description?: string };\n\nexport type GenerationMetaTaskVariantSpec = {\n description?: string;\n required?: string[];\n requiredContent?: Array<GenerationContentSpec[\"type\"]>;\n sendTask?: boolean;\n};\n\nexport type GenerationMetaSpec = {\n fields?: Record<string, GenerationMetaFieldSpec>;\n taskField?: string;\n taskVariants?: Record<string, GenerationMetaTaskVariantSpec>;\n};\n\nexport type GenerationModelDeclaration = {\n schema: typeof MODEL_SCHEMA;\n model: string;\n title?: string;\n /** Product catalog class. */\n category?: GenerationModelCategory;\n /** Display-only unit price in USD, maintained per deployment. */\n pricing?: GenerationModelPricing;\n description?: string;\n /** Hide from default discovery while keeping exact-ID lookup and runtime use available. */\n hidden?: boolean;\n allowUnknownParameters?: boolean;\n adapter: {\n type: string;\n } & Record<string, unknown>;\n content: {\n input: GenerationContentSpec[];\n };\n parameters?: Record<string, GenerationParameterSpec>;\n meta?: GenerationMetaSpec;\n examples?: Array<{\n title?: string;\n request: GenerateRequest;\n }>;\n};\n\nexport type GenerateRequest = {\n model: string;\n content: GenerationContentBlock[];\n parameters?: Record<string, unknown>;\n meta?: Record<string, unknown>;\n /** @deprecated Use meta. */\n metadata?: Record<string, unknown>;\n apiKey?: string;\n baseUrl?: string;\n};\n\nexport type ResolvedGenerationRequest = {\n declaration: GenerationModelDeclaration;\n request: GenerateRequest;\n parameters: Record<string, unknown>;\n meta: Record<string, unknown>;\n};\n\nexport type GenerationSourceResolver = (source: GenerationSource) => Promise<string> | string;\n\nexport type GenerationDebugEvent =\n | {\n type: \"request\";\n url: string;\n method: string;\n headers: Record<string, string>;\n body?: unknown;\n }\n | {\n type: \"response\";\n url: string;\n status: number;\n statusText: string;\n headers: Record<string, string>;\n trace: Record<string, string>;\n elapsedMs: number;\n body?: unknown;\n };\n\nexport type GenerationDebugLogger = (event: GenerationDebugEvent) => void;\n\nexport type GenerationDebugOptions = {\n enabled?: boolean;\n includeSensitive?: boolean;\n includeResponseBody?: boolean;\n logger?: GenerationDebugLogger;\n};\n\nexport type GenerationDebugConfig = GenerationDebugOptions & {\n enabled: boolean;\n includeSensitive: boolean;\n includeResponseBody: boolean;\n logger: GenerationDebugLogger;\n};\n\nexport type GenerationAdapterContext = {\n apiKey: string;\n baseUrl: string;\n fetch: typeof fetch;\n resolveSource: GenerationSourceResolver;\n};\n\nexport type GenerationAdapterInput = ResolvedGenerationRequest & {\n context: GenerationAdapterContext;\n};\n\nexport type GenerationAdapter = ((input: GenerationAdapterInput) => Promise<GenerationContentBlock[]>) & {\n validate?: (input: ResolvedGenerationRequest) => void;\n};\n\nexport type CreateGenerationClientOptions = {\n apiKey?: string;\n baseUrl?: string;\n models?: GenerationModelDeclaration[];\n includeBuiltinModels?: boolean;\n fetch?: typeof fetch;\n sourceResolver?: GenerationSourceResolver;\n adapters?: Record<string, GenerationAdapter>;\n debug?: boolean | GenerationDebugOptions;\n};\n\nexport type GenerationClient = {\n /** Validates the request and sends it to the model adapter. */\n generate(request: GenerateRequest): Promise<GenerationContentBlock[]>;\n /** Resolves model defaults and all available validation rules without requiring an API key or making a network request. */\n validate(request: GenerateRequest): ResolvedGenerationRequest;\n /** Returns cloned, machine-readable declarations for every available model. */\n listModels(): GenerationModelDeclaration[];\n /** Returns a cloned model declaration, including content constraints and request examples, or null when unavailable. */\n getModel(model: string): GenerationModelDeclaration | null;\n /** Serializes one available model declaration for agents and external tools. */\n stringifyModelConfig(model: string, options?: { format?: \"yaml\" | \"json\" }): string;\n /** Writes one available model declaration to a YAML file. */\n exportModelConfig(model: string, filePath: string): Promise<void>;\n /** Writes every available model declaration to a directory as YAML files. */\n exportModelConfigs(directory: string): Promise<void>;\n};\n\nexport type GenerationClientWithResult = GenerationClient & {\n /** Generates content and returns observed request metadata such as requestId and cost when available. */\n generateResult(request: GenerateRequest): Promise<GenerationResult>;\n};\n","import type { GenerationContentBlock } from \"./types.js\";\n\nexport function cloneJson<T>(value: T): T {\n return JSON.parse(JSON.stringify(value)) as T;\n}\n\nexport function slugifyFileName(value: string): string {\n return (\n value\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9._-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\") || \"model\"\n );\n}\n\nexport function getBlockMeta(block: GenerationContentBlock): Record<string, unknown> | undefined {\n return \"meta\" in block ? block.meta : undefined;\n}\n\nexport function compactArray<T>(values: T[]): T[] | undefined {\n return values.length > 0 ? values : undefined;\n}\n\nexport function compactObject<T extends Record<string, unknown>>(value: T): T {\n for (const key of Object.keys(value)) if (value[key] === undefined) delete value[key];\n return value;\n}\n","import type { GenerationModelDeclaration } from \"./types.js\";\nimport { MODEL_SCHEMA } from \"./types.js\";\nimport { cloneJson } from \"./utils.js\";\n\nconst imageSizeParameters = {\n size: {\n type: \"string\",\n optional: true,\n default: \"1024x1024\",\n description: \"Output image size.\",\n examples: [\"auto\", \"1024x1024\", \"1536x1024\", \"1024x1536\", \"2048x2048\", \"2048x1152\", \"3840x2160\", \"2160x3840\"],\n },\n quality: {\n type: \"string\",\n optional: true,\n default: \"auto\",\n enum: [\"auto\", \"low\", \"medium\", \"high\"],\n description: \"Image quality.\",\n },\n} satisfies GenerationModelDeclaration[\"parameters\"];\n\nconst krea2ImageParameters = {\n size: {\n type: \"string\",\n optional: true,\n default: \"1024x1024\",\n description:\n \"Output image size as WIDTHxHEIGHT. Both dimensions must be between 256 and 1024 and must be multiples of 16.\",\n dimensions: { min: 256, max: 1024, multipleOf: 16 },\n examples: [\"1024x1024\", \"1024x768\", \"768x1024\", \"768x768\", \"512x512\", \"256x256\"],\n },\n} satisfies GenerationModelDeclaration[\"parameters\"];\n\nconst zImageTurboParameters = {\n size: {\n type: \"string\",\n optional: true,\n default: \"1024*1024\",\n enum: [\"1024*1024\", \"1536*1024\", \"1024*1536\", \"2048*2048\"],\n description: \"Output image size.\",\n },\n} satisfies GenerationModelDeclaration[\"parameters\"];\n\nconst qwenImageEditParameters = {\n size: {\n type: \"string\",\n optional: true,\n default: \"1024x1024\",\n description: \"Output image size.\",\n examples: [\"1024x1024\", \"768x1024\", \"1024x768\"],\n },\n} satisfies GenerationModelDeclaration[\"parameters\"];\n\nconst noobxlImageParameters = {\n size: {\n type: \"string\",\n optional: true,\n default: \"1024x1024\",\n enum: [\"1024x1024\", \"896x1152\", \"1152x896\", \"1344x768\", \"768x1344\"],\n description: \"Output image size.\",\n },\n negative_prompt: {\n type: \"string\",\n optional: true,\n description: \"Content to avoid in generated images.\",\n },\n seed: {\n type: \"integer\",\n optional: true,\n min: 0,\n description: \"Random seed for reproducibility.\",\n },\n} satisfies GenerationModelDeclaration[\"parameters\"];\n\nconst noobxlImageToImageParameters = {\n ...noobxlImageParameters,\n controlnet_weight: {\n type: \"number\",\n optional: true,\n min: 0,\n max: 2,\n description: \"ControlNet tile weight. The provider default is 0.8.\",\n },\n ipadapter_face_image_ref: {\n type: \"string\",\n optional: true,\n description: \"Optional face reference image URL for IP-Adapter.\",\n },\n ipadapter_face_weight: {\n type: \"number\",\n optional: true,\n min: 0,\n max: 2,\n description: \"IP-Adapter face weight. The provider default is 0.6 when a face reference is supplied.\",\n },\n} satisfies GenerationModelDeclaration[\"parameters\"];\n\nfunction seedanceVideoParameters(defaults: { resolution: string; resolutions?: string[]; maxWait: number }) {\n return {\n duration: {\n type: \"integer\",\n optional: true,\n default: 5,\n min: 4,\n max: 15,\n description: \"Video duration in seconds.\",\n },\n resolution: {\n type: \"string\",\n optional: true,\n default: defaults.resolution,\n enum: defaults.resolutions ?? [\"480p\", \"720p\", \"1080p\", \"2K\"],\n description: \"Output video resolution.\",\n },\n ratio: {\n type: \"string\",\n optional: true,\n default: \"16:9\",\n enum: [\"16:9\", \"9:16\", \"1:1\", \"4:3\", \"3:2\", \"2:3\", \"3:4\", \"21:9\", \"adaptive\"],\n description: \"Output aspect ratio. Use adaptive to let the model choose.\",\n },\n seed: { type: \"integer\", optional: true, description: \"Random seed for reproducibility.\" },\n camera_fixed: {\n type: \"boolean\",\n optional: true,\n default: false,\n description: \"Fix camera position when supported.\",\n },\n poll_interval: {\n type: \"integer\",\n optional: true,\n default: 1,\n min: 1,\n max: 30,\n description: \"Seconds between task status checks.\",\n },\n max_wait: {\n type: \"integer\",\n optional: true,\n default: defaults.maxWait,\n min: 30,\n max: 1800,\n description: \"Maximum seconds to wait for task completion.\",\n },\n } satisfies GenerationModelDeclaration[\"parameters\"];\n}\n\nconst minimaxH3ContentInput = [\n { type: \"text\", required: true, min: 1, max: 16, merge: \"newline\", description: \"Video prompt.\" },\n {\n type: \"image\",\n required: false,\n max: 12,\n sources: [\"url\"],\n roles: [\"first_frame\", \"last_frame\", \"reference_image\"],\n roleRequired: true,\n description: \"Optional image inputs. Use meta.role to select a frame or reference image.\",\n },\n {\n type: \"video\",\n required: false,\n max: 3,\n sources: [\"url\"],\n roles: [\"reference_video\"],\n roleRequired: true,\n description: \"Optional reference video inputs. Use meta.role reference_video.\",\n },\n {\n type: \"audio\",\n required: false,\n max: 3,\n sources: [\"url\"],\n roles: [\"reference_audio\"],\n roleRequired: true,\n description: \"Optional reference audio inputs. Use meta.role reference_audio.\",\n },\n] satisfies GenerationModelDeclaration[\"content\"][\"input\"];\n\nconst minimaxH3VideoCommonParameters = {\n duration: {\n type: \"integer\",\n optional: true,\n default: 5,\n description: \"Video duration in seconds.\",\n },\n ratio: {\n type: \"string\",\n optional: true,\n default: \"16:9\",\n enum: [\"adaptive\", \"21:9\", \"16:9\", \"4:3\", \"1:1\", \"3:4\", \"9:16\"],\n description: \"Output aspect ratio. Use adaptive when media inputs determine the ratio.\",\n },\n aigc_watermark: {\n type: \"boolean\",\n optional: true,\n default: false,\n description: \"Enable the generated-video watermark.\",\n },\n poll_interval: {\n type: \"integer\",\n optional: true,\n default: 1,\n min: 1,\n max: 30,\n description: \"Seconds between task status checks.\",\n },\n max_wait: {\n type: \"integer\",\n optional: true,\n default: 1800,\n min: 30,\n max: 1800,\n description: \"Maximum seconds to wait for task completion.\",\n },\n} satisfies GenerationModelDeclaration[\"parameters\"];\n\nfunction minimaxH3VideoParameters() {\n return {\n ...minimaxH3VideoCommonParameters,\n resolution: {\n type: \"string\" as const,\n optional: true,\n default: \"768P\",\n description: \"Output video resolution or an explicit WIDTHxHEIGHT canvas.\",\n },\n } satisfies GenerationModelDeclaration[\"parameters\"];\n}\n\nfunction klingVideoParameters(options: {\n maxDuration: number;\n negativePrompt?: boolean;\n seed?: boolean;\n sound?: boolean;\n}) {\n const parameters: GenerationModelDeclaration[\"parameters\"] = {\n duration: {\n type: \"integer\",\n optional: true,\n default: 5,\n min: 5,\n max: options.maxDuration,\n description: \"Video duration in seconds.\",\n },\n aspect_ratio: {\n type: \"string\",\n optional: true,\n default: \"16:9\",\n enum: [\"16:9\", \"9:16\", \"1:1\"],\n description: \"Output aspect ratio.\",\n },\n mode: {\n type: \"string\",\n optional: true,\n default: \"std\",\n enum: [\"std\", \"pro\"],\n description: \"Kling generation mode.\",\n },\n cfg_scale: {\n type: \"number\",\n optional: true,\n default: 0.5,\n min: 0,\n max: 1,\n description: \"Prompt adherence scale.\",\n },\n poll_interval: {\n type: \"integer\",\n optional: true,\n default: 5,\n min: 1,\n max: 30,\n description: \"Seconds between task status checks.\",\n },\n max_wait: {\n type: \"integer\",\n optional: true,\n default: 900,\n min: 30,\n max: 1800,\n description: \"Maximum seconds to wait for task completion.\",\n },\n };\n if (options.negativePrompt) {\n parameters.negative_prompt = {\n type: \"string\",\n optional: true,\n description: \"Negative prompt.\",\n };\n }\n if (options.seed) {\n parameters.seed = {\n type: \"integer\",\n optional: true,\n description: \"Random seed for reproducibility.\",\n };\n }\n if (options.sound) {\n parameters.sound = {\n type: \"string\",\n optional: true,\n enum: [\"on\", \"off\"],\n description: \"Enable or disable generated sound when supported.\",\n };\n }\n return parameters;\n}\n\nconst sunoTaskParameters = {\n poll_interval: {\n type: \"integer\",\n optional: true,\n default: 5,\n min: 1,\n max: 60,\n description: \"Seconds between task status checks.\",\n },\n max_wait: {\n type: \"integer\",\n optional: true,\n default: 600,\n min: 30,\n max: 3600,\n description: \"Maximum seconds to wait for task completion.\",\n },\n} satisfies GenerationModelDeclaration[\"parameters\"];\n\nconst sunoCommonMetaFields = {\n title: { type: \"string\", optional: true, description: \"Suno song title.\" },\n tags: { type: \"string\", optional: true, description: \"Comma-separated Suno music style tags.\" },\n gpt_description_prompt: { type: \"string\", optional: true, description: \"Suno inspiration-mode prompt.\" },\n negative_tags: { type: \"string\", optional: true, description: \"Styles to avoid.\" },\n generation_type: { type: \"string\", optional: true, description: \"Suno generation type.\" },\n make_instrumental: { type: \"boolean\", optional: true, default: false, description: \"Generate instrumental music.\" },\n metadata: { type: \"object\", optional: true, description: \"Suno provider metadata payload.\" },\n metadata_params: {\n type: \"object\",\n optional: true,\n description: \"Suno task-specific metadata payload.\",\n },\n} satisfies NonNullable<GenerationModelDeclaration[\"meta\"]>[\"fields\"];\n\nconst sunoTaskVariants = {\n extend: { required: [\"continue_clip_id\"] },\n upload_extend: { required: [\"continue_clip_id\"] },\n infill: { required: [\"continue_clip_id\", \"metadata_params\"] },\n fixed_infill: { required: [\"continue_clip_id\", \"metadata_params\"] },\n infill_intro: { required: [\"continue_clip_id\", \"metadata_params\"] },\n infill_outro: { required: [\"continue_clip_id\", \"metadata_params\"] },\n cover_infill: { required: [\"continue_clip_id\", \"metadata_params\"] },\n cover_extend: { required: [\"continue_clip_id\"] },\n artist_infill: { required: [\"continue_clip_id\", \"metadata_params\"] },\n artist_consistency: { required: [\"persona_id\", \"artist_clip_id\"] },\n cover: { required: [\"task_id\", \"continue_clip_id\"] },\n image_to_song: { requiredContent: [\"image\"], required: [\"metadata_params\"] },\n video_to_song: { requiredContent: [\"video\"], required: [\"metadata_params\"] },\n concat: { required: [\"clip_id\"] },\n sound: { required: [\"metadata_params\"] },\n underpainting: { required: [\"metadata_params\"] },\n overpainting: { required: [\"metadata_params\"] },\n remaster: { required: [\"metadata_params\"] },\n vox: { required: [\"artist_clip_id\"] },\n chop_sample_condition: { required: [\"metadata_params\"] },\n mashup_condition: { required: [\"metadata_params\"] },\n playlist_condition: { required: [\"metadata_params\"] },\n} satisfies NonNullable<GenerationModelDeclaration[\"meta\"]>[\"taskVariants\"];\n\nfunction sunoContentInput(\n options: { text?: \"required\" | \"optional\" | \"none\"; audio?: boolean; image?: boolean; video?: boolean } = {},\n): GenerationModelDeclaration[\"content\"][\"input\"] {\n const input: GenerationModelDeclaration[\"content\"][\"input\"] = [];\n if (options.text !== \"none\") {\n input.push({\n type: \"text\",\n required: options.text === \"required\",\n max: 16,\n merge: \"newline\",\n description:\n \"Prompt text. The adapter maps merged text to the operation's text field when that field is not provided.\",\n });\n }\n if (options.audio) {\n input.push({\n type: \"audio\",\n required: true,\n max: 1,\n sources: [\"url\", \"base64\"],\n description: \"Reference audio.\",\n });\n }\n if (options.image) {\n input.push({\n type: \"image\",\n required: true,\n max: 1,\n sources: [\"url\", \"base64\"],\n description: \"Reference image.\",\n });\n }\n if (options.video) {\n input.push({\n type: \"video\",\n required: true,\n max: 1,\n sources: [\"url\", \"base64\"],\n description: \"Reference video.\",\n });\n }\n return input;\n}\n\nconst sunoVersions = [\n { model: \"suno_music_chirp_fenix\", title: \"Suno Music Chirp Fenix v5.5\", mv: \"chirp-fenix\" },\n] as const;\n\nconst sunoMusicExample = {\n title: \"Music generation\",\n request: {\n model: \"suno_music_chirp_fenix\",\n content: [{ type: \"text\", text: \"uplifting cinematic pop with warm piano and clear chorus\" }],\n meta: {\n title: \"Warm Horizon\",\n tags: \"cinematic pop, warm piano\",\n make_instrumental: false,\n },\n },\n} satisfies NonNullable<GenerationModelDeclaration[\"examples\"]>[number];\n\nfunction sunoVersionModel(version: (typeof sunoVersions)[number]): GenerationModelDeclaration {\n return {\n schema: MODEL_SCHEMA,\n model: version.model,\n title: version.title,\n category: \"audio\",\n description:\n \"High-quality music generation model for soundtracks and background music. Produces two MP3 tracks and two JPG cover images per request.\",\n adapter: { type: \"suno.tasks\", operation: \"music\", payload: { mv: version.mv } },\n content: {\n input: sunoContentInput({ text: \"required\" }),\n },\n parameters: sunoTaskParameters,\n meta: {\n fields: sunoCommonMetaFields,\n },\n ...(version.model === \"suno_music_chirp_fenix\" ? { examples: [sunoMusicExample] } : {}),\n };\n}\n\nfunction sunoTaskModel(options: {\n model: string;\n title: string;\n description: string;\n task: string;\n mv?: string;\n content?: Parameters<typeof sunoContentInput>[0];\n fields?: NonNullable<GenerationModelDeclaration[\"meta\"]>[\"fields\"];\n examples?: GenerationModelDeclaration[\"examples\"];\n}): GenerationModelDeclaration {\n return {\n schema: MODEL_SCHEMA,\n model: options.model,\n title: options.title,\n description: options.description,\n adapter: {\n type: \"suno.tasks\",\n operation: \"music\",\n task: options.task,\n payload: { mv: options.mv ?? \"chirp-v5\" },\n },\n content: {\n input: sunoContentInput(options.content ?? { text: \"optional\" }),\n },\n parameters: sunoTaskParameters,\n meta: {\n fields: {\n ...sunoCommonMetaFields,\n ...options.fields,\n },\n taskVariants: sunoTaskVariants,\n },\n ...(options.examples ? { examples: options.examples } : {}),\n };\n}\n\nconst sunoModels = [\n ...sunoVersions.map(sunoVersionModel),\n {\n schema: MODEL_SCHEMA,\n model: \"suno_style_tags\",\n title: \"Suno Style Tags\",\n description: \"Suno style tag upsampling model.\",\n adapter: { type: \"suno.tasks\", operation: \"upsample_tags\" },\n content: {\n input: sunoContentInput({ text: \"required\" }),\n },\n },\n {\n schema: MODEL_SCHEMA,\n model: \"suno_upload_audio\",\n title: \"Suno Upload Audio\",\n description: \"Suno reference-audio upload model.\",\n adapter: { type: \"suno.tasks\", operation: \"upload_audio\", defaults: { name: \"reference-audio\", timeout: 120 } },\n content: {\n input: sunoContentInput({ text: \"none\", audio: true }),\n },\n parameters: sunoTaskParameters,\n meta: {\n fields: {\n name: { type: \"string\", optional: true, description: \"Upload name.\" },\n timeout: { type: \"integer\", optional: true, description: \"Upload timeout in seconds.\" },\n },\n },\n },\n sunoTaskModel({\n model: \"suno_image_to_song_chirp_v5\",\n title: \"Suno Image to Song Chirp v5.0\",\n description: \"Suno image-to-song task with a fixed chirp-v5 engine.\",\n task: \"image_to_song\",\n content: { text: \"optional\", image: true },\n fields: {\n metadata_params: { type: \"object\", description: \"Image-to-song metadata payload.\" },\n },\n }),\n sunoTaskModel({\n model: \"suno_video_to_song_chirp_v5\",\n title: \"Suno Video to Song Chirp v5.0\",\n description: \"Suno video-to-song task with a fixed chirp-v5 engine.\",\n task: \"video_to_song\",\n content: { text: \"optional\", video: true },\n fields: {\n metadata_params: { type: \"object\", description: \"Video-to-song metadata payload.\" },\n },\n }),\n sunoTaskModel({\n model: \"suno_sound_chirp_v5\",\n title: \"Suno Sound Chirp v5.0\",\n description: \"Suno sound-effect generation task with a fixed chirp-v5 engine.\",\n task: \"sound\",\n content: { text: \"optional\" },\n fields: {\n metadata_params: { type: \"object\", description: \"Sound task metadata payload.\" },\n },\n }),\n sunoTaskModel({\n model: \"suno_cover_chirp_v5\",\n title: \"Suno Cover Chirp v5.0\",\n description: \"Suno cover task with a fixed chirp-v5 engine.\",\n task: \"cover\",\n content: { text: \"optional\" },\n fields: {\n cover_clip_id: { type: \"string\", description: \"Clip id to cover.\" },\n task_id: { type: \"string\", description: \"Source Suno task id used for cover routing.\" },\n continue_clip_id: { type: \"string\", description: \"Source clip id used for cover generation.\" },\n continue_at: { type: \"number\", optional: true, description: \"Source clip continuation position in seconds.\" },\n },\n }),\n sunoTaskModel({\n model: \"suno_infill_chirp_v5\",\n title: \"Suno Infill Chirp v5.0\",\n description: \"Suno local edit task with a fixed chirp-v5 engine.\",\n task: \"infill\",\n content: { text: \"optional\" },\n fields: {\n continue_clip_id: { type: \"string\", description: \"Clip id to edit.\" },\n metadata_params: { type: \"object\", description: \"Infill timing and replacement metadata.\" },\n },\n }),\n sunoTaskModel({\n model: \"suno_vox_chirp_v5\",\n title: \"Suno Vox Chirp v5.0\",\n description: \"Suno hum-to-song task with a fixed chirp-v5 engine.\",\n task: \"vox\",\n content: { text: \"optional\" },\n fields: {\n artist_clip_id: { type: \"string\", description: \"Reference hum or vocal clip id.\" },\n },\n }),\n] satisfies GenerationModelDeclaration[];\n\ntype GeminiImageModelOptions = {\n imageSize?: {\n default: string;\n values: string[];\n example: string;\n };\n};\n\nfunction geminiImageModel(\n model: string,\n title: string,\n description: string,\n options: GeminiImageModelOptions = {},\n): GenerationModelDeclaration {\n const parameters: NonNullable<GenerationModelDeclaration[\"parameters\"]> = {\n aspect_ratio: {\n type: \"string\",\n optional: true,\n default: \"1:1\",\n enum: [\"1:1\", \"16:9\", \"4:3\", \"3:2\", \"3:4\", \"2:3\", \"9:16\", \"5:4\", \"4:5\", \"21:9\", \"1:4\", \"4:1\", \"1:8\", \"8:1\"],\n description: \"Output aspect ratio.\",\n },\n };\n if (options.imageSize) {\n parameters.image_size = {\n type: \"string\",\n optional: true,\n default: options.imageSize.default,\n enum: options.imageSize.values,\n description: \"Output image resolution.\",\n };\n }\n\n return {\n schema: MODEL_SCHEMA,\n model,\n title,\n category: \"image\",\n description,\n adapter: { type: \"gemini.generateContent\" },\n content: {\n input: [\n { type: \"text\", required: true, min: 1, max: 16, merge: \"newline\", description: \"Prompt text.\" },\n {\n type: \"image\",\n required: false,\n max: 14,\n sources: [\"url\", \"base64\"],\n description: \"Optional reference images.\",\n },\n ],\n },\n parameters,\n examples: [\n {\n title: \"Basic image\",\n request: {\n model,\n content: [\n { type: \"text\", text: \"a vibrant infographic explaining photosynthesis with clear readable labels\" },\n ],\n parameters: {\n aspect_ratio: \"16:9\",\n ...(options.imageSize ? { image_size: options.imageSize.example } : {}),\n },\n },\n },\n ],\n };\n}\n\nfunction qwenTtsModel(\n model: string,\n title: string,\n description: string,\n options: { minimumTextCodePoints?: number } = {},\n): GenerationModelDeclaration {\n const text = options.minimumTextCodePoints\n ? \"这是一段长度足够并且表达清晰自然的语音合成测试文本。\"\n : \"这是一次清晰自然的语音合成测试。\";\n return {\n schema: MODEL_SCHEMA,\n model,\n title,\n description,\n adapter: { type: \"openai.audioSpeech\" },\n content: {\n input: [\n {\n type: \"text\",\n required: true,\n min: 1,\n max: 1,\n description: options.minimumTextCodePoints\n ? `Exactly one non-empty text block to speak, with at least ${options.minimumTextCodePoints} Unicode code points.`\n : \"Exactly one non-empty text block to speak.\",\n },\n {\n type: \"audio\",\n required: false,\n max: 1,\n sources: [\"url\"],\n description: \"Clone: one URL; no voice_prompt. Dependency: use prior generated audio.\",\n },\n ],\n },\n meta: {\n fields: {\n voice_prompt: {\n type: \"string\",\n optional: true,\n description: \"Design: custom voice text; no reference audio.\",\n },\n },\n },\n examples: [\n {\n title: \"Voice design\",\n request: {\n model,\n content: [{ type: \"text\", text }],\n meta: { voice_prompt: \"一位沉稳干练的男性播音员声音,吐字清晰有力\" },\n },\n },\n {\n title: \"Voice clone\",\n request: {\n model,\n content: [\n { type: \"text\", text },\n { type: \"audio\", source: { type: \"url\", url: \"https://example.com/reference.mp3\" } },\n ],\n },\n },\n ],\n };\n}\n\nconst audioSpeechModels = [\n qwenTtsModel(\n \"qwen-tts\",\n \"Qwen TTS\",\n \"Modes: voice_prompt design OR one-reference clone. Default: unspecified Qwen design. Text: any length. Conflict: ask user; never combine/reinterpret. Dependency: clone prior generated audio.\",\n ),\n qwenTtsModel(\n \"qwen-audio-3.0-tts-plus\",\n \"Qwen Audio 3.0 TTS Plus\",\n \"Modes: voice_prompt design OR one-reference clone. Text: >=15 Unicode code points. Conflict: ask user; never combine/reinterpret. Dependency: clone prior generated audio.\",\n { minimumTextCodePoints: 15 },\n ),\n qwenTtsModel(\n \"qwen-audio-3.0-tts-flash\",\n \"Qwen Audio 3.0 TTS Flash\",\n \"Modes: voice_prompt design OR one-reference clone. Text: >=15 Unicode code points. Conflict: ask user; never combine/reinterpret. Dependency: clone prior generated audio.\",\n { minimumTextCodePoints: 15 },\n ),\n {\n schema: MODEL_SCHEMA,\n model: \"higgs-tts\",\n title: \"Higgs TTS\",\n description:\n \"Modes: built-in; one-reference high-fidelity clone; weighted 2-16-reference blend. Default: delegated generic voice (natural/suitable). Blend: all references, full text, one request. Conflict: clone + redesign; ask user, do not reinterpret. Dependency: clone prior generated audio.\",\n adapter: { type: \"openai.audioSpeech\" },\n content: {\n input: [\n {\n type: \"text\",\n required: true,\n min: 1,\n max: 1,\n description: \"Exactly one non-empty text block to speak.\",\n },\n {\n type: \"audio\",\n required: false,\n max: 16,\n sources: [\"url\"],\n description:\n \"Reference: one may omit weight; 2-16 require positive finite weights. Dependency: use prior generated audio.\",\n },\n ],\n },\n examples: [\n {\n title: \"Default voice\",\n request: {\n model: \"higgs-tts\",\n content: [{ type: \"text\", text: \"使用默认音色朗读这段文本。\" }],\n },\n },\n {\n title: \"Single reference\",\n request: {\n model: \"higgs-tts\",\n content: [\n { type: \"text\", text: \"使用单条参考音频朗读这段文本。\" },\n { type: \"audio\", source: { type: \"url\", url: \"https://example.com/reference.mp3\" } },\n ],\n },\n },\n {\n title: \"Weighted single reference\",\n request: {\n model: \"higgs-tts\",\n content: [\n { type: \"text\", text: \"使用带权重的单条参考音频朗读这段文本。\" },\n {\n type: \"audio\",\n source: { type: \"url\", url: \"https://example.com/reference.mp3\" },\n meta: { weight: 1 },\n },\n ],\n },\n },\n {\n title: \"Multiple references\",\n request: {\n model: \"higgs-tts\",\n content: [\n { type: \"text\", text: \"使用多参考融合音色朗读这段文本。\" },\n {\n type: \"audio\",\n source: { type: \"url\", url: \"https://example.com/reference-a.mp3\" },\n meta: { weight: 0.5 },\n },\n {\n type: \"audio\",\n source: { type: \"url\", url: \"https://example.com/reference-b.mp3\" },\n meta: { weight: 0.5 },\n },\n ],\n },\n },\n ],\n },\n] satisfies GenerationModelDeclaration[];\n\nconst builtinModels = [\n ...audioSpeechModels,\n {\n schema: MODEL_SCHEMA,\n model: \"gpt-image-2\",\n title: \"GPT Image 2\",\n category: \"image\",\n description:\n \"Excels at photorealism, fine detail, text rendering, and sophisticated layouts. It accepts uploaded images as base or reference images and is particularly well suited to realistic imagery, mock website screenshots, infographics, and highly stylized, visually striking illustrations. Strong natural-language understanding and broad world knowledge help it follow complex prompts. Non-photorealistic styles may develop fine-grained texture and lighting artifacts, which can be corrected through prompt refinement or reference images. Low cost, but relatively slow.\",\n adapter: { type: \"openai.images\" },\n content: {\n input: [\n { type: \"text\", required: true, min: 1, max: 16, merge: \"newline\", description: \"Prompt text.\" },\n {\n type: \"image\",\n required: false,\n max: 16,\n sources: [\"url\", \"base64\"],\n description: \"Optional reference images.\",\n },\n ],\n },\n parameters: imageSizeParameters,\n examples: [\n {\n title: \"Basic image\",\n request: {\n model: \"gpt-image-2\",\n content: [{ type: \"text\", text: \"a cyberpunk cat in neon rain\" }],\n parameters: { size: \"1024x1024\", quality: \"auto\" },\n },\n },\n ],\n },\n {\n schema: MODEL_SCHEMA,\n model: \"krea2\",\n title: \"Krea 2\",\n category: \"image\",\n description:\n \"Designed for visually refined image generation with broad aesthetic diversity. Strong natural-language understanding helps it follow detailed prompts. Text-only input; reference images are not supported. Relatively fast and low cost.\",\n adapter: { type: \"openai.images\" },\n content: {\n input: [{ type: \"text\", required: true, min: 1, max: 16, merge: \"newline\", description: \"Prompt text.\" }],\n },\n parameters: krea2ImageParameters,\n examples: [\n {\n title: \"Text-to-image\",\n request: {\n model: \"krea2\",\n content: [{ type: \"text\", text: \"an elegant editorial portrait with sculptural lighting\" }],\n parameters: { size: \"1024x1024\" },\n },\n },\n ],\n },\n {\n schema: MODEL_SCHEMA,\n model: \"z-image-turbo\",\n title: \"Z-Image Turbo\",\n category: \"image\",\n description:\n \"Fast text-to-image model. Z-Image Turbo accepts prompt text only and does not support reference images.\",\n adapter: { type: \"openai.images\" },\n content: {\n input: [{ type: \"text\", required: true, min: 1, max: 16, merge: \"newline\", description: \"Prompt text.\" }],\n },\n parameters: zImageTurboParameters,\n examples: [\n {\n title: \"Text to image\",\n request: {\n model: \"z-image-turbo\",\n content: [\n { type: \"text\", text: \"a clean product-style image of a small red toy robot standing on a white desk\" },\n ],\n parameters: { size: \"1024*1024\" },\n },\n },\n ],\n },\n {\n schema: MODEL_SCHEMA,\n model: \"qwen-image-edit\",\n title: \"Qwen Image Edit\",\n category: \"image\",\n description: \"Neta Qwen image editing with one source image URL and an edit instruction.\",\n adapter: { type: \"openai.imageEdits\" },\n content: {\n input: [\n { type: \"text\", required: true, min: 1, max: 16, merge: \"newline\", description: \"Edit instruction.\" },\n {\n type: \"image\",\n required: true,\n min: 1,\n max: 1,\n sources: [\"url\"],\n description: \"Source image URL to edit.\",\n },\n ],\n },\n parameters: qwenImageEditParameters,\n examples: [\n {\n title: \"Edit image\",\n request: {\n model: \"qwen-image-edit\",\n content: [\n { type: \"text\", text: \"change the background to a clean white studio backdrop\" },\n { type: \"image\", source: { type: \"url\", url: \"https://example.com/input.png\" } },\n ],\n parameters: { size: \"1024x1024\" },\n },\n },\n ],\n },\n geminiImageModel(\n \"gemini-3.1-flash-image-preview\",\n \"Gemini 3.1 Flash Image Preview\",\n \"Excels at text rendering, UI components and icons, commercial visuals, and image editing. It handles both photorealistic and non-photorealistic styles reliably, producing clean, consistent images while preserving key features from references. Strong natural-language understanding and broad world knowledge help it follow complex prompts. Its images are generally less expressive than those from gpt-image-2, and its style-transfer capabilities are weaker. Moderate speed, but relatively expensive.\",\n { imageSize: { default: \"2K\", values: [\"512\", \"1K\", \"2K\", \"4K\"], example: \"1K\" } },\n ),\n geminiImageModel(\n \"gemini-3.1-flash-lite-image\",\n \"Gemini 3.1 Flash Lite Image\",\n \"Excels at text rendering, UI components and icons, commercial visuals, and image editing. It supports both photorealistic and non-photorealistic styles, producing clean, consistent results while preserving key features from references. Strong natural-language understanding and broad world knowledge help it follow complex prompts. This Lite variant produces fixed 1K output and is optimized for fast generation at a moderate price.\",\n ),\n {\n schema: MODEL_SCHEMA,\n model: \"video-upscale-native\",\n title: \"Video Upscale\",\n category: \"video\",\n description: \"Upscales a video. Recommended input: long edge under 1080 pixels.\",\n adapter: { type: \"video.upscaleNative\" },\n content: {\n input: [\n {\n type: \"video\",\n required: true,\n min: 1,\n max: 1,\n sources: [\"url\"],\n description: \"Public video URL to upscale.\",\n },\n ],\n },\n examples: [\n {\n title: \"Upscale video\",\n request: {\n model: \"video-upscale-native\",\n content: [{ type: \"video\", source: { type: \"url\", url: \"https://example.com/input.mp4\" } }],\n },\n },\n ],\n },\n {\n schema: MODEL_SCHEMA,\n model: \"kling-text-to-video\",\n title: \"Kling Text To Video\",\n category: \"video\",\n description:\n \"One of the more affordable text-to-video models, well suited to short-form social media content and rapid creative validation.\",\n adapter: { type: \"kling.videoGenerations\" },\n content: {\n input: [{ type: \"text\", required: true, min: 1, max: 16, merge: \"newline\", description: \"Video prompt.\" }],\n },\n parameters: klingVideoParameters({ maxDuration: 10, negativePrompt: true, seed: true }),\n examples: [\n {\n title: \"Text to video\",\n request: {\n model: \"kling-text-to-video\",\n content: [{ type: \"text\", text: \"a small paper boat floating on calm water, cinematic motion\" }],\n parameters: { duration: 5, aspect_ratio: \"16:9\", mode: \"std\" },\n },\n },\n ],\n },\n {\n schema: MODEL_SCHEMA,\n model: \"kling-image-to-video\",\n title: \"Kling Image To Video\",\n category: \"video\",\n description:\n \"Animates a reference image into a short video. It has the same cost as Kling text-to-video and more permissive content moderation than Seedance.\",\n adapter: { type: \"kling.videoGenerations\" },\n content: {\n input: [\n { type: \"text\", required: true, min: 1, max: 16, merge: \"newline\", description: \"Video prompt.\" },\n {\n type: \"image\",\n required: false,\n max: 2,\n sources: [\"url\", \"base64\"],\n description:\n \"First frame and optional tail frame image input. Provider-native image input may be passed in meta.\",\n },\n ],\n },\n parameters: klingVideoParameters({ maxDuration: 10, negativePrompt: true, seed: true }),\n examples: [\n {\n title: \"Image to video\",\n request: {\n model: \"kling-image-to-video\",\n content: [\n { type: \"text\", text: \"gently turn toward the camera with soft natural motion\" },\n { type: \"image\", source: { type: \"url\", url: \"https://example.com/input.png\" } },\n ],\n parameters: { duration: 5, aspect_ratio: \"16:9\" },\n },\n },\n ],\n },\n {\n schema: MODEL_SCHEMA,\n model: \"kling-omni-video\",\n title: \"Kling Omni Video\",\n category: \"video\",\n description: \"Kling Omni-Video generation model.\",\n adapter: { type: \"kling.videoGenerations\" },\n content: {\n input: [\n {\n type: \"text\",\n required: false,\n max: 16,\n merge: \"newline\",\n description: \"Optional video prompt. Use Kling Omni placeholders such as <<<image_1>>> with image_list.\",\n },\n {\n type: \"image\",\n required: false,\n max: 2,\n sources: [\"url\", \"base64\"],\n description: \"Optional simple image input. Provider-native Omni media arrays belong in request meta.\",\n },\n ],\n },\n parameters: klingVideoParameters({ maxDuration: 15, sound: true }),\n meta: {\n fields: {\n multi_shot: {\n type: \"boolean\",\n optional: true,\n description: \"Enable Kling Omni multi-shot mode.\",\n },\n shot_type: {\n type: \"string\",\n optional: true,\n description: \"Kling Omni shot type.\",\n },\n },\n },\n examples: [\n {\n title: \"Omni text to video\",\n request: {\n model: \"kling-omni-video\",\n content: [{ type: \"text\", text: \"a small paper boat floating on calm water, cinematic motion\" }],\n parameters: { duration: 5, aspect_ratio: \"16:9\", mode: \"std\" },\n },\n },\n {\n title: \"Omni image to video\",\n request: {\n model: \"kling-omni-video\",\n content: [{ type: \"text\", text: \"<<<image_1>>> gently turns toward the camera with soft natural motion\" }],\n parameters: { duration: 5, aspect_ratio: \"16:9\" },\n meta: {\n image_list: [{ image_url: \"https://example.com/input.png\", type: \"first_frame\" }],\n },\n },\n },\n ],\n },\n {\n schema: MODEL_SCHEMA,\n model: \"kling-multi-image-to-video\",\n title: \"Kling Multi-Image Reference To Video\",\n category: \"video\",\n description: \"Kling multi-image reference video generation model.\",\n adapter: { type: \"kling.videoGenerations\" },\n content: {\n input: [\n { type: \"text\", required: true, min: 1, max: 16, merge: \"newline\", description: \"Video prompt.\" },\n {\n type: \"image\",\n required: false,\n max: 4,\n sources: [\"url\", \"base64\"],\n description: \"Reference image inputs. Provider-native image_list input may be passed in meta.\",\n },\n ],\n },\n parameters: klingVideoParameters({ maxDuration: 10, negativePrompt: true, seed: true }),\n examples: [\n {\n title: \"Multi-image reference to video\",\n request: {\n model: \"kling-multi-image-to-video\",\n content: [\n { type: \"text\", text: \"combine the references into one cinematic shot\" },\n { type: \"image\", source: { type: \"url\", url: \"https://example.com/reference-1.png\" } },\n { type: \"image\", source: { type: \"url\", url: \"https://example.com/reference-2.png\" } },\n ],\n parameters: { duration: 5, aspect_ratio: \"16:9\" },\n },\n },\n ],\n },\n {\n schema: MODEL_SCHEMA,\n model: \"noobxl-t2i-onediff\",\n title: \"NoobXL T2I OneDiff\",\n category: \"image\",\n description:\n \"Anime-specialized NoobXL text-to-image model for anime-style illustrations. It works best with English Danbooru tags, which can invoke specific anime characters and illustrator styles. Natural-language understanding is limited. Fast and extremely low cost.\",\n allowUnknownParameters: true,\n adapter: { type: \"openai.images\" },\n content: {\n input: [{ type: \"text\", required: true, min: 1, max: 16, merge: \"newline\", description: \"Prompt text.\" }],\n },\n parameters: noobxlImageParameters,\n examples: [\n {\n title: \"Text to image\",\n request: {\n model: \"noobxl-t2i-onediff\",\n content: [{ type: \"text\", text: \"anime key visual, luminous city at night, crisp linework\" }],\n parameters: { size: \"1024x1024\", negative_prompt: \"low quality, blurry\" },\n },\n },\n ],\n },\n {\n schema: MODEL_SCHEMA,\n model: \"noobxl-i2i-ipa-onediff\",\n title: \"NoobXL I2I IPA OneDiff\",\n category: \"image\",\n description:\n \"Anime-specialized NoobXL image-to-image model that redraws a single uploaded image using it as a style or character reference. It works best with English Danbooru tags, which can invoke specific anime characters and illustrator styles. Natural-language understanding is limited. Fast and extremely low cost.\",\n allowUnknownParameters: true,\n adapter: { type: \"openai.images\" },\n content: {\n input: [\n { type: \"text\", required: true, min: 1, max: 16, merge: \"newline\", description: \"Prompt text.\" },\n {\n type: \"image\",\n required: true,\n min: 1,\n max: 1,\n sources: [\"url\", \"base64\"],\n description: \"Single source image.\",\n },\n ],\n },\n parameters: noobxlImageToImageParameters,\n examples: [\n {\n title: \"Image to image\",\n request: {\n model: \"noobxl-i2i-ipa-onediff\",\n content: [\n { type: \"text\", text: \"keep the character identity, redraw as a polished anime illustration\" },\n { type: \"image\", source: { type: \"url\", url: \"https://example.com/reference.png\" } },\n ],\n parameters: { size: \"1024x1024\", controlnet_weight: 0.8 },\n },\n },\n ],\n },\n {\n schema: MODEL_SCHEMA,\n model: \"birefnet-general\",\n title: \"BiRefNet General\",\n category: \"image\",\n description:\n \"Single-image background removal model that produces images with transparent backgrounds. Well suited to image post-processing and creating web assets. Fast and extremely low cost.\",\n adapter: { type: \"openai.images\" },\n content: {\n input: [\n {\n type: \"text\",\n required: false,\n max: 16,\n merge: \"newline\",\n description: \"Optional workflow prompt. Accepted for compatibility but ignored by the model.\",\n },\n {\n type: \"image\",\n required: true,\n min: 1,\n max: 1,\n sources: [\"url\", \"base64\"],\n description: \"Single source image.\",\n },\n ],\n },\n examples: [\n {\n title: \"Remove background\",\n request: {\n model: \"birefnet-general\",\n content: [{ type: \"image\", source: { type: \"url\", url: \"https://example.com/portrait.png\" } }],\n },\n },\n ],\n },\n {\n schema: MODEL_SCHEMA,\n model: \"minimax-h3\",\n title: \"MiniMax H3\",\n category: \"video\",\n description: \"MiniMax H3 video generation with 768P output.\",\n adapter: { type: \"minimax.h3VideoGenerations\" },\n content: { input: minimaxH3ContentInput },\n parameters: minimaxH3VideoParameters(),\n examples: [\n {\n title: \"Text to video\",\n request: {\n model: \"minimax-h3\",\n content: [{ type: \"text\", text: \"a red cube rotating on a white table\" }],\n parameters: { duration: 5, resolution: \"768P\", ratio: \"16:9\" },\n },\n },\n ],\n },\n {\n schema: MODEL_SCHEMA,\n model: \"minimax-h3-unrestricted\",\n title: \"MiniMax H3 Unrestricted\",\n category: \"video\",\n description: \"MiniMax H3 video generation with caller-selected output dimensions.\",\n adapter: { type: \"minimax.h3VideoGenerations\" },\n content: { input: minimaxH3ContentInput },\n parameters: minimaxH3VideoParameters(),\n examples: [\n {\n title: \"Custom resolution\",\n request: {\n model: \"minimax-h3-unrestricted\",\n content: [{ type: \"text\", text: \"a red cube rotating on a white table\" }],\n parameters: { duration: 15, resolution: \"1920x1080\", ratio: \"16:9\" },\n },\n },\n ],\n },\n {\n schema: MODEL_SCHEMA,\n model: \"seedance-2-0\",\n title: \"Seedance 2.0\",\n category: \"video\",\n description:\n \"High-quality video generation model that accepts text, image, and video inputs. Supports resolutions from 480p to 2K and is well suited to final deliverables.\",\n adapter: { type: \"ark.videoGenerations\" },\n content: {\n input: [\n { type: \"text\", required: true, min: 1, max: 16, merge: \"newline\", description: \"Video prompt.\" },\n {\n type: \"image\",\n required: false,\n max: 9,\n sources: [\"url\"],\n roles: [\"first_frame\", \"last_frame\", \"reference_image\"],\n description: \"Optional public URL image input. Use meta.role as first_frame, last_frame, or reference_image.\",\n },\n {\n type: \"video\",\n required: false,\n max: 1,\n sources: [\"url\"],\n roles: [\"reference_video\"],\n roleRequired: true,\n description: \"Optional public URL reference video input. Use meta.role as reference_video.\",\n },\n ],\n },\n parameters: seedanceVideoParameters({ resolution: \"1080p\", maxWait: 900 }),\n examples: [\n {\n title: \"Text to video\",\n request: {\n model: \"seedance-2-0\",\n content: [\n {\n type: \"text\",\n text: \"a cat playing piano in a cozy jazz club, cinematic lighting, smooth camera movement\",\n },\n ],\n parameters: { duration: 5, resolution: \"1080p\", ratio: \"16:9\" },\n },\n },\n ],\n },\n {\n schema: MODEL_SCHEMA,\n model: \"seedance-2-0-fast\",\n title: \"Seedance 2.0 Fast\",\n category: \"video\",\n description:\n \"Fast video generation model that accepts text, image, and video inputs. Faster and less expensive than seedance-2-0, making it well suited to creative validation and draft iteration.\",\n adapter: { type: \"ark.videoGenerations\" },\n content: {\n input: [\n { type: \"text\", required: true, min: 1, max: 16, merge: \"newline\", description: \"Video prompt.\" },\n {\n type: \"image\",\n required: false,\n max: 9,\n sources: [\"url\"],\n roles: [\"first_frame\", \"last_frame\", \"reference_image\"],\n description: \"Optional public URL image input. Use meta.role as first_frame, last_frame, or reference_image.\",\n },\n {\n type: \"video\",\n required: false,\n max: 1,\n sources: [\"url\"],\n roles: [\"reference_video\"],\n roleRequired: true,\n description: \"Optional public URL reference video input. Use meta.role as reference_video.\",\n },\n ],\n },\n parameters: seedanceVideoParameters({ resolution: \"720p\", resolutions: [\"480p\", \"720p\"], maxWait: 600 }),\n examples: [\n {\n title: \"Text to video\",\n request: {\n model: \"seedance-2-0-fast\",\n content: [\n {\n type: \"text\",\n text: \"a cat playing piano in a cozy jazz club, cinematic lighting, smooth camera movement\",\n },\n ],\n parameters: { duration: 5, resolution: \"720p\", ratio: \"16:9\" },\n },\n },\n ],\n },\n ...sunoModels,\n] satisfies GenerationModelDeclaration[];\n\nexport const builtinGenerationModels: GenerationModelDeclaration[] = cloneJson(builtinModels);\n\nexport function getBuiltinGenerationModel(model: string): GenerationModelDeclaration | null {\n return cloneJson(builtinModels.find((declaration) => declaration.model === model) ?? null);\n}\n\nexport function listBuiltinGenerationModels(): GenerationModelDeclaration[] {\n return cloneJson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: "neta.generation.model.v1";
|
|
3
3
|
declare const GENERATION_MODEL_CATEGORIES: readonly ["image", "video", "audio"];
|
|
4
4
|
type GenerationModelCategory = (typeof GENERATION_MODEL_CATEGORIES)[number];
|
|
5
|
+
declare const GENERATION_PRICING_UNITS: readonly ["image", "second", "request", "1m_tokens"];
|
|
6
|
+
type GenerationPricingUnit = (typeof GENERATION_PRICING_UNITS)[number];
|
|
7
|
+
/**
|
|
8
|
+
* Display-only unit price for a model catalog. `unit` names what one charge
|
|
9
|
+
* covers; `amount` is the exact unit price, or a `min`/`max` pair when the
|
|
10
|
+
* price depends on request parameters (resolution, duration, quality).
|
|
11
|
+
*/
|
|
12
|
+
type GenerationModelPricing = {
|
|
13
|
+
unit: GenerationPricingUnit;
|
|
14
|
+
/** Short qualifier shown with the price, e.g. "std-pro". */
|
|
15
|
+
note?: string;
|
|
16
|
+
} & ({
|
|
17
|
+
amount: number;
|
|
18
|
+
min?: never;
|
|
19
|
+
max?: never;
|
|
20
|
+
} | {
|
|
21
|
+
amount?: never;
|
|
22
|
+
min: number;
|
|
23
|
+
max: number;
|
|
24
|
+
});
|
|
5
25
|
type GenerationSource = {
|
|
6
26
|
type: "url";
|
|
7
27
|
url: string;
|
|
@@ -104,6 +124,8 @@ type GenerationModelDeclaration = {
|
|
|
104
124
|
title?: string;
|
|
105
125
|
/** Product catalog class. */
|
|
106
126
|
category?: GenerationModelCategory;
|
|
127
|
+
/** Display-only unit price in USD, maintained per deployment. */
|
|
128
|
+
pricing?: GenerationModelPricing;
|
|
107
129
|
description?: string;
|
|
108
130
|
/** Hide from default discovery while keeping exact-ID lookup and runtime use available. */
|
|
109
131
|
hidden?: boolean;
|
|
@@ -217,5 +239,5 @@ declare const builtinGenerationModels: GenerationModelDeclaration[];
|
|
|
217
239
|
declare function getBuiltinGenerationModel(model: string): GenerationModelDeclaration | null;
|
|
218
240
|
declare function listBuiltinGenerationModels(): GenerationModelDeclaration[];
|
|
219
241
|
//#endregion
|
|
220
|
-
export {
|
|
221
|
-
//# sourceMappingURL=builtins-
|
|
242
|
+
export { GenerationSource as A, GenerationMetaTaskVariantSpec as C, GenerationParameterSpec as D, GenerationModelPricing as E, MODEL_SCHEMA as M, ResolvedGenerationRequest as N, GenerationPricingUnit as O, GenerationMetaSpec as S, GenerationModelDeclaration as T, GenerationDebugEvent as _, GENERATION_MODEL_CATEGORIES as a, GenerationDimensionsSpec as b, GenerationAdapter as c, GenerationClient as d, GenerationClientWithResult as f, GenerationDebugConfig as g, GenerationContentSpec as h, CreateGenerationClientOptions as i, GenerationSourceResolver as j, GenerationResult as k, GenerationAdapterContext as l, GenerationContentBlockMeta as m, getBuiltinGenerationModel as n, GENERATION_PRICING_UNITS as o, GenerationContentBlock as p, listBuiltinGenerationModels as r, GenerateRequest as s, builtinGenerationModels as t, GenerationAdapterInput as u, GenerationDebugLogger as v, GenerationModelCategory as w, GenerationMetaFieldSpec as x, GenerationDebugOptions as y };
|
|
243
|
+
//# sourceMappingURL=builtins-jIE_k69Z.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builtins-jIE_k69Z.d.ts","names":[],"sources":["../src/types.ts","../src/builtins.ts"],"sourcesContent":[],"mappings":";cAAa;AAAA,cAEA,2BAFkD,EAAA,SAAA,CAAA,OAAA,EAAA,OAAA,EAAA,OAAA,CAAA;AAElD,KAED,uBAAA,GAFmE,CAAA,OAEjC,2BAFiC,CAAA,CAAA,MAAA,CAAA;AAEnE,cAEC,wBAFiC,EAAA,SAAA,CAAA,OAAA,EAAA,QAA2B,EAAA,SAAA,EAAA,WAAA,CAAA;AAE5D,KAED,qBAAA,GAFgF,CAAA,OAEhD,wBAFgD,CAAA,CAAA,MAAA,CAAA;AAE5F;AAOA;AAMA;AAEA;AAEA;AACyC,KAX7B,sBAAA,GAW6B;EACZ,IAAA,EAXrB,qBAWqB;EAAyB;EACzB,IAAA,CAAA,EAAA,MAAA;CAAyB,GAAA,CAAA;EACzB,MAAA,EAAA,MAAA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A,EAAA,QAAA;EAIA,QAAA,CAAA,EAAA,OAAA;;;KDxvCJ,6BAAA;;;oBAGQ,MAAM;;;KAId,kBAAA;WACD,eAAe;;iBAET,eAAe;;KAGpB,0BAAA;iBACK;;;;aAIJ;;YAED;;;;;;;MAON;;WAEK;;eAEI,eAAe;SACrB;aACI;;aAEA;;;KAID,eAAA;;WAED;eACI;SACN;;aAEI;;;;KAKD,yBAAA;eACG;WACJ;cACG;QACN;;KAGI,wBAAA,YAAoC,qBAAqB;KAEzD,oBAAA;;;;WAKG;;;;;;;WAQA;SACF;;;;KAKD,qBAAA,WAAgC;KAEhC,sBAAA;;;;WAID;;KAGC,qBAAA,GAAwB;;;;UAI1B;;KAGE,wBAAA;;;gBAGI;iBACC;;KAGL,sBAAA,GAAyB;WAC1B;;KAGC,iBAAA,YAA6B,2BAA2B,QAAQ;qBACvD;;KAGT,6BAAA;;;WAGD;;iBAEM;mBACE;aACN,eAAe;oBACR;;KAGR,gBAAA;;oBAEQ,kBAAkB,QAAQ;;oBAE1B,kBAAkB;;gBAEtB;;2BAEW;;;;;;sDAI2B;;yCAEb;;KAG7B,0BAAA,GAA6B;;0BAEf,kBAAkB,QAAQ;;;;AA5OvC,cCm1CA,uBDn1CkD,ECm1CzB,0BDn1CyB,EAAA;AAElD,iBCm1CG,yBAAA,CDn1C+D,KAAA,EAAA,MAAA,CAAA,ECm1CrB,0BDn1CqB,GAAA,IAAA;AAEnE,iBCq1CI,2BAAA,CAAA,CDr1C8B,ECq1CC,0BDr1C0B,EAAA"}
|
package/dist/builtins.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as getBuiltinGenerationModel, r as listBuiltinGenerationModels, t as builtinGenerationModels } from "./builtins-
|
|
1
|
+
import { n as getBuiltinGenerationModel, r as listBuiltinGenerationModels, t as builtinGenerationModels } from "./builtins-jIE_k69Z.js";
|
|
2
2
|
export { builtinGenerationModels, getBuiltinGenerationModel, listBuiltinGenerationModels };
|
package/dist/builtins.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as getBuiltinGenerationModel, r as listBuiltinGenerationModels, t as builtinGenerationModels } from "./builtins-
|
|
1
|
+
import { n as getBuiltinGenerationModel, r as listBuiltinGenerationModels, t as builtinGenerationModels } from "./builtins-Cvj5PK_9.js";
|
|
2
2
|
|
|
3
3
|
export { builtinGenerationModels, getBuiltinGenerationModel, listBuiltinGenerationModels };
|
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { r as listBuiltinGenerationModels } from "../builtins-
|
|
3
|
-
import { h as stringifyGenerationModelDeclaration, i as createGenerationClient, n as exportBuiltinModelConfigs, t as exportBuiltinModelConfig } from "../export-config-
|
|
2
|
+
import { r as listBuiltinGenerationModels } from "../builtins-Cvj5PK_9.js";
|
|
3
|
+
import { h as stringifyGenerationModelDeclaration, i as createGenerationClient, n as exportBuiltinModelConfigs, t as exportBuiltinModelConfig } from "../export-config-B3sM1Bxd.js";
|
|
4
4
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as compactArray, c as slugifyFileName, i as cloneJson, l as GENERATION_MODEL_CATEGORIES, n as getBuiltinGenerationModel, o as compactObject, r as listBuiltinGenerationModels, s as getBlockMeta, t as builtinGenerationModels, u as
|
|
1
|
+
import { a as compactArray, c as slugifyFileName, d as MODEL_SCHEMA, i as cloneJson, l as GENERATION_MODEL_CATEGORIES, n as getBuiltinGenerationModel, o as compactObject, r as listBuiltinGenerationModels, s as getBlockMeta, t as builtinGenerationModels, u as GENERATION_PRICING_UNITS } from "./builtins-Cvj5PK_9.js";
|
|
2
2
|
import { mkdir, readFile, readdir, writeFile } from "node:fs/promises";
|
|
3
3
|
import { extname, join } from "node:path";
|
|
4
4
|
import { parse, stringify } from "yaml";
|
|
@@ -223,6 +223,23 @@ function isRecord$7(value) {
|
|
|
223
223
|
return typeof value === "object" && value !== null;
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
//#endregion
|
|
227
|
+
//#region src/task-poll.ts
|
|
228
|
+
function sleep(ms) {
|
|
229
|
+
return new Promise((resolve) => {
|
|
230
|
+
setTimeout(resolve, Math.max(0, ms));
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
/** Yield immediately, then wait `intervalMs` between later ticks until `maxWaitMs`. */
|
|
234
|
+
async function* taskPollTicks(maxWaitMs, intervalMs) {
|
|
235
|
+
const startedAt = Date.now();
|
|
236
|
+
while (Date.now() - startedAt <= maxWaitMs) {
|
|
237
|
+
yield;
|
|
238
|
+
if (Date.now() - startedAt > maxWaitMs) return;
|
|
239
|
+
await sleep(intervalMs);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
226
243
|
//#endregion
|
|
227
244
|
//#region src/validation.ts
|
|
228
245
|
function specsByType(specs) {
|
|
@@ -359,11 +376,8 @@ function mergeTextBlocks(declaration, content) {
|
|
|
359
376
|
//#endregion
|
|
360
377
|
//#region src/adapters/ark-video-generations.ts
|
|
361
378
|
const REQUEST_TIMEOUT_MS$8 = 186e4;
|
|
362
|
-
const DEFAULT_POLL_INTERVAL_SEC$4 =
|
|
379
|
+
const DEFAULT_POLL_INTERVAL_SEC$4 = 1;
|
|
363
380
|
const DEFAULT_MAX_WAIT_SEC$4 = 600;
|
|
364
|
-
function sleep$4(ms) {
|
|
365
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
366
|
-
}
|
|
367
381
|
function asString$4(value) {
|
|
368
382
|
return typeof value === "string" && value ? value : void 0;
|
|
369
383
|
}
|
|
@@ -550,9 +564,7 @@ async function arkVideoGenerationsAdapter(input) {
|
|
|
550
564
|
method: "POST",
|
|
551
565
|
body: JSON.stringify(payload)
|
|
552
566
|
}));
|
|
553
|
-
const
|
|
554
|
-
while (Date.now() - startedAt <= maxWaitSec * 1e3) {
|
|
555
|
-
await sleep$4(pollIntervalSec * 1e3);
|
|
567
|
+
for await (const _ of taskPollTicks(maxWaitSec * 1e3, pollIntervalSec * 1e3)) {
|
|
556
568
|
const rawStatus = await requestJson$4(input, `/v1/video/generations/${encodeURIComponent(taskId)}`, { method: "GET" });
|
|
557
569
|
const status = normalizeTaskStatus(rawStatus);
|
|
558
570
|
if (status.status === "succeeded") {
|
|
@@ -954,9 +966,6 @@ const KLING_MODELS = {
|
|
|
954
966
|
imageMode: "multi"
|
|
955
967
|
}
|
|
956
968
|
};
|
|
957
|
-
function sleep$3(ms) {
|
|
958
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
959
|
-
}
|
|
960
969
|
function asString$3(value) {
|
|
961
970
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
962
971
|
}
|
|
@@ -1132,9 +1141,7 @@ async function klingVideoGenerationsAdapter(input) {
|
|
|
1132
1141
|
}));
|
|
1133
1142
|
const pollIntervalSec = asInteger$2(input.parameters.poll_interval, DEFAULT_POLL_INTERVAL_SEC$3);
|
|
1134
1143
|
const maxWaitSec = asInteger$2(input.parameters.max_wait, DEFAULT_MAX_WAIT_SEC$3);
|
|
1135
|
-
const
|
|
1136
|
-
while (Date.now() - startedAt <= maxWaitSec * 1e3) {
|
|
1137
|
-
await sleep$3(pollIntervalSec * 1e3);
|
|
1144
|
+
for await (const _ of taskPollTicks(maxWaitSec * 1e3, pollIntervalSec * 1e3)) {
|
|
1138
1145
|
const rawStatus = await requestJson$3(input, `${model.submitPath}/${encodeURIComponent(taskId)}`, { method: "GET" });
|
|
1139
1146
|
const status = extractStatus(rawStatus);
|
|
1140
1147
|
if (status.status === "succeeded") {
|
|
@@ -1168,7 +1175,7 @@ async function klingVideoGenerationsAdapter(input) {
|
|
|
1168
1175
|
//#endregion
|
|
1169
1176
|
//#region src/adapters/minimax-h3-video-generations.ts
|
|
1170
1177
|
const REQUEST_TIMEOUT_MS$4 = 186e4;
|
|
1171
|
-
const DEFAULT_POLL_INTERVAL_SEC$2 =
|
|
1178
|
+
const DEFAULT_POLL_INTERVAL_SEC$2 = 1;
|
|
1172
1179
|
const DEFAULT_MAX_WAIT_SEC$2 = 1800;
|
|
1173
1180
|
const MAX_MEDIA_COUNT = 12;
|
|
1174
1181
|
const MAX_REFERENCE_IMAGES = 9;
|
|
@@ -1185,9 +1192,6 @@ const H3_RATIOS = [
|
|
|
1185
1192
|
"3:4",
|
|
1186
1193
|
"9:16"
|
|
1187
1194
|
];
|
|
1188
|
-
function sleep$2(ms) {
|
|
1189
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1190
|
-
}
|
|
1191
1195
|
function asString$2(value) {
|
|
1192
1196
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
1193
1197
|
}
|
|
@@ -1403,9 +1407,7 @@ async function minimaxH3VideoGenerationsAdapter(input) {
|
|
|
1403
1407
|
method: "POST",
|
|
1404
1408
|
body: JSON.stringify(payload)
|
|
1405
1409
|
}));
|
|
1406
|
-
const
|
|
1407
|
-
while (Date.now() - startedAt <= maxWaitSec * 1e3) {
|
|
1408
|
-
await sleep$2(pollIntervalSec * 1e3);
|
|
1410
|
+
for await (const _ of taskPollTicks(maxWaitSec * 1e3, pollIntervalSec * 1e3)) {
|
|
1409
1411
|
const rawStatus = await requestJson$2(input, `/v1/video/generations/${encodeURIComponent(taskId)}`, { method: "GET" });
|
|
1410
1412
|
const status = extractTaskStatus$1(rawStatus);
|
|
1411
1413
|
if (status.status === "succeeded") {
|
|
@@ -1629,9 +1631,6 @@ const FINAL_FAILURE_STATUSES = new Set([
|
|
|
1629
1631
|
"canceled",
|
|
1630
1632
|
"expired"
|
|
1631
1633
|
]);
|
|
1632
|
-
function sleep$1(ms) {
|
|
1633
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1634
|
-
}
|
|
1635
1634
|
function isRecord$3(value) {
|
|
1636
1635
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
1637
1636
|
}
|
|
@@ -1899,9 +1898,7 @@ function buildResult(operation, task, raw) {
|
|
|
1899
1898
|
});
|
|
1900
1899
|
}
|
|
1901
1900
|
async function pollSunoTask(input, operation, taskId, pollIntervalSec, maxWaitSec) {
|
|
1902
|
-
const
|
|
1903
|
-
while (Date.now() - startedAt <= maxWaitSec * 1e3) {
|
|
1904
|
-
await sleep$1(pollIntervalSec * 1e3);
|
|
1901
|
+
for await (const _ of taskPollTicks(maxWaitSec * 1e3, pollIntervalSec * 1e3)) {
|
|
1905
1902
|
let raw;
|
|
1906
1903
|
try {
|
|
1907
1904
|
raw = await requestJson$1(input, `/suno/fetch/${encodeURIComponent(taskId)}`, { method: "GET" });
|
|
@@ -1944,11 +1941,8 @@ async function sunoTasksAdapter(input) {
|
|
|
1944
1941
|
//#endregion
|
|
1945
1942
|
//#region src/adapters/video-upscale-native.ts
|
|
1946
1943
|
const REQUEST_TIMEOUT_MS = 186e4;
|
|
1947
|
-
const DEFAULT_POLL_INTERVAL_SEC =
|
|
1944
|
+
const DEFAULT_POLL_INTERVAL_SEC = 1;
|
|
1948
1945
|
const DEFAULT_MAX_WAIT_SEC = 600;
|
|
1949
|
-
function sleep(ms) {
|
|
1950
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1951
|
-
}
|
|
1952
1946
|
function isRecord$2(value) {
|
|
1953
1947
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
1954
1948
|
}
|
|
@@ -2071,9 +2065,7 @@ async function videoUpscaleNativeAdapter(input) {
|
|
|
2071
2065
|
video_url: videoUrl
|
|
2072
2066
|
})
|
|
2073
2067
|
}));
|
|
2074
|
-
const
|
|
2075
|
-
while (Date.now() - startedAt <= maxWaitSec * 1e3) {
|
|
2076
|
-
await sleep(pollIntervalSec * 1e3);
|
|
2068
|
+
for await (const _ of taskPollTicks(maxWaitSec * 1e3, pollIntervalSec * 1e3)) {
|
|
2077
2069
|
const rawStatus = await requestJson(input, `/v1/video/generations/${encodeURIComponent(taskId)}`, { method: "GET" });
|
|
2078
2070
|
const status = extractTaskStatus(rawStatus);
|
|
2079
2071
|
if (status.status === "succeeded") {
|
|
@@ -2167,6 +2159,19 @@ function isMetaTaskVariantSpec(value) {
|
|
|
2167
2159
|
function isGenerationModelCategory(value) {
|
|
2168
2160
|
return typeof value === "string" && GENERATION_MODEL_CATEGORIES.includes(value);
|
|
2169
2161
|
}
|
|
2162
|
+
function isFiniteNonNegative(value) {
|
|
2163
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
2164
|
+
}
|
|
2165
|
+
function isGenerationModelPricing(value) {
|
|
2166
|
+
if (!isRecord$1(value)) return false;
|
|
2167
|
+
if (typeof value.unit !== "string" || !GENERATION_PRICING_UNITS.includes(value.unit)) return false;
|
|
2168
|
+
if (value.note !== void 0 && typeof value.note !== "string") return false;
|
|
2169
|
+
if (value.amount !== void 0) {
|
|
2170
|
+
if (value.min !== void 0 || value.max !== void 0) return false;
|
|
2171
|
+
return isFiniteNonNegative(value.amount);
|
|
2172
|
+
}
|
|
2173
|
+
return isFiniteNonNegative(value.min) && isFiniteNonNegative(value.max) && value.min <= value.max;
|
|
2174
|
+
}
|
|
2170
2175
|
function isMetaSpec(value) {
|
|
2171
2176
|
if (!isRecord$1(value)) return false;
|
|
2172
2177
|
return (value.fields === void 0 || isRecord$1(value.fields) && Object.values(value.fields).every((field) => isMetaFieldSpec(field))) && (value.taskField === void 0 || typeof value.taskField === "string") && (value.taskVariants === void 0 || isRecord$1(value.taskVariants) && Object.values(value.taskVariants).every((variant) => isMetaTaskVariantSpec(variant)));
|
|
@@ -2178,7 +2183,7 @@ function isGenerationModelDeclaration(value) {
|
|
|
2178
2183
|
const parameters = value.parameters;
|
|
2179
2184
|
const meta = value.meta;
|
|
2180
2185
|
const examples = value.examples;
|
|
2181
|
-
return value.schema === MODEL_SCHEMA && typeof value.model === "string" && value.model.trim().length > 0 && (value.category === void 0 || isGenerationModelCategory(value.category)) && (value.hidden === void 0 || typeof value.hidden === "boolean") && (value.allowUnknownParameters === void 0 || typeof value.allowUnknownParameters === "boolean") && isRecord$1(adapter) && typeof adapter.type === "string" && isRecord$1(content) && Array.isArray(content.input) && (parameters === void 0 || isRecord$1(parameters) && Object.values(parameters).every(isParameterSpec)) && (meta === void 0 || isMetaSpec(meta)) && (examples === void 0 || Array.isArray(examples));
|
|
2186
|
+
return value.schema === MODEL_SCHEMA && typeof value.model === "string" && value.model.trim().length > 0 && (value.category === void 0 || isGenerationModelCategory(value.category)) && (value.pricing === void 0 || isGenerationModelPricing(value.pricing)) && (value.hidden === void 0 || typeof value.hidden === "boolean") && (value.allowUnknownParameters === void 0 || typeof value.allowUnknownParameters === "boolean") && isRecord$1(adapter) && typeof adapter.type === "string" && isRecord$1(content) && Array.isArray(content.input) && (parameters === void 0 || isRecord$1(parameters) && Object.values(parameters).every(isParameterSpec)) && (meta === void 0 || isMetaSpec(meta)) && (examples === void 0 || Array.isArray(examples));
|
|
2182
2187
|
}
|
|
2183
2188
|
function parseGenerationModelDeclaration(rawText, filePath = "model.yaml") {
|
|
2184
2189
|
const parsed = extname(filePath) === ".json" ? JSON.parse(rawText) : parse(rawText);
|
|
@@ -2469,4 +2474,4 @@ async function exportBuiltinModelConfigs(directory) {
|
|
|
2469
2474
|
|
|
2470
2475
|
//#endregion
|
|
2471
2476
|
export { mergeTextBlocks as A, GenerationValidationError as B, openAiImageEditsAdapter as C, audioSpeechAdapter as D, geminiGenerateContentAdapter as E, GenerationError as F, GenerationProviderError as I, GenerationTimeoutError as L, resolveGenerationParameters as M, validateGenerationContent as N, arkVideoGenerationsAdapter as O, GenerationConfigError as P, GenerationTransportError as R, openAiImagesAdapter as S, klingVideoGenerationsAdapter as T, writeGenerationModelDeclarations as _, createGenerationClientFromDirectory as a, videoUpscaleNativeAdapter as b, defaultGenerationSourceResolver as c, parseGenerationModelDeclaration as d, readGenerationModelDeclaration as f, writeGenerationModelDeclaration as g, stringifyGenerationModelDeclaration as h, createGenerationClient as i, resolveGenerationMeta as j, mergeGenerationMeta as k, isGenerationModelDeclaration as l, readGenerationModelDeclarationsFromFiles as m, exportBuiltinModelConfigs as n, createGenerationClientFromFile as o, readGenerationModelDeclarationsFromDirectory as p, stringifyBuiltinModelConfig as r, createGenerationClientFromFiles as s, exportBuiltinModelConfig as t, mergeGenerationModelDeclarations as u, builtinGenerationAdapters as v, minimaxH3VideoGenerationsAdapter as w, sunoTasksAdapter as x, getGenerationAdapter as y, GenerationUnsupportedAdapterError as z };
|
|
2472
|
-
//# sourceMappingURL=export-config-
|
|
2477
|
+
//# sourceMappingURL=export-config-B3sM1Bxd.js.map
|