@openrouter/ai-sdk-provider 1.4.0 → 1.4.1

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.
@@ -1563,7 +1563,16 @@ var OpenRouterChatLanguageModel = class {
1563
1563
  presence_penalty: presencePenalty,
1564
1564
  seed,
1565
1565
  stop: stopSequences,
1566
- response_format: responseFormat,
1566
+ response_format: (responseFormat == null ? void 0 : responseFormat.type) === "json" ? responseFormat.schema != null ? {
1567
+ type: "json_schema",
1568
+ json_schema: __spreadValues({
1569
+ schema: responseFormat.schema,
1570
+ strict: true,
1571
+ name: (_a15 = responseFormat.name) != null ? _a15 : "response"
1572
+ }, responseFormat.description && {
1573
+ description: responseFormat.description
1574
+ })
1575
+ } : { type: "json_object" } : void 0,
1567
1576
  top_k: topK,
1568
1577
  // messages:
1569
1578
  messages: convertToOpenRouterChatMessages(prompt),
@@ -1579,20 +1588,6 @@ var OpenRouterChatLanguageModel = class {
1579
1588
  // Debug settings:
1580
1589
  debug: this.settings.debug
1581
1590
  }, this.config.extraBody), this.settings.extraBody);
1582
- if ((responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null) {
1583
- return __spreadProps(__spreadValues({}, baseArgs), {
1584
- response_format: {
1585
- type: "json_schema",
1586
- json_schema: __spreadValues({
1587
- schema: responseFormat.schema,
1588
- strict: true,
1589
- name: (_a15 = responseFormat.name) != null ? _a15 : "response"
1590
- }, responseFormat.description && {
1591
- description: responseFormat.description
1592
- })
1593
- }
1594
- });
1595
- }
1596
1591
  if (tools && tools.length > 0) {
1597
1592
  const mappedTools = tools.filter(
1598
1593
  (tool) => tool.type === "function"