@openrouter/ai-sdk-provider 2.8.1 → 2.9.0
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.d.mts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +19 -0
- package/dist/internal/index.d.ts +19 -0
- package/dist/internal/index.js +7 -7
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +7 -7
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/internal/index.mjs
CHANGED
|
@@ -3419,7 +3419,7 @@ var OpenRouterChatLanguageModel = class {
|
|
|
3419
3419
|
this.supportedUrls = {
|
|
3420
3420
|
"image/*": [
|
|
3421
3421
|
/^data:image\/[a-zA-Z]+;base64,/,
|
|
3422
|
-
/^https?:\/\/.+\.(jpg|jpeg|png|gif|webp)
|
|
3422
|
+
/^https?:\/\/.+\.(jpg|jpeg|png|gif|webp)(?:[?#].*)?$/i
|
|
3423
3423
|
],
|
|
3424
3424
|
// 'text/*': [/^data:text\//, /^https?:\/\/.+$/],
|
|
3425
3425
|
"application/*": [/^data:application\//, /^https?:\/\/.+$/]
|
|
@@ -3442,7 +3442,7 @@ var OpenRouterChatLanguageModel = class {
|
|
|
3442
3442
|
tools,
|
|
3443
3443
|
toolChoice
|
|
3444
3444
|
}) {
|
|
3445
|
-
var _a16, _b16;
|
|
3445
|
+
var _a16, _b16, _c, _d;
|
|
3446
3446
|
const baseArgs = __spreadValues(__spreadValues({
|
|
3447
3447
|
// model id:
|
|
3448
3448
|
model: this.modelId,
|
|
@@ -3465,8 +3465,8 @@ var OpenRouterChatLanguageModel = class {
|
|
|
3465
3465
|
type: "json_schema",
|
|
3466
3466
|
json_schema: __spreadValues({
|
|
3467
3467
|
schema: responseFormat.schema,
|
|
3468
|
-
strict: true,
|
|
3469
|
-
name: (
|
|
3468
|
+
strict: (_b16 = (_a16 = this.settings.structuredOutputs) == null ? void 0 : _a16.strict) != null ? _b16 : true,
|
|
3469
|
+
name: (_c = responseFormat.name) != null ? _c : "response"
|
|
3470
3470
|
}, responseFormat.description && {
|
|
3471
3471
|
description: responseFormat.description
|
|
3472
3472
|
})
|
|
@@ -3492,7 +3492,7 @@ var OpenRouterChatLanguageModel = class {
|
|
|
3492
3492
|
const mappedTools = [];
|
|
3493
3493
|
for (const tool of tools) {
|
|
3494
3494
|
if (tool.type === "function") {
|
|
3495
|
-
const openrouterOptions = (
|
|
3495
|
+
const openrouterOptions = (_d = tool.providerOptions) == null ? void 0 : _d.openrouter;
|
|
3496
3496
|
const eagerInputStreaming = openrouterOptions == null ? void 0 : openrouterOptions.eager_input_streaming;
|
|
3497
3497
|
mappedTools.push(__spreadValues({
|
|
3498
3498
|
type: "function",
|
|
@@ -4061,7 +4061,7 @@ var OpenRouterChatLanguageModel = class {
|
|
|
4061
4061
|
id: toolCall.id,
|
|
4062
4062
|
delta: (_s = toolCallDelta.function.arguments) != null ? _s : ""
|
|
4063
4063
|
});
|
|
4064
|
-
if (((_t = toolCall.function) == null ? void 0 : _t.name) != null && ((_u = toolCall.function) == null ? void 0 : _u.arguments) != null && isParsableJson(toolCall.function.arguments)) {
|
|
4064
|
+
if (!toolCall.sent && ((_t = toolCall.function) == null ? void 0 : _t.name) != null && ((_u = toolCall.function) == null ? void 0 : _u.arguments) != null && isParsableJson(toolCall.function.arguments)) {
|
|
4065
4065
|
controller.enqueue({
|
|
4066
4066
|
type: "tool-input-end",
|
|
4067
4067
|
id: toolCall.id
|
|
@@ -4367,7 +4367,7 @@ var OpenRouterCompletionLanguageModel = class {
|
|
|
4367
4367
|
this.supportedUrls = {
|
|
4368
4368
|
"image/*": [
|
|
4369
4369
|
/^data:image\/[a-zA-Z]+;base64,/,
|
|
4370
|
-
/^https?:\/\/.+\.(jpg|jpeg|png|gif|webp)
|
|
4370
|
+
/^https?:\/\/.+\.(jpg|jpeg|png|gif|webp)(?:[?#].*)?$/i
|
|
4371
4371
|
],
|
|
4372
4372
|
"text/*": [/^data:text\//, /^https?:\/\/.+$/],
|
|
4373
4373
|
"application/*": [/^data:application\//, /^https?:\/\/.+$/]
|