@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.
@@ -1275,6 +1275,7 @@ var LLMGatewayChatLanguageModel = 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,
@@ -1303,6 +1304,19 @@ var LLMGatewayChatLanguageModel = class {
1303
1304
  usage: this.settings.usage
1304
1305
  }, this.config.extraBody), this.settings.extraBody);
1305
1306
  if ((responseFormat == null ? void 0 : responseFormat.type) === "json") {
1307
+ if ("schema" in responseFormat && responseFormat.schema) {
1308
+ return __spreadProps(__spreadValues({}, baseArgs), {
1309
+ response_format: {
1310
+ type: "json_schema",
1311
+ json_schema: {
1312
+ name: responseFormat.schema.name || "response",
1313
+ description: responseFormat.schema.description,
1314
+ schema: responseFormat.schema,
1315
+ strict: (_a15 = responseFormat.schema.strict) != null ? _a15 : true
1316
+ }
1317
+ }
1318
+ });
1319
+ }
1306
1320
  return __spreadProps(__spreadValues({}, baseArgs), {
1307
1321
  response_format: { type: "json_object" }
1308
1322
  });