@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.
@@ -1310,6 +1310,7 @@ var LLMGatewayChatLanguageModel = class {
1310
1310
  tools,
1311
1311
  toolChoice
1312
1312
  }) {
1313
+ var _a15;
1313
1314
  const baseArgs = __spreadValues(__spreadValues({
1314
1315
  // model id:
1315
1316
  model: this.modelId,
@@ -1338,6 +1339,19 @@ var LLMGatewayChatLanguageModel = class {
1338
1339
  usage: this.settings.usage
1339
1340
  }, this.config.extraBody), this.settings.extraBody);
1340
1341
  if ((responseFormat == null ? void 0 : responseFormat.type) === "json") {
1342
+ if ("schema" in responseFormat && responseFormat.schema) {
1343
+ return __spreadProps(__spreadValues({}, baseArgs), {
1344
+ response_format: {
1345
+ type: "json_schema",
1346
+ json_schema: {
1347
+ name: responseFormat.schema.name || "response",
1348
+ description: responseFormat.schema.description,
1349
+ schema: responseFormat.schema,
1350
+ strict: (_a15 = responseFormat.schema.strict) != null ? _a15 : true
1351
+ }
1352
+ }
1353
+ });
1354
+ }
1341
1355
  return __spreadProps(__spreadValues({}, baseArgs), {
1342
1356
  response_format: { type: "json_object" }
1343
1357
  });