A simple command-line interface for demonstrating AWS Bedrock capabilities, particularly focused on interacting with Claude 3 Sonnet.
- Ruby
- AWS CLI configured with SSO access
- AWS account with Bedrock access
- Clone this repository
- Install dependencies:
bundle install
Ensure you have AWS SSO configured. If you haven't logged in recently, run:
aws sso login
The CLI currently supports the following commands:
Test your Bedrock connection with a simple completion using Claude 3 Sonnet:
❯ ./bin/bedrock-demo hello
Greetings, terrestrial orb of diverse life forms!
This command will:
- Verify your AWS SSO session
- Connect to Bedrock
- Generate an interesting variation of "hello, world!" using Claude 3 Sonnet
- Stream the response to your terminal
If your SSO session has expired, the tool will automatically attempt to refresh it.
The tool includes built-in error handling for:
- Expired SSO sessions (with automatic renewal attempt)
- Bedrock service errors
- thor
- aws-sdk-bedrockruntime
- aws-sdk-bedrock