No project description provided
Project description
Bedrock Bot
This project is a basic CLI-based chat bot that uses Bedrock to resolve questions. It can take input from stdin, CLI arguments or interactively when no parameters have been passed.
Installation
pip install bedrock-bot
- You will also need some AWS credentials available in your shell (any usual way works - CLI configured IAM user access key/secret keys, environment variables, etc)
- Bedrock requires you to opt in to models in order to use them
Usage
bedrock --help
Usage: bedrock [OPTIONS] [ARGS]...
Options:
-r, --region TEXT The AWS region to use for requests
-m, --model [Claude-3-Haiku|Claude-3-Sonnet]
The model to use for requests
--help Show this message and exit.
Directly as a chat bot:
$ bedrock
Hello! I am an AI assistant powered by Amazon Bedrock and using the model Claude-3-Haiku. Enter 'quit' or 'exit' at any time to exit. How may I help you today?
(You can clear existing context by starting a query with 'new>' or 'reset>')
> Hi, what is your name?
My name is Claude.
Using CLI arguments:
$ bedrock "Hi, what is your name?"
Hello! I am an AI assistant powered by Amazon Bedrock and using the model Claude-3-Haiku. Enter 'quit' or 'exit' at any time to exit. How may I help you today?
(You can clear existing context by starting a query with 'new>' or 'reset>')
> Hi, what is your name?
My name is Claude. It's nice to meet you!
Using stdin (Note that you can only use this for one-shot questions as input is reserved by your pipe to stdin and is not an interactive TTY any more):
$ echo "Hi, what is your name?" > input-file
$ cat input-file | bedrock
Hello! I am an AI assistant powered by Amazon Bedrock and using the model Claude-3-Haiku. Enter 'quit' or 'exit' at any time to exit. How may I help you today?
(You can clear existing context by starting a query with 'new>' or 'reset>')
> Hi, what is your name?
My name is Claude. I'm an AI created by Anthropic. It's nice to meet you!
Note that you can only do one-shot requests when providing input via stdin
Shell auto-complete
Shell auto-complete is also supported.
ZSH
_BEDROCK_COMPLETE=zsh_source bedrock > ~/.bedrock-completion.zsh
- Add the following to your
~/.zshrc
:source ~/.bedrock-completion.zsh
Bash
_BEDROCK_COMPLETE=bash_source bedrock > ~/.bedrock-completion.bash
- Add the following to your
~/.bashrc
:source ~/.bedrock-completion.bash
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bedrock_bot-1.0.2.tar.gz
(4.2 kB
view details)
Built Distribution
File details
Details for the file bedrock_bot-1.0.2.tar.gz
.
File metadata
- Download URL: bedrock_bot-1.0.2.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.14 Linux/6.5.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3146356fb07f45718cba4774b2cfde73c712a3cdc13a762ade141c0337c6414e |
|
MD5 | 832992f923cf722999a611a0f17d024f |
|
BLAKE2b-256 | 2a253b9ba92959fe338ade14751756e11f0adfacca104d2b80d8baf72922cf69 |
File details
Details for the file bedrock_bot-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: bedrock_bot-1.0.2-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.10.14 Linux/6.5.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21aa019ec7b2e495d350f6851304a7323c6df9134cd0d69ffdac327f783ce2da |
|
MD5 | 111ce6d89b8efadbf72dd41893efbbbe |
|
BLAKE2b-256 | cf8fe12ebaf7dc273f84c61b67c60b134016c3b87d4d339be48b004570900efe |