@llmgateway/ai-sdk-provider 2.1.1 → 2.2.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
@@ -1320,6 +1320,7 @@ var LLMGatewayChatLanguageModel = class {
1320
1320
  tools,
1321
1321
  toolChoice
1322
1322
  }) {
1323
+ var _a15;
1323
1324
  const baseArgs = __spreadValues(__spreadValues({
1324
1325
  // model id:
1325
1326
  model: this.modelId,
@@ -1348,6 +1349,19 @@ var LLMGatewayChatLanguageModel = class {
1348
1349
  usage: this.settings.usage
1349
1350
  }, this.config.extraBody), this.settings.extraBody);
1350
1351
  if ((responseFormat == null ? void 0 : responseFormat.type) === "json") {
1352
+ if ("schema" in responseFormat && responseFormat.schema) {
1353
+ return __spreadProps(__spreadValues({}, baseArgs), {
1354
+ response_format: {
1355
+ type: "json_schema",
1356
+ json_schema: {
1357
+ name: responseFormat.schema.name || "response",
1358
+ description: responseFormat.schema.description,
1359
+ schema: responseFormat.schema,
1360
+ strict: (_a15 = responseFormat.schema.strict) != null ? _a15 : true
1361
+ }
1362
+ }
1363
+ });
1364
+ }
1351
1365
  return __spreadProps(__spreadValues({}, baseArgs), {
1352
1366
  response_format: { type: "json_object" }
1353
1367
  });