@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.cjs CHANGED
@@ -5315,6 +5315,22 @@ var TEXT_MODELS = [
5315
5315
  contextWindow: 1e6
5316
5316
  }
5317
5317
  }),
5318
+ text("claude-sonnet-5-5", "Claude Sonnet 5.5", "claude-sonnet-5-5", {
5319
+ exposure: [],
5320
+ // Sonnet 5.5 rejects a forced tool_choice, which is how Bedrock's SDK asks for JSON on Sonnet 5.
5321
+ providerOptions: { modelkit: { structuredOutputMode: "outputFormat" } },
5322
+ display: {
5323
+ chat: { providerOptions: ANTHROPIC_ADAPTIVE },
5324
+ provider: "anthropic",
5325
+ costTier: 3,
5326
+ description: "Anthropic Claude Sonnet 5.5 balanced model; text and image input, 1M-token context."
5327
+ },
5328
+ capabilities: {
5329
+ reasoning: true,
5330
+ vision: true,
5331
+ contextWindow: 1e6
5332
+ }
5333
+ }),
5318
5334
  text("claude-opus-4-8", "Claude Opus 4.8", "claude-opus-4-8", {
5319
5335
  exposure: ["cowork", "space_builder"],
5320
5336
  aliases: ["claude-opus-4.8", "claude-opus-4", "claude-opus-4.0", "claude-opus-4-20250514"],
@@ -9468,9 +9484,20 @@ function missingKey(ctx, name) {
9468
9484
  }
9469
9485
  function bedrockMiddleware(ctx, canonicalModelId) {
9470
9486
  let warned = false;
9487
+ const structuredOutputMode = ctx.model.providerOptions?.["modelkit"]?.["structuredOutputMode"];
9471
9488
  return {
9472
9489
  specificationVersion: "v3",
9473
- transformParams: async ({ params }) => {
9490
+ transformParams: async ({ params: incoming }) => {
9491
+ const params = typeof structuredOutputMode === "string" && incoming.responseFormat?.type === "json" && incoming.providerOptions?.["anthropic"]?.["structuredOutputMode"] === void 0 ? {
9492
+ ...incoming,
9493
+ providerOptions: {
9494
+ ...incoming.providerOptions,
9495
+ anthropic: {
9496
+ ...incoming.providerOptions?.["anthropic"],
9497
+ structuredOutputMode
9498
+ }
9499
+ }
9500
+ } : incoming;
9474
9501
  const anthropic = params.providerOptions?.["anthropic"];
9475
9502
  if (typeof anthropic !== "object" || anthropic === null || !("cacheControl" in anthropic))
9476
9503
  return params;