@axlsdk/studio 0.23.1 → 0.23.3

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.
@@ -1337,21 +1337,32 @@ var executions_default = createExecutionRoutes();
1337
1337
 
1338
1338
  // src/server/routes/sessions.ts
1339
1339
  import { Hono as Hono4 } from "hono";
1340
+ function mediaFields(source) {
1341
+ const bytes = source.type === "bytes" ? source.data.byteLength : source.type === "base64" ? Math.floor(source.data.length * 3 / 4) - (source.data.endsWith("==") ? 2 : source.data.endsWith("=") ? 1 : 0) : void 0;
1342
+ return {
1343
+ source: source.type,
1344
+ ...source.mediaType ? { mediaType: source.mediaType } : {},
1345
+ ...bytes !== void 0 ? { bytes } : {}
1346
+ };
1347
+ }
1340
1348
  function describeStudioInput(content) {
1341
1349
  if (typeof content === "string") return void 0;
1342
1350
  return {
1343
1351
  parts: content.map((part) => {
1344
- if (part.type === "text") return { type: "text", characters: part.text.length };
1345
- const { source } = part;
1346
- const bytes = source.type === "bytes" ? source.data.byteLength : source.type === "base64" ? Math.floor(source.data.length * 3 / 4) - (source.data.endsWith("==") ? 2 : source.data.endsWith("=") ? 1 : 0) : void 0;
1347
- return {
1348
- type: "image",
1349
- source: source.type,
1350
- ...source.mediaType ? { mediaType: source.mediaType } : {},
1351
- ...bytes !== void 0 ? { bytes } : {}
1352
- // URLs, provider-file references, and labels are intentionally not
1353
- // included: this is a Studio-safe descriptor, not a replay payload.
1354
- };
1352
+ switch (part.type) {
1353
+ case "text":
1354
+ return { type: "text", characters: part.text.length };
1355
+ case "image":
1356
+ return { type: "image", ...mediaFields(part.source) };
1357
+ case "audio":
1358
+ return { type: "audio", ...mediaFields(part.source) };
1359
+ default: {
1360
+ const unreachable = part;
1361
+ throw new Error(
1362
+ `unsupported model input part: ${String(unreachable.type)}`
1363
+ );
1364
+ }
1365
+ }
1355
1366
  })
1356
1367
  };
1357
1368
  }
@@ -16461,4 +16472,4 @@ export {
16461
16472
  EvalAggregator,
16462
16473
  createServer
16463
16474
  };
16464
- //# sourceMappingURL=chunk-Z374DI7D.js.map
16475
+ //# sourceMappingURL=chunk-XK2DRXKB.js.map