AWS bedrock documentation change
Summary
Added documentation for using adaptive thinking with the Converse API, including code examples for the thinking and effort parameters.
Security assessment
The change is purely a feature documentation update for the Converse API, providing code examples for adaptive thinking functionality. There is no mention of security features, vulnerabilities, or security-related changes in the diff.
Diff
diff --git a/bedrock/latest/userguide/claude-messages-adaptive-thinking.md b/bedrock/latest/userguide/claude-messages-adaptive-thinking.md index de5b49a3e..c94d7cc51 100644 --- a//bedrock/latest/userguide/claude-messages-adaptive-thinking.md +++ b//bedrock/latest/userguide/claude-messages-adaptive-thinking.md @@ -7 +7 @@ -How adaptive thinking worksAdaptive thinking with the effort parameterPrompt cachingTuning thinking behavior +How adaptive thinking worksAdaptive thinking with the effort parameterUsing adaptive thinking with the Converse APIPrompt cachingTuning thinking behavior @@ -139,0 +140,41 @@ Effort level | Thinking behavior +## Using adaptive thinking with the Converse API + +When using the [Converse API](./conversation-inference.html), pass the `thinking` and `effort` parameters inside `additionalModelRequestFields`. The following example shows adaptive thinking with the default effort level: + + + import boto3, json + + bedrock_runtime = boto3.client(service_name='bedrock-runtime', region_name='us-east-2') + + response = bedrock_runtime.converse( + modelId="us.anthropic.claude-opus-4-6-v1", + messages=[{ + "role": "user", + "content": [{"text": "Explain why the sum of two even numbers is always even."}] + }], + additionalModelRequestFields={ + "thinking": { + "type": "adaptive" + } + } + ) + + print(json.dumps(response["output"], indent=2, default=str)) + +To specify an effort level, add the `effort` field inside the `thinking` object: + + + response = bedrock_runtime.converse( + modelId="us.anthropic.claude-opus-4-6-v1", + messages=[{ + "role": "user", + "content": [{"text": "What is 2 + 2?"}] + }], + additionalModelRequestFields={ + "thinking": { + "type": "adaptive", + "effort": "low" + } + } + ) +