@llmgateway/ai-sdk-provider 2.1.0 → 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
  });
@@ -1440,7 +1454,9 @@ var LLMGatewayChatLanguageModel = class {
1440
1454
  }
1441
1455
  }
1442
1456
  return null;
1443
- }).filter((p) => p !== null) : choice.message.reasoning ? [
1457
+ }).filter(
1458
+ (p) => p !== null
1459
+ ) : choice.message.reasoning ? [
1444
1460
  {
1445
1461
  type: "reasoning",
1446
1462
  text: choice.message.reasoning