@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.
- package/dist/{chunk-Z374DI7D.js → chunk-XK2DRXKB.js} +23 -12
- package/dist/chunk-XK2DRXKB.js.map +1 -0
- package/dist/cli.cjs +22 -11
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/assets/{index-7nGvwNtb.js → index-DIx_trGA.js} +3 -3
- package/dist/client/index.html +1 -1
- package/dist/middleware.cjs +22 -11
- package/dist/middleware.cjs.map +1 -1
- package/dist/middleware.js +1 -1
- package/dist/server/index.cjs +22 -11
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +1 -1
- package/package.json +4 -4
- package/dist/chunk-Z374DI7D.js.map +0 -1
package/dist/middleware.js
CHANGED
package/dist/server/index.cjs
CHANGED
|
@@ -1369,21 +1369,32 @@ var executions_default = createExecutionRoutes();
|
|
|
1369
1369
|
|
|
1370
1370
|
// src/server/routes/sessions.ts
|
|
1371
1371
|
var import_hono4 = require("hono");
|
|
1372
|
+
function mediaFields(source) {
|
|
1373
|
+
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;
|
|
1374
|
+
return {
|
|
1375
|
+
source: source.type,
|
|
1376
|
+
...source.mediaType ? { mediaType: source.mediaType } : {},
|
|
1377
|
+
...bytes !== void 0 ? { bytes } : {}
|
|
1378
|
+
};
|
|
1379
|
+
}
|
|
1372
1380
|
function describeStudioInput(content) {
|
|
1373
1381
|
if (typeof content === "string") return void 0;
|
|
1374
1382
|
return {
|
|
1375
1383
|
parts: content.map((part) => {
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1384
|
+
switch (part.type) {
|
|
1385
|
+
case "text":
|
|
1386
|
+
return { type: "text", characters: part.text.length };
|
|
1387
|
+
case "image":
|
|
1388
|
+
return { type: "image", ...mediaFields(part.source) };
|
|
1389
|
+
case "audio":
|
|
1390
|
+
return { type: "audio", ...mediaFields(part.source) };
|
|
1391
|
+
default: {
|
|
1392
|
+
const unreachable = part;
|
|
1393
|
+
throw new Error(
|
|
1394
|
+
`unsupported model input part: ${String(unreachable.type)}`
|
|
1395
|
+
);
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1387
1398
|
})
|
|
1388
1399
|
};
|
|
1389
1400
|
}
|