@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.js CHANGED
@@ -1355,6 +1355,7 @@ var LLMGatewayChatLanguageModel = class {
1355
1355
  tools,
1356
1356
  toolChoice
1357
1357
  }) {
1358
+ var _a15;
1358
1359
  const baseArgs = __spreadValues(__spreadValues({
1359
1360
  // model id:
1360
1361
  model: this.modelId,
@@ -1383,6 +1384,19 @@ var LLMGatewayChatLanguageModel = class {
1383
1384
  usage: this.settings.usage
1384
1385
  }, this.config.extraBody), this.settings.extraBody);
1385
1386
  if ((responseFormat == null ? void 0 : responseFormat.type) === "json") {
1387
+ if ("schema" in responseFormat && responseFormat.schema) {
1388
+ return __spreadProps(__spreadValues({}, baseArgs), {
1389
+ response_format: {
1390
+ type: "json_schema",
1391
+ json_schema: {
1392
+ name: responseFormat.schema.name || "response",
1393
+ description: responseFormat.schema.description,
1394
+ schema: responseFormat.schema,
1395
+ strict: (_a15 = responseFormat.schema.strict) != null ? _a15 : true
1396
+ }
1397
+ }
1398
+ });
1399
+ }
1386
1400
  return __spreadProps(__spreadValues({}, baseArgs), {
1387
1401
  response_format: { type: "json_object" }
1388
1402
  });