@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.mjs CHANGED
@@ -3494,7 +3494,7 @@ var OpenRouterChatLanguageModel = class {
3494
3494
  this.supportedUrls = {
3495
3495
  "image/*": [
3496
3496
  /^data:image\/[a-zA-Z]+;base64,/,
3497
- /^https?:\/\/.+\.(jpg|jpeg|png|gif|webp)$/i
3497
+ /^https?:\/\/.+\.(jpg|jpeg|png|gif|webp)(?:[?#].*)?$/i
3498
3498
  ],
3499
3499
  // 'text/*': [/^data:text\//, /^https?:\/\/.+$/],
3500
3500
  "application/*": [/^data:application\//, /^https?:\/\/.+$/]
@@ -3517,7 +3517,7 @@ var OpenRouterChatLanguageModel = class {
3517
3517
  tools,
3518
3518
  toolChoice
3519
3519
  }) {
3520
- var _a16, _b16;
3520
+ var _a16, _b16, _c, _d;
3521
3521
  const baseArgs = __spreadValues(__spreadValues({
3522
3522
  // model id:
3523
3523
  model: this.modelId,
@@ -3540,8 +3540,8 @@ var OpenRouterChatLanguageModel = class {
3540
3540
  type: "json_schema",
3541
3541
  json_schema: __spreadValues({
3542
3542
  schema: responseFormat.schema,
3543
- strict: true,
3544
- name: (_a16 = responseFormat.name) != null ? _a16 : "response"
3543
+ strict: (_b16 = (_a16 = this.settings.structuredOutputs) == null ? void 0 : _a16.strict) != null ? _b16 : true,
3544
+ name: (_c = responseFormat.name) != null ? _c : "response"
3545
3545
  }, responseFormat.description && {
3546
3546
  description: responseFormat.description
3547
3547
  })
@@ -3567,7 +3567,7 @@ var OpenRouterChatLanguageModel = class {
3567
3567
  const mappedTools = [];
3568
3568
  for (const tool2 of tools) {
3569
3569
  if (tool2.type === "function") {
3570
- const openrouterOptions = (_b16 = tool2.providerOptions) == null ? void 0 : _b16.openrouter;
3570
+ const openrouterOptions = (_d = tool2.providerOptions) == null ? void 0 : _d.openrouter;
3571
3571
  const eagerInputStreaming = openrouterOptions == null ? void 0 : openrouterOptions.eager_input_streaming;
3572
3572
  mappedTools.push(__spreadValues({
3573
3573
  type: "function",
@@ -4136,7 +4136,7 @@ var OpenRouterChatLanguageModel = class {
4136
4136
  id: toolCall.id,
4137
4137
  delta: (_s = toolCallDelta.function.arguments) != null ? _s : ""
4138
4138
  });
4139
- if (((_t = toolCall.function) == null ? void 0 : _t.name) != null && ((_u = toolCall.function) == null ? void 0 : _u.arguments) != null && isParsableJson(toolCall.function.arguments)) {
4139
+ 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)) {
4140
4140
  controller.enqueue({
4141
4141
  type: "tool-input-end",
4142
4142
  id: toolCall.id
@@ -4442,7 +4442,7 @@ var OpenRouterCompletionLanguageModel = class {
4442
4442
  this.supportedUrls = {
4443
4443
  "image/*": [
4444
4444
  /^data:image\/[a-zA-Z]+;base64,/,
4445
- /^https?:\/\/.+\.(jpg|jpeg|png|gif|webp)$/i
4445
+ /^https?:\/\/.+\.(jpg|jpeg|png|gif|webp)(?:[?#].*)?$/i
4446
4446
  ],
4447
4447
  "text/*": [/^data:text\//, /^https?:\/\/.+$/],
4448
4448
  "application/*": [/^data:application\//, /^https?:\/\/.+$/]
@@ -5068,7 +5068,7 @@ function withUserAgentSuffix2(headers, ...userAgentSuffixParts) {
5068
5068
  }
5069
5069
 
5070
5070
  // src/version.ts
5071
- var VERSION2 = false ? "0.0.0-test" : "2.8.1";
5071
+ var VERSION2 = false ? "0.0.0-test" : "2.9.0";
5072
5072
 
5073
5073
  // src/video/schemas.ts
5074
5074
  import { z as z12 } from "zod/v4";