144 lines
6.2 KiB
Diff
144 lines
6.2 KiB
Diff
diff --git a/dist/index.d.mts b/dist/index.d.mts
|
|
index d194ae227fd1223ba44c8c5157b1bb72b1bab273..2e046db0a365c27659ffcec08782c7c26845c1fa 100644
|
|
--- a/dist/index.d.mts
|
|
+++ b/dist/index.d.mts
|
|
@@ -61,6 +61,12 @@ declare const amazonBedrockLanguageModelOptions: z.ZodObject<{
|
|
omitted: "omitted";
|
|
summarized: "summarized";
|
|
}>>;
|
|
+ blockBinding: z.ZodOptional<z.ZodObject<{
|
|
+ prefixMismatchBehavior: z.ZodEnum<{
|
|
+ error: "error";
|
|
+ drop_block: "drop_block";
|
|
+ }>;
|
|
+ }, z.core.$strip>>;
|
|
}, z.core.$strip>>;
|
|
anthropicBeta: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
serviceTier: z.ZodOptional<z.ZodEnum<{
|
|
diff --git a/dist/index.d.ts b/dist/index.d.ts
|
|
index d194ae227fd1223ba44c8c5157b1bb72b1bab273..2e046db0a365c27659ffcec08782c7c26845c1fa 100644
|
|
--- a/dist/index.d.ts
|
|
+++ b/dist/index.d.ts
|
|
@@ -61,6 +61,12 @@ declare const amazonBedrockLanguageModelOptions: z.ZodObject<{
|
|
omitted: "omitted";
|
|
summarized: "summarized";
|
|
}>>;
|
|
+ blockBinding: z.ZodOptional<z.ZodObject<{
|
|
+ prefixMismatchBehavior: z.ZodEnum<{
|
|
+ error: "error";
|
|
+ drop_block: "drop_block";
|
|
+ }>;
|
|
+ }, z.core.$strip>>;
|
|
}, z.core.$strip>>;
|
|
anthropicBeta: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
serviceTier: z.ZodOptional<z.ZodEnum<{
|
|
diff --git a/dist/index.js b/dist/index.js
|
|
index 2047c91971c23f72dd3cd0c069614f37a30e45f3..9e9ccc26b711eb9ad2722bf1dd4b2e931e528776 100644
|
|
--- a/dist/index.js
|
|
+++ b/dist/index.js
|
|
@@ -95,7 +95,10 @@ var amazonBedrockLanguageModelOptions = import_v4.z.object({
|
|
]).optional(),
|
|
budgetTokens: import_v4.z.number().optional(),
|
|
maxReasoningEffort: import_v4.z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
- display: import_v4.z.enum(["omitted", "summarized"]).optional()
|
|
+ display: import_v4.z.enum(["omitted", "summarized"]).optional(),
|
|
+ blockBinding: import_v4.z.object({
|
|
+ prefixMismatchBehavior: import_v4.z.enum(["error", "drop_block"])
|
|
+ }).optional()
|
|
}).optional(),
|
|
/**
|
|
* Anthropic beta features to enable
|
|
@@ -1020,6 +1023,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;
|
|
@@ -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..000114dfe76cba25ddfe693f042232810026c229 100644
|
|
--- a/dist/index.mjs
|
|
+++ b/dist/index.mjs
|
|
@@ -84,7 +84,10 @@ var amazonBedrockLanguageModelOptions = z.object({
|
|
]).optional(),
|
|
budgetTokens: z.number().optional(),
|
|
maxReasoningEffort: z.enum(["low", "medium", "high", "xhigh", "max"]).optional(),
|
|
- display: z.enum(["omitted", "summarized"]).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
|
|
+ }
|
|
+ }
|
|
}
|
|
};
|
|
}
|