@openrouter/ai-sdk-provider 1.0.0-beta.6 → 1.0.0-beta.7
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/README.md +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -2
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +1 -1
- package/dist/internal/index.d.ts +1 -1
- package/dist/internal/index.js +12 -2
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +12 -2
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/internal/index.mjs
CHANGED
|
@@ -1275,6 +1275,7 @@ var OpenRouterChatLanguageModel = class {
|
|
|
1275
1275
|
tools,
|
|
1276
1276
|
toolChoice
|
|
1277
1277
|
}) {
|
|
1278
|
+
var _a15;
|
|
1278
1279
|
const baseArgs = __spreadValues(__spreadValues({
|
|
1279
1280
|
// model id:
|
|
1280
1281
|
model: this.modelId,
|
|
@@ -1302,9 +1303,18 @@ var OpenRouterChatLanguageModel = class {
|
|
|
1302
1303
|
reasoning: this.settings.reasoning,
|
|
1303
1304
|
usage: this.settings.usage
|
|
1304
1305
|
}, this.config.extraBody), this.settings.extraBody);
|
|
1305
|
-
if ((responseFormat == null ? void 0 : responseFormat.type) === "json") {
|
|
1306
|
+
if ((responseFormat == null ? void 0 : responseFormat.type) === "json" && responseFormat.schema != null) {
|
|
1306
1307
|
return __spreadProps(__spreadValues({}, baseArgs), {
|
|
1307
|
-
response_format: {
|
|
1308
|
+
response_format: {
|
|
1309
|
+
type: "json_schema",
|
|
1310
|
+
json_schema: __spreadValues({
|
|
1311
|
+
schema: responseFormat.schema,
|
|
1312
|
+
strict: true,
|
|
1313
|
+
name: (_a15 = responseFormat.name) != null ? _a15 : "response"
|
|
1314
|
+
}, responseFormat.description && {
|
|
1315
|
+
description: responseFormat.description
|
|
1316
|
+
})
|
|
1317
|
+
}
|
|
1308
1318
|
});
|
|
1309
1319
|
}
|
|
1310
1320
|
if (tools && tools.length > 0) {
|