@shop-os/modelkit 0.2.22 → 0.2.23
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 +5 -0
- package/dist/catalog.cjs +12 -0
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +12 -1
- package/dist/catalog.d.ts +12 -1
- package/dist/catalog.js +12 -0
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/catalog.d.cts
CHANGED
|
@@ -942,6 +942,17 @@ declare const REFERENCE_SYNTAXES: ("numbered" | "caption" | "descriptive")[];
|
|
|
942
942
|
declare function outputAudio(row: {
|
|
943
943
|
constraints: unknown;
|
|
944
944
|
}): AudioOutput | undefined;
|
|
945
|
+
/**
|
|
946
|
+
* Whether a video request is billed as having sound. `always` rows are true and `never` rows
|
|
947
|
+
* false; an `optional` row takes the request's `generateAudio`, then the row's default, then
|
|
948
|
+
* true. A row with no declared audio is true. Every fallback is true because the base video
|
|
949
|
+
* price is the sound-on price: a guess must never pick the cheaper silent rate. Pass the same
|
|
950
|
+
* `requested` value the request dispatches with, so the billed and generated sound agree.
|
|
951
|
+
*/
|
|
952
|
+
declare function billedAudio(row: {
|
|
953
|
+
constraints: unknown;
|
|
954
|
+
defaults?: unknown;
|
|
955
|
+
}, requested?: boolean): boolean;
|
|
945
956
|
declare function promptConventions(row: {
|
|
946
957
|
constraints: unknown;
|
|
947
958
|
}): PromptConventions;
|
|
@@ -981,4 +992,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
|
|
|
981
992
|
/** Resolve caller options against a catalog row, dispatching on `model.type`. */
|
|
982
993
|
declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
|
|
983
994
|
|
|
984
|
-
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 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 Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, 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 ResolveResult, type Routing, SURFACES, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type VideoSecondsLimits, type Warning, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, outputAudio, primeCatalog, promptConventions, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows, videoLengthViolation };
|
|
995
|
+
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 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 Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, 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 ResolveResult, type Routing, SURFACES, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type VideoSecondsLimits, type Warning, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, outputAudio, primeCatalog, promptConventions, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows, videoLengthViolation };
|
package/dist/catalog.d.ts
CHANGED
|
@@ -942,6 +942,17 @@ declare const REFERENCE_SYNTAXES: ("numbered" | "caption" | "descriptive")[];
|
|
|
942
942
|
declare function outputAudio(row: {
|
|
943
943
|
constraints: unknown;
|
|
944
944
|
}): AudioOutput | undefined;
|
|
945
|
+
/**
|
|
946
|
+
* Whether a video request is billed as having sound. `always` rows are true and `never` rows
|
|
947
|
+
* false; an `optional` row takes the request's `generateAudio`, then the row's default, then
|
|
948
|
+
* true. A row with no declared audio is true. Every fallback is true because the base video
|
|
949
|
+
* price is the sound-on price: a guess must never pick the cheaper silent rate. Pass the same
|
|
950
|
+
* `requested` value the request dispatches with, so the billed and generated sound agree.
|
|
951
|
+
*/
|
|
952
|
+
declare function billedAudio(row: {
|
|
953
|
+
constraints: unknown;
|
|
954
|
+
defaults?: unknown;
|
|
955
|
+
}, requested?: boolean): boolean;
|
|
945
956
|
declare function promptConventions(row: {
|
|
946
957
|
constraints: unknown;
|
|
947
958
|
}): PromptConventions;
|
|
@@ -981,4 +992,4 @@ declare function isModelKitError(err: unknown): err is ModelKitError;
|
|
|
981
992
|
/** Resolve caller options against a catalog row, dispatching on `model.type`. */
|
|
982
993
|
declare function resolveOptions(model: CatalogModel, request: ImageRequest | VideoRequest | AudioRequest, onUnsupported?: OnUnsupported): ResolveResult<ImageRequest | VideoRequest | AudioRequest>;
|
|
983
994
|
|
|
984
|
-
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 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 Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, 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 ResolveResult, type Routing, SURFACES, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type VideoSecondsLimits, type Warning, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, outputAudio, primeCatalog, promptConventions, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows, videoLengthViolation };
|
|
995
|
+
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 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 Lifecycle, type LiveCatalogState, MODELS, type MediaPart, type MediaRef, 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 ResolveResult, type Routing, SURFACES, type SupportedOption, type Surface, SurfaceSchema, TEXT_MODELS, type UpscaleOptions, type UsageEvent, type UsageModality, type UsageUnit, VIDEO_MODELS, type VideoCallJob, type VideoCallOptions, type VideoJob, type VideoModel, type VideoRequest, type VideoResolution, type VideoResult, type VideoSecondsLimits, type Warning, billedAudio, compareCatalogOrder, hasAwsCredentials, isListed, isListedOn, isModelKitError, liveCatalog, liveState, nearestAspectRatio, normalizeExposure, outputAudio, primeCatalog, promptConventions, resetLiveCatalog, resolveAudioOptions, resolveImageOptions, resolveOptions, resolveVideoOptions, sortCatalogRows, videoLengthViolation };
|
package/dist/catalog.js
CHANGED
|
@@ -2011,6 +2011,17 @@ function outputAudio(row) {
|
|
|
2011
2011
|
const view = ConstraintsReadView.safeParse(row.constraints);
|
|
2012
2012
|
return view.success ? view.data.audio : void 0;
|
|
2013
2013
|
}
|
|
2014
|
+
var DefaultsReadView = z.looseObject({
|
|
2015
|
+
generateAudio: z.boolean().optional().catch(void 0)
|
|
2016
|
+
});
|
|
2017
|
+
function billedAudio(row, requested) {
|
|
2018
|
+
const audio = outputAudio(row);
|
|
2019
|
+
if (audio === "never") return false;
|
|
2020
|
+
if (audio !== "optional") return true;
|
|
2021
|
+
if (requested !== void 0) return requested;
|
|
2022
|
+
const defaults = DefaultsReadView.safeParse(row.defaults);
|
|
2023
|
+
return (defaults.success ? defaults.data.generateAudio : void 0) ?? true;
|
|
2024
|
+
}
|
|
2014
2025
|
function promptConventions(row) {
|
|
2015
2026
|
const view = ConstraintsReadView.safeParse(row.constraints);
|
|
2016
2027
|
const prompt = view.success ? view.data.prompt : void 0;
|
|
@@ -3217,6 +3228,7 @@ export {
|
|
|
3217
3228
|
SurfaceSchema,
|
|
3218
3229
|
TEXT_MODELS,
|
|
3219
3230
|
VIDEO_MODELS,
|
|
3231
|
+
billedAudio,
|
|
3220
3232
|
compareCatalogOrder,
|
|
3221
3233
|
isListed,
|
|
3222
3234
|
isListedOn,
|