@shop-os/modelkit 0.32.0 → 0.33.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
@@ -5158,6 +5158,22 @@ var TEXT_MODELS = [
5158
5158
  contextWindow: 1e6
5159
5159
  }
5160
5160
  }),
5161
+ text("claude-sonnet-5-5", "Claude Sonnet 5.5", "claude-sonnet-5-5", {
5162
+ exposure: [],
5163
+ // Sonnet 5.5 rejects a forced tool_choice, which is how Bedrock's SDK asks for JSON on Sonnet 5.
5164
+ providerOptions: { modelkit: { structuredOutputMode: "outputFormat" } },
5165
+ display: {
5166
+ chat: { providerOptions: ANTHROPIC_ADAPTIVE },
5167
+ provider: "anthropic",
5168
+ costTier: 3,
5169
+ description: "Anthropic Claude Sonnet 5.5 balanced model; text and image input, 1M-token context."
5170
+ },
5171
+ capabilities: {
5172
+ reasoning: true,
5173
+ vision: true,
5174
+ contextWindow: 1e6
5175
+ }
5176
+ }),
5161
5177
  text("claude-opus-4-8", "Claude Opus 4.8", "claude-opus-4-8", {
5162
5178
  exposure: ["cowork", "space_builder"],
5163
5179
  aliases: ["claude-opus-4.8", "claude-opus-4", "claude-opus-4.0", "claude-opus-4-20250514"],
@@ -9311,9 +9327,20 @@ function missingKey(ctx, name) {
9311
9327
  }
9312
9328
  function bedrockMiddleware(ctx, canonicalModelId) {
9313
9329
  let warned = false;
9330
+ const structuredOutputMode = ctx.model.providerOptions?.["modelkit"]?.["structuredOutputMode"];
9314
9331
  return {
9315
9332
  specificationVersion: "v3",
9316
- transformParams: async ({ params }) => {
9333
+ transformParams: async ({ params: incoming }) => {
9334
+ const params = typeof structuredOutputMode === "string" && incoming.responseFormat?.type === "json" && incoming.providerOptions?.["anthropic"]?.["structuredOutputMode"] === void 0 ? {
9335
+ ...incoming,
9336
+ providerOptions: {
9337
+ ...incoming.providerOptions,
9338
+ anthropic: {
9339
+ ...incoming.providerOptions?.["anthropic"],
9340
+ structuredOutputMode
9341
+ }
9342
+ }
9343
+ } : incoming;
9317
9344
  const anthropic = params.providerOptions?.["anthropic"];
9318
9345
  if (typeof anthropic !== "object" || anthropic === null || !("cacheControl" in anthropic))
9319
9346
  return params;