@openrouter/ai-sdk-provider 1.0.0-beta.4 → 1.0.0-beta.5
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/index.js +16 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -17
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +42 -43
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +42 -43
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -412,28 +412,28 @@ var EventSourceParserStream = class extends TransformStream {
|
|
|
412
412
|
}
|
|
413
413
|
};
|
|
414
414
|
|
|
415
|
-
// node_modules/.pnpm/@ai-sdk+provider-utils@3.0.0-beta.5_zod@
|
|
415
|
+
// node_modules/.pnpm/@ai-sdk+provider-utils@3.0.0-beta.5_zod@3.25.76/node_modules/@ai-sdk/provider-utils/dist/index.mjs
|
|
416
416
|
import * as z4 from "zod/v4";
|
|
417
417
|
|
|
418
|
-
// node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@
|
|
418
|
+
// node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
419
419
|
var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
420
420
|
|
|
421
|
-
// node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@
|
|
421
|
+
// node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js
|
|
422
422
|
import { ZodFirstPartyTypeKind as ZodFirstPartyTypeKind3 } from "zod";
|
|
423
423
|
|
|
424
|
-
// node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@
|
|
424
|
+
// node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js
|
|
425
425
|
import { ZodFirstPartyTypeKind } from "zod";
|
|
426
426
|
|
|
427
|
-
// node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@
|
|
427
|
+
// node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js
|
|
428
428
|
import { ZodFirstPartyTypeKind as ZodFirstPartyTypeKind2 } from "zod";
|
|
429
429
|
|
|
430
|
-
// node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@
|
|
430
|
+
// node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js
|
|
431
431
|
var ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
|
|
432
432
|
|
|
433
|
-
// node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@
|
|
433
|
+
// node_modules/.pnpm/zod-to-json-schema@3.24.5_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js
|
|
434
434
|
import { ZodOptional } from "zod";
|
|
435
435
|
|
|
436
|
-
// node_modules/.pnpm/@ai-sdk+provider-utils@3.0.0-beta.5_zod@
|
|
436
|
+
// node_modules/.pnpm/@ai-sdk+provider-utils@3.0.0-beta.5_zod@3.25.76/node_modules/@ai-sdk/provider-utils/dist/index.mjs
|
|
437
437
|
function combineHeaders(...headers) {
|
|
438
438
|
return headers.reduce(
|
|
439
439
|
(combinedHeaders, currentHeaders) => __spreadValues(__spreadValues({}, combinedHeaders), currentHeaders != null ? currentHeaders : {}),
|
|
@@ -1405,15 +1405,13 @@ var OpenRouterChatLanguageModel = class {
|
|
|
1405
1405
|
cachedInputTokens: 0
|
|
1406
1406
|
};
|
|
1407
1407
|
const reasoningDetails = (_i = choice.message.reasoning_details) != null ? _i : [];
|
|
1408
|
-
reasoningDetails.length > 0 ? reasoningDetails.map((detail) => {
|
|
1409
|
-
var _a16;
|
|
1408
|
+
const reasoning = reasoningDetails.length > 0 ? reasoningDetails.map((detail) => {
|
|
1410
1409
|
switch (detail.type) {
|
|
1411
1410
|
case "reasoning.text" /* Text */: {
|
|
1412
1411
|
if (detail.text) {
|
|
1413
1412
|
return {
|
|
1414
|
-
type: "
|
|
1415
|
-
text: detail.text
|
|
1416
|
-
signature: (_a16 = detail.signature) != null ? _a16 : void 0
|
|
1413
|
+
type: "reasoning",
|
|
1414
|
+
text: detail.text
|
|
1417
1415
|
};
|
|
1418
1416
|
}
|
|
1419
1417
|
break;
|
|
@@ -1421,7 +1419,7 @@ var OpenRouterChatLanguageModel = class {
|
|
|
1421
1419
|
case "reasoning.summary" /* Summary */: {
|
|
1422
1420
|
if (detail.summary) {
|
|
1423
1421
|
return {
|
|
1424
|
-
type: "
|
|
1422
|
+
type: "reasoning",
|
|
1425
1423
|
text: detail.summary
|
|
1426
1424
|
};
|
|
1427
1425
|
}
|
|
@@ -1430,8 +1428,8 @@ var OpenRouterChatLanguageModel = class {
|
|
|
1430
1428
|
case "reasoning.encrypted" /* Encrypted */: {
|
|
1431
1429
|
if (detail.data) {
|
|
1432
1430
|
return {
|
|
1433
|
-
type: "
|
|
1434
|
-
|
|
1431
|
+
type: "reasoning",
|
|
1432
|
+
text: "[REDACTED]"
|
|
1435
1433
|
};
|
|
1436
1434
|
}
|
|
1437
1435
|
break;
|
|
@@ -1443,11 +1441,12 @@ var OpenRouterChatLanguageModel = class {
|
|
|
1443
1441
|
return null;
|
|
1444
1442
|
}).filter((p) => p !== null) : choice.message.reasoning ? [
|
|
1445
1443
|
{
|
|
1446
|
-
type: "
|
|
1444
|
+
type: "reasoning",
|
|
1447
1445
|
text: choice.message.reasoning
|
|
1448
1446
|
}
|
|
1449
1447
|
] : [];
|
|
1450
1448
|
const content = [];
|
|
1449
|
+
content.push(...reasoning);
|
|
1451
1450
|
if (choice.message.content) {
|
|
1452
1451
|
content.push({
|
|
1453
1452
|
type: "text",
|