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.6.tar.gz
(4.4 kB
view details)
Built Distribution
File details
Details for the file bedrock_bot-1.0.6.tar.gz
.
File metadata
- Download URL: bedrock_bot-1.0.6.tar.gz
- Upload date:
- Size: 4.4 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 | ba9a24fcb5b1bb3b6ecf61ab0b5292d47794dd546e020be0ab8edce812e15596 |
|
MD5 | f51ac94926659d1a1d9b04bf59a1fb1d |
|
BLAKE2b-256 | c4e85f408401b1650d32385646cfb3fe87a6220301383b151857daad35fe6f0f |
File details
Details for the file bedrock_bot-1.0.6-py3-none-any.whl
.
File metadata
- Download URL: bedrock_bot-1.0.6-py3-none-any.whl
- Upload date:
- Size: 5.9 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 | be1c8484b4f22e624f8e27b92a1ccb095e152e28f78d98c43afbd806777cddcf |
|
MD5 | 80fe710d1a0942d817b1e3767c44cd6e |
|
BLAKE2b-256 | 81d2a78b371b1b2a508ed85a978cf17329bf820f41c1be217907c52fa0f56076 |