Cut off the text as soon as any stop words occur.
Check if all requirements for Anthropic count_tokens() are met.
Get the number of tokens in a string of text.
Get the token IDs for a string of text.
Helper function to validate AWS credentials and create an AWS client.
Create a BedrockRuntimeClient from aws-sdk-bedrock-runtime.
This mirrors create_aws_client but targets the smithy-based
aws-sdk-bedrock-runtime package required for bidirectional streaming
APIs (e.g. Nova Sonic).
Check if the thinking parameter is enabled in the request.
Trim trailing whitespace from final AIMessage content.