@shop-os/modelkit 0.7.1 → 0.7.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/CHANGELOG.md +11 -0
- package/dist/catalog.cjs +54 -0
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +36 -27
- package/dist/catalog.d.ts +36 -27
- package/dist/catalog.js +54 -0
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +58 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +56 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/catalog.d.cts
CHANGED
|
@@ -1687,6 +1687,41 @@ declare function resolveImageOptions(model: CatalogModel, request: ImageRequest,
|
|
|
1687
1687
|
declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
|
|
1688
1688
|
declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
|
|
1689
1689
|
|
|
1690
|
+
/** Provider body or the lifted detail (Gemini blockReason, fal body.detail). */
|
|
1691
|
+
type ProviderErrorBody = string | JsonValue;
|
|
1692
|
+
type ModelKitErrorCode = "unknown_model" | "unsupported_option" | "missing_input" | "content_blocked" | "provider_rejected"
|
|
1693
|
+
/** The provider account is out of credit or quota (HTTP 402 and its body spellings). Never retried. */
|
|
1694
|
+
| "provider_billing" | "timeout" | "auth" | "network" | "rate_limited";
|
|
1695
|
+
interface ModelKitErrorInit {
|
|
1696
|
+
code: ModelKitErrorCode;
|
|
1697
|
+
message: string;
|
|
1698
|
+
provider?: string;
|
|
1699
|
+
model?: string;
|
|
1700
|
+
status?: number;
|
|
1701
|
+
body?: ProviderErrorBody;
|
|
1702
|
+
cause?: unknown;
|
|
1703
|
+
retryable?: boolean;
|
|
1704
|
+
}
|
|
1705
|
+
declare class ModelKitError extends Error {
|
|
1706
|
+
readonly code: ModelKitErrorCode;
|
|
1707
|
+
readonly provider: string | undefined;
|
|
1708
|
+
readonly model: string | undefined;
|
|
1709
|
+
readonly status: number | undefined;
|
|
1710
|
+
readonly body: ProviderErrorBody | undefined;
|
|
1711
|
+
readonly retryable: boolean;
|
|
1712
|
+
constructor(init: ModelKitErrorInit);
|
|
1713
|
+
}
|
|
1714
|
+
declare function isModelKitError(err: unknown): err is ModelKitError;
|
|
1715
|
+
|
|
1716
|
+
/**
|
|
1717
|
+
* A row whose aspect ratio is the frame it renders its source into (Ray 3.2 Reframe): it
|
|
1718
|
+
* requires a source video and lists ratios without "adaptive", so the ratio is a target. Every
|
|
1719
|
+
* other edit row keeps the source's framing.
|
|
1720
|
+
*/
|
|
1721
|
+
declare function takesTargetAspectRatio(model: Pick<CatalogModel, "constraints">): boolean;
|
|
1722
|
+
/** Whether a Luma reframe asks for a vertical target at 1080p, which Luma does not render. */
|
|
1723
|
+
declare function lumaReframeTooTall(req: Pick<VideoRequest, "aspectRatio" | "resolution">): boolean;
|
|
1724
|
+
|
|
1690
1725
|
/** `generateSpeech` on a `speech` row. */
|
|
1691
1726
|
declare function resolveSpeechOptions(model: CatalogModel, request: SpeechRequest, onUnsupported?: OnUnsupported): ResolveResult<SpeechRequest>;
|
|
1692
1727
|
/** `changeVoice` on a `voice-change` row. */
|
|
@@ -1794,30 +1829,4 @@ declare function promptConventions(row: {
|
|
|
1794
1829
|
constraints: unknown;
|
|
1795
1830
|
}): PromptConventions;
|
|
1796
1831
|
|
|
1797
|
-
|
|
1798
|
-
type ProviderErrorBody = string | JsonValue;
|
|
1799
|
-
type ModelKitErrorCode = "unknown_model" | "unsupported_option" | "missing_input" | "content_blocked" | "provider_rejected"
|
|
1800
|
-
/** The provider account is out of credit or quota (HTTP 402 and its body spellings). Never retried. */
|
|
1801
|
-
| "provider_billing" | "timeout" | "auth" | "network" | "rate_limited";
|
|
1802
|
-
interface ModelKitErrorInit {
|
|
1803
|
-
code: ModelKitErrorCode;
|
|
1804
|
-
message: string;
|
|
1805
|
-
provider?: string;
|
|
1806
|
-
model?: string;
|
|
1807
|
-
status?: number;
|
|
1808
|
-
body?: ProviderErrorBody;
|
|
1809
|
-
cause?: unknown;
|
|
1810
|
-
retryable?: boolean;
|
|
1811
|
-
}
|
|
1812
|
-
declare class ModelKitError extends Error {
|
|
1813
|
-
readonly code: ModelKitErrorCode;
|
|
1814
|
-
readonly provider: string | undefined;
|
|
1815
|
-
readonly model: string | undefined;
|
|
1816
|
-
readonly status: number | undefined;
|
|
1817
|
-
readonly body: ProviderErrorBody | undefined;
|
|
1818
|
-
readonly retryable: boolean;
|
|
1819
|
-
constructor(init: ModelKitErrorInit);
|
|
1820
|
-
}
|
|
1821
|
-
declare function isModelKitError(err: unknown): err is ModelKitError;
|
|
1822
|
-
|
|
1823
|
-
export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveCall, type ResolveResult, type ResolvedCall, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceChangeRequest, type VoiceGender, type VoiceOption, type Warning, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, sortCatalogRows, videoLengthViolation, videoToolConstraints };
|
|
1832
|
+
export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveCall, type ResolveResult, type ResolvedCall, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceChangeRequest, type VoiceGender, type VoiceOption, type Warning, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, lumaReframeTooTall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, sortCatalogRows, takesTargetAspectRatio, videoLengthViolation, videoToolConstraints };
|
package/dist/catalog.d.ts
CHANGED
|
@@ -1687,6 +1687,41 @@ declare function resolveImageOptions(model: CatalogModel, request: ImageRequest,
|
|
|
1687
1687
|
declare function resolveVideoOptions(model: CatalogModel, request: VideoRequest, onUnsupported?: OnUnsupported): ResolveResult<VideoRequest>;
|
|
1688
1688
|
declare function resolveAudioOptions(model: CatalogModel, request: AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<AudioRequest>;
|
|
1689
1689
|
|
|
1690
|
+
/** Provider body or the lifted detail (Gemini blockReason, fal body.detail). */
|
|
1691
|
+
type ProviderErrorBody = string | JsonValue;
|
|
1692
|
+
type ModelKitErrorCode = "unknown_model" | "unsupported_option" | "missing_input" | "content_blocked" | "provider_rejected"
|
|
1693
|
+
/** The provider account is out of credit or quota (HTTP 402 and its body spellings). Never retried. */
|
|
1694
|
+
| "provider_billing" | "timeout" | "auth" | "network" | "rate_limited";
|
|
1695
|
+
interface ModelKitErrorInit {
|
|
1696
|
+
code: ModelKitErrorCode;
|
|
1697
|
+
message: string;
|
|
1698
|
+
provider?: string;
|
|
1699
|
+
model?: string;
|
|
1700
|
+
status?: number;
|
|
1701
|
+
body?: ProviderErrorBody;
|
|
1702
|
+
cause?: unknown;
|
|
1703
|
+
retryable?: boolean;
|
|
1704
|
+
}
|
|
1705
|
+
declare class ModelKitError extends Error {
|
|
1706
|
+
readonly code: ModelKitErrorCode;
|
|
1707
|
+
readonly provider: string | undefined;
|
|
1708
|
+
readonly model: string | undefined;
|
|
1709
|
+
readonly status: number | undefined;
|
|
1710
|
+
readonly body: ProviderErrorBody | undefined;
|
|
1711
|
+
readonly retryable: boolean;
|
|
1712
|
+
constructor(init: ModelKitErrorInit);
|
|
1713
|
+
}
|
|
1714
|
+
declare function isModelKitError(err: unknown): err is ModelKitError;
|
|
1715
|
+
|
|
1716
|
+
/**
|
|
1717
|
+
* A row whose aspect ratio is the frame it renders its source into (Ray 3.2 Reframe): it
|
|
1718
|
+
* requires a source video and lists ratios without "adaptive", so the ratio is a target. Every
|
|
1719
|
+
* other edit row keeps the source's framing.
|
|
1720
|
+
*/
|
|
1721
|
+
declare function takesTargetAspectRatio(model: Pick<CatalogModel, "constraints">): boolean;
|
|
1722
|
+
/** Whether a Luma reframe asks for a vertical target at 1080p, which Luma does not render. */
|
|
1723
|
+
declare function lumaReframeTooTall(req: Pick<VideoRequest, "aspectRatio" | "resolution">): boolean;
|
|
1724
|
+
|
|
1690
1725
|
/** `generateSpeech` on a `speech` row. */
|
|
1691
1726
|
declare function resolveSpeechOptions(model: CatalogModel, request: SpeechRequest, onUnsupported?: OnUnsupported): ResolveResult<SpeechRequest>;
|
|
1692
1727
|
/** `changeVoice` on a `voice-change` row. */
|
|
@@ -1794,30 +1829,4 @@ declare function promptConventions(row: {
|
|
|
1794
1829
|
constraints: unknown;
|
|
1795
1830
|
}): PromptConventions;
|
|
1796
1831
|
|
|
1797
|
-
|
|
1798
|
-
type ProviderErrorBody = string | JsonValue;
|
|
1799
|
-
type ModelKitErrorCode = "unknown_model" | "unsupported_option" | "missing_input" | "content_blocked" | "provider_rejected"
|
|
1800
|
-
/** The provider account is out of credit or quota (HTTP 402 and its body spellings). Never retried. */
|
|
1801
|
-
| "provider_billing" | "timeout" | "auth" | "network" | "rate_limited";
|
|
1802
|
-
interface ModelKitErrorInit {
|
|
1803
|
-
code: ModelKitErrorCode;
|
|
1804
|
-
message: string;
|
|
1805
|
-
provider?: string;
|
|
1806
|
-
model?: string;
|
|
1807
|
-
status?: number;
|
|
1808
|
-
body?: ProviderErrorBody;
|
|
1809
|
-
cause?: unknown;
|
|
1810
|
-
retryable?: boolean;
|
|
1811
|
-
}
|
|
1812
|
-
declare class ModelKitError extends Error {
|
|
1813
|
-
readonly code: ModelKitErrorCode;
|
|
1814
|
-
readonly provider: string | undefined;
|
|
1815
|
-
readonly model: string | undefined;
|
|
1816
|
-
readonly status: number | undefined;
|
|
1817
|
-
readonly body: ProviderErrorBody | undefined;
|
|
1818
|
-
readonly retryable: boolean;
|
|
1819
|
-
constructor(init: ModelKitErrorInit);
|
|
1820
|
-
}
|
|
1821
|
-
declare function isModelKitError(err: unknown): err is ModelKitError;
|
|
1822
|
-
|
|
1823
|
-
export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveCall, type ResolveResult, type ResolvedCall, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceChangeRequest, type VoiceGender, type VoiceOption, type Warning, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, sortCatalogRows, videoLengthViolation, videoToolConstraints };
|
|
1832
|
+
export { ADAPTER_IDS, AUDIO_OUTPUTS, type AdapterEndpoints, type AdapterId, type AspectRatio, type AudioOutput, type AudioRequest, type AudioResult, type CallContext, Catalog, type CatalogAuth, type CatalogCache, type CatalogCapabilities, type CatalogDisplay, type CatalogEnvelope, type CatalogModel, CatalogModelSchema, CatalogModelSchemaBase, type CatalogOrigin, CatalogSchema, type CatalogSource, type DubbingRequest, type DubbingResult, type Exposure, ExposureSchema, type GeneratedImage, IMAGE_MODELS, type ImageBytes, type ImageCallOptions, type ImageCallResult, type ImageQuality, type ImageRequest, type ImageResult, type ImageSafetySetting, type ImageSize, type JsonObject, type JsonPrimitive, type JsonValue, type KeyTier, type LanguageOption, type Lifecycle, type LipsyncRequest, type LipsyncResult, type LiveCatalogState, MEDIA_METHODS, MEDIA_NODE_MODELS, MODEL3D_IMAGE_SLOTS, MODEL3D_MODELS, MODELS, type MaskBox, type MaskPoint, type MediaMethod, type MediaNodeDefaults, type MediaOutput, type MediaPart, type MediaRef, type Model3dConstraints, type Model3dEndpoints, type Model3dFamily, type Model3dInputRefusal, type Model3dPricedInputs, type Model3dPricedOptions, type Model3dRequest, type Model3dResult, type Model3dStatus, type Model3dSubmission, type Model3dTexture, type Model3dViews, type Model3dWired, type ModelConstraints, type ModelKitConfig, ModelKitError, type ModelKitErrorCode, type ModelKitErrorInit, type ModelType, OTHER_MODELS, type OnUnsupported, type OutputFormat, type PricingKind, type PrimeCatalogResult, type PromptConventions, type ProviderErrorBody, type ProviderKeyName, type ProviderKeys, type ProviderOptionValue, type ProviderOptions, type QuarantineResult, REFERENCE_SYNTAXES, type ReferenceLimits, type ReferenceSyntax, type RequiredInput, type RequiredKeyName, type ResolveCall, type ResolveResult, type ResolvedCall, type Routing, SURFACES, type SpeechRequest, type SubtitleOptions, type SubtitleTextStyle, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type TranscriptWord, type TranscriptionRequest, type TranscriptionResult, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, VIDEO_TOOL_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, VideoResolutionSchema, type VideoResult, type VideoSecondsLimits, type VideoToolCallContext, type VideoToolConstraints, type VideoToolKind, type VideoToolOutputFormat, type VideoToolOutputSpec, type VideoToolPlan, type VideoToolRequest, type VideoToolResult, type VideoToolSource, type VideoToolStatus, type VideoToolSubmission, type VoiceChangeRequest, type VoiceGender, type VoiceOption, type Warning, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, lumaReframeTooTall, model3dConstraints, model3dInputRefusal, model3dPricingSku, model3dResolution, model3dSeedFits, model3dSkus, model3dTexture, nearestAspectRatio, normalizeExposure, outputAudio, planVideoTool, primeCatalog, promptConventions, resetLiveCatalog, resolutionTier, resolveAudioOptions, resolveDubbingOptions, resolveImageOptions, resolveLipsyncOptions, resolveOptions, resolveSpeechOptions, resolveTranscriptionOptions, resolveVideoOptions, resolveVoiceChangeOptions, sortCatalogRows, takesTargetAspectRatio, videoLengthViolation, videoToolConstraints };
|
package/dist/catalog.js
CHANGED
|
@@ -6339,6 +6339,57 @@ function applyXaiVideoRules(model, req, onUnsupported, warnings) {
|
|
|
6339
6339
|
});
|
|
6340
6340
|
req.resolution = XAI_REFERENCE_MAX_RESOLUTION;
|
|
6341
6341
|
}
|
|
6342
|
+
function takesTargetAspectRatio(model) {
|
|
6343
|
+
const ratios = model.constraints.aspectRatios ?? [];
|
|
6344
|
+
return (model.constraints.requires ?? []).includes("sourceVideo") && ratios.length > 0 && !ratios.includes("adaptive");
|
|
6345
|
+
}
|
|
6346
|
+
var LUMA_REFRAME_VERTICAL_MAX_RESOLUTION = "720p";
|
|
6347
|
+
function lumaReframeTooTall(req) {
|
|
6348
|
+
const vertical = req.aspectRatio === "9:16" || req.aspectRatio === "3:4";
|
|
6349
|
+
return vertical && req.resolution === "1080p";
|
|
6350
|
+
}
|
|
6351
|
+
function applyLumaVideoRules(model, req, onUnsupported, warnings) {
|
|
6352
|
+
if (model.adapter !== "luma" || !takesTargetAspectRatio(model)) return;
|
|
6353
|
+
if (req.aspectRatio === void 0 || req.aspectRatio === "adaptive") {
|
|
6354
|
+
const listed2 = model.constraints.aspectRatios ?? [];
|
|
6355
|
+
const fallback = model.defaults.aspectRatio !== void 0 && model.defaults.aspectRatio !== "adaptive" ? model.defaults.aspectRatio : listed2[0];
|
|
6356
|
+
const message2 = `${model.id} needs a target aspect ratio: ${listed2.join(", ")}`;
|
|
6357
|
+
if (onUnsupported === "error" || fallback === void 0) {
|
|
6358
|
+
throw new ModelKitError({
|
|
6359
|
+
code: "unsupported_option",
|
|
6360
|
+
message: message2,
|
|
6361
|
+
model: model.id,
|
|
6362
|
+
retryable: false
|
|
6363
|
+
});
|
|
6364
|
+
}
|
|
6365
|
+
warnings.push({
|
|
6366
|
+
code: "ratio_coerced",
|
|
6367
|
+
field: "aspectRatio",
|
|
6368
|
+
from: req.aspectRatio ?? "adaptive",
|
|
6369
|
+
to: fallback,
|
|
6370
|
+
message: message2
|
|
6371
|
+
});
|
|
6372
|
+
req.aspectRatio = fallback;
|
|
6373
|
+
}
|
|
6374
|
+
if (!lumaReframeTooTall(req)) return;
|
|
6375
|
+
const message = `${model.id} renders 9:16 and 3:4 reframes at up to ${LUMA_REFRAME_VERTICAL_MAX_RESOLUTION}`;
|
|
6376
|
+
if (onUnsupported === "error") {
|
|
6377
|
+
throw new ModelKitError({
|
|
6378
|
+
code: "unsupported_option",
|
|
6379
|
+
message,
|
|
6380
|
+
model: model.id,
|
|
6381
|
+
retryable: false
|
|
6382
|
+
});
|
|
6383
|
+
}
|
|
6384
|
+
warnings.push({
|
|
6385
|
+
code: "resolution_coerced",
|
|
6386
|
+
field: "resolution",
|
|
6387
|
+
from: req.resolution,
|
|
6388
|
+
to: LUMA_REFRAME_VERTICAL_MAX_RESOLUTION,
|
|
6389
|
+
message
|
|
6390
|
+
});
|
|
6391
|
+
req.resolution = LUMA_REFRAME_VERTICAL_MAX_RESOLUTION;
|
|
6392
|
+
}
|
|
6342
6393
|
var MINIMAX_H3_INSERT = "minimax/h3-max/insert-video";
|
|
6343
6394
|
var INSERT_MIN = 1.625;
|
|
6344
6395
|
var INSERT_MAX = 60;
|
|
@@ -9052,6 +9103,7 @@ function resolveVideoOptions(model, request, onUnsupported = "error") {
|
|
|
9052
9103
|
delete merged.previousInteractionId;
|
|
9053
9104
|
}
|
|
9054
9105
|
applyXaiVideoRules(model, merged, onUnsupported, warnings);
|
|
9106
|
+
applyLumaVideoRules(model, merged, onUnsupported, warnings);
|
|
9055
9107
|
checkVideoRequired(model, merged);
|
|
9056
9108
|
applyFalVideoRules(model, merged, request.aspectRatio, warnings);
|
|
9057
9109
|
return { request: merged, warnings };
|
|
@@ -9497,6 +9549,7 @@ export {
|
|
|
9497
9549
|
isModelKitError,
|
|
9498
9550
|
liveCatalog,
|
|
9499
9551
|
liveState,
|
|
9552
|
+
lumaReframeTooTall,
|
|
9500
9553
|
model3dConstraints,
|
|
9501
9554
|
model3dInputRefusal,
|
|
9502
9555
|
model3dPricingSku,
|
|
@@ -9522,6 +9575,7 @@ export {
|
|
|
9522
9575
|
resolveVideoOptions,
|
|
9523
9576
|
resolveVoiceChangeOptions,
|
|
9524
9577
|
sortCatalogRows,
|
|
9578
|
+
takesTargetAspectRatio,
|
|
9525
9579
|
videoLengthViolation,
|
|
9526
9580
|
videoToolConstraints
|
|
9527
9581
|
};
|