diff --git a/dist/index.d.mts b/dist/index.d.mts index d194ae227fd1223ba44c8c5157b1bb72b1bab273..db7fdb1b6f4e617baa40539ccef718735d2e9e81 100644 --- a/dist/index.d.mts +++ b/dist/index.d.mts @@ -51,6 +51,7 @@ declare const amazonBedrockLanguageModelOptions: z.ZodObject<{ type: z.ZodOptional, z.ZodLiteral<"disabled">, z.ZodLiteral<"adaptive">]>>; budgetTokens: z.ZodOptional; maxReasoningEffort: z.ZodOptional>; + blockBinding: z.ZodOptional; + }, z.core.$strip>>; }, z.core.$strip>>; anthropicBeta: z.ZodOptional>; serviceTier: z.ZodOptional, z.ZodLiteral<"disabled">, z.ZodLiteral<"adaptive">]>>; budgetTokens: z.ZodOptional; maxReasoningEffort: z.ZodOptional>; + blockBinding: z.ZodOptional; + }, z.core.$strip>>; }, z.core.$strip>>; anthropicBeta: z.ZodOptional>; serviceTier: z.ZodOptional 0 || bedrockOptions.anthropicBeta) { const existingBetas = (_g = bedrockOptions.anthropicBeta) != null ? _g : []; const mergedBetas = betas.size > 0 ? [...existingBetas, ...Array.from(betas)] : existingBetas; @@ -1050,7 +1057,12 @@ var BedrockChatLanguageModel = class { ...bedrockOptions.additionalModelRequestFields, thinking: { type: "enabled", - budget_tokens: thinkingBudget + budget_tokens: thinkingBudget, + ...thinkingBlockBinding != null && { + block_binding: { + prefix_mismatch_behavior: thinkingBlockBinding.prefixMismatchBehavior + } + } } }; } else if (thinkingType === "adaptive") { @@ -1058,7 +1070,12 @@ var BedrockChatLanguageModel = class { ...bedrockOptions.additionalModelRequestFields, thinking: { type: "adaptive", - ...thinkingDisplay != null && { display: thinkingDisplay } + ...thinkingDisplay != null && { display: thinkingDisplay }, + ...thinkingBlockBinding != null && { + block_binding: { + prefix_mismatch_behavior: thinkingBlockBinding.prefixMismatchBehavior + } + } } }; } diff --git a/dist/index.mjs b/dist/index.mjs index 5a669504cb3b21f20788956bc9c22529c1498c35..bcbcd768759a4e412657795d6db75e21d4e64c09 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -83,8 +83,11 @@ var amazonBedrockLanguageModelOptions = z.object({ z.literal("adaptive") ]).optional(), budgetTokens: z.number().optional(), - maxReasoningEffort: z.enum(["low", "medium", "high", "xhigh", "max"]).optional(), - display: z.enum(["omitted", "summarized"]).optional() + maxReasoningEffort: z.enum(["none", "low", "medium", "high", "xhigh", "max"]).optional(), + display: z.enum(["omitted", "summarized"]).optional(), + blockBinding: z.object({ + prefixMismatchBehavior: z.enum(["error", "drop_block"]) + }).optional() }).optional(), /** * Anthropic beta features to enable @@ -1024,6 +1027,10 @@ var BedrockChatLanguageModel = class { ...additionalTools }; } + const thinkingBlockBinding = isAnthropicModel && isThinkingEnabled ? (bedrockOptions.reasoningConfig == null ? void 0 : bedrockOptions.reasoningConfig.blockBinding) : void 0; + if (thinkingBlockBinding != null) { + betas.add("thinking-binding-controls-2026-08-01"); + } if (betas.size > 0 || bedrockOptions.anthropicBeta) { const existingBetas = (_g = bedrockOptions.anthropicBeta) != null ? _g : []; const mergedBetas = betas.size > 0 ? [...existingBetas, ...Array.from(betas)] : existingBetas; @@ -1054,7 +1061,12 @@ var BedrockChatLanguageModel = class { ...bedrockOptions.additionalModelRequestFields, thinking: { type: "enabled", - budget_tokens: thinkingBudget + budget_tokens: thinkingBudget, + ...thinkingBlockBinding != null && { + block_binding: { + prefix_mismatch_behavior: thinkingBlockBinding.prefixMismatchBehavior + } + } } }; } else if (thinkingType === "adaptive") { @@ -1062,7 +1074,12 @@ var BedrockChatLanguageModel = class { ...bedrockOptions.additionalModelRequestFields, thinking: { type: "adaptive", - ...thinkingDisplay != null && { display: thinkingDisplay } + ...thinkingDisplay != null && { display: thinkingDisplay }, + ...thinkingBlockBinding != null && { + block_binding: { + prefix_mismatch_behavior: thinkingBlockBinding.prefixMismatchBehavior + } + } } }; }