@shop-os/modelkit 0.7.6 → 0.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/catalog.cjs +6 -4
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.js +6 -4
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +25 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,18 @@ header in the release PR.
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
+
## [0.7.8] - Unreleased
|
|
13
|
+
|
|
14
|
+
ENG-3324: Ray 3.2 offers 10 s clips.
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- `ray-3.2` offers `durations: [5, 10]` (was `[5]`); the default stays 5 s. The Luma adapter sends the requested length (`"10s"`) instead of a fixed `"5s"`, and a generate reports the block it asked for (5 or 10) as `durationSeconds`, never the measured frames. A generate of any other length is refused with `unsupported_option` before a request, since nothing prices it. Luma bills a 10 s clip at 3x the 5 s price; pro-backend prices it through its billed-seconds map (`{"10": 15}`), so usage keeps the real 10 s. Consumers must not offer this version before that pricing is deployed, or a 10 s clip bills 2x.
|
|
18
|
+
|
|
19
|
+
## [0.7.7] - Unreleased
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- Google `prepareMediaPart` inlines bytes only up to 10 MiB (was 20 MB) and uploads larger media through the Files API. Inline bytes are base64-encoded, so a 15 MB video made a ~20 MB request and Gemini refused it or timed out; on dev no inline video between 10.9 MB and 20 MB succeeded. Media of 10-20 MB now uploads (a few seconds slower, same tokens) and the returned `cleanup` deletes the file as before.
|
|
23
|
+
|
|
12
24
|
## [0.7.6] - Unreleased
|
|
13
25
|
|
|
14
26
|
ENG-3323: one xAI reference-mode rule.
|
package/README.md
CHANGED
|
@@ -309,7 +309,7 @@ const defaultKit = createDefaultModelKit({ keys: { pro: keysFromEnv(process.env)
|
|
|
309
309
|
| Retry | One classifier, one policy. Never on content blocks, aborts, or 4xx except 429; SDKs with their own retry (Replicate) run under a single kit attempt; a 429 on a status poll keeps polling unless `CallContext.maxRetries` is `0`. See durable media execution above. |
|
|
310
310
|
| Errors | `ModelKitError` with `code`, `provider`, `status`, `body`. Gemini `blockReason` and fal `body.detail` are lifted into `body`. A throw with no HTTP status (fetch failed, reset, DNS) is a retryable `network` error on every adapter. An out-of-credit provider account is `provider_billing` and is never retried: HTTP 402, a 4xx whose structured error code is a billing code (`insufficient_quota`, ...), or a 403/429 whose text names the exhausted account ("Exhausted balance", "Insufficient credit"). Text calls go through `ai` and surface the SDK's own error instead. |
|
|
311
311
|
| Usage | One event per call with the canonical model id and the row's `usage.unit` (adapters supply the quantity in that unit). Gemini image events carry the token counts too (`inputTokens`/`outputTokens`); Google's raw `usageMetadata` rides on `raw.providerMetadata.google`. Video usage is emitted on completion and carries the resolution the provider renders (the default it falls back to when the request has none), because pricing is keyed by it; Seedance keeps `usage`, `duration`, `framespersecond` and `resolution` from the poll on `raw`. Audio: Lyria 3 returns no duration, so it emits `unit: "images", quantity: 1` (token counts ride along as `inputTokens`/`outputTokens`); Replicate audio (Lyria 2, MMAudio) emits `unit: "compute_seconds"` with the prediction time. |
|
|
312
|
-
| Media parts | `prepareMediaPart` turns a `MediaRef` into an AI SDK file part. Google inlines bytes up to 20 MB and uploads larger payloads through the Files API; call the returned `cleanup` after the request. Other providers get the reference inline. |
|
|
312
|
+
| Media parts | `prepareMediaPart` turns a `MediaRef` into an AI SDK file part. Google inlines bytes up to 10 MiB (base64 makes them ~4/3 larger inside Gemini's 20 MB request cap) and uploads larger payloads through the Files API; call the returned `cleanup` after the request. Other providers get the reference inline. |
|
|
313
313
|
|
|
314
314
|
## Add a model
|
|
315
315
|
|
package/dist/catalog.cjs
CHANGED
|
@@ -5201,8 +5201,10 @@ var RAY_RESOLUTIONS = ["360p", "720p", "1080p"];
|
|
|
5201
5201
|
var RAY_PROMPT = { referenceSyntax: "numbered", maxChars: 6e3 };
|
|
5202
5202
|
var LUMA_VIDEO_MODELS = [
|
|
5203
5203
|
{
|
|
5204
|
-
// https://docs.agents.lumalabs.ai: type "video" with a
|
|
5205
|
-
// firstFrame and lastFrame ride as start_frame and end_frame.
|
|
5204
|
+
// https://docs.agents.lumalabs.ai: type "video" with a 5 s or 10 s duration;
|
|
5205
|
+
// firstFrame and lastFrame ride as start_frame and end_frame. Luma bills a
|
|
5206
|
+
// 10 s clip at 3x the 5 s price; pro-backend prices it that way, so this row
|
|
5207
|
+
// must not offer 10 s before that pricing is deployed (ENG-3324).
|
|
5206
5208
|
id: "ray-3.2",
|
|
5207
5209
|
aliases: [],
|
|
5208
5210
|
label: "Ray 3.2",
|
|
@@ -5214,7 +5216,7 @@ var LUMA_VIDEO_MODELS = [
|
|
|
5214
5216
|
constraints: {
|
|
5215
5217
|
aspectRatios: ["adaptive", ...RAY_RATIOS],
|
|
5216
5218
|
resolutions: [...RAY_RESOLUTIONS],
|
|
5217
|
-
durations: [5],
|
|
5219
|
+
durations: [5, 10],
|
|
5218
5220
|
supports: ["lastFrame"],
|
|
5219
5221
|
prompt: { ...RAY_PROMPT },
|
|
5220
5222
|
audio: "never"
|
|
@@ -5224,7 +5226,7 @@ var LUMA_VIDEO_MODELS = [
|
|
|
5224
5226
|
pricingKind: "video_per_second",
|
|
5225
5227
|
display: {
|
|
5226
5228
|
provider: "luma",
|
|
5227
|
-
description: "Luma Ray 3.2 text- and image-to-video with optional first and last frames, 5-second clips at up to 1080p.",
|
|
5229
|
+
description: "Luma Ray 3.2 text- and image-to-video with optional first and last frames, 5- or 10-second clips at up to 1080p.",
|
|
5228
5230
|
logo: LUMA_LOGO2
|
|
5229
5231
|
},
|
|
5230
5232
|
capabilities: {}
|