This is a Telegram bot that intereacts with Anthropic Claude and Google Bard.
If you only have access to one of the models, you can still continue to use this bot. Some functions may be limited due to lack of authorization for the other model.
Claude | Bard |
---|---|
✅ Streaming output Access to the Internet |
Streaming output ✅ Access to the Internet |
Clone this repository.
Configure the bot in the following two ways:
Create config/config.yml
and fill in the information with reference to config/config.example.yml
.
or Set environment variables:
export BOT_TOKEN="your bot token"
export USER_IDS="user_id1, user_id2,..."
export CLAUDE_API="your claude api" # ignore it if you don't want to use claude
export BARD_API="__Secure-1PSID, __Secure-1PSIDTS" # ignore it if you don't want to use bard
Start the bot in the following two ways:
Docker (with docker engine pre-installed):
docker compose up
or Scripts (with python >= 3.8 and python3-venv pre-installed):
# create the virtual environment
bash scripts/setup.sh
# start the bot
bash scripts/run.sh
/id
: get your chat identifier/start
: start the bot and get help message/help
: get help message/reset
: reset the chat history/settings
: show Claude & Bard settings/mode
: switch between Claude and Bard/model NAME
: change model (Claude only)
/temp VALUE
: set temperature (Claude only)
/cutoff VALUE
: adjust cutoff (Claude only)
/seg
: send messages in segments, example below:
/seg
first/seg
again/retry
: regenerate the answer. Use /retry TEXT
to modify your last input. View other drafts
: click to see other drafts (Bard Only)? Google it
: click to view the search results (Bard Only)This code is based on Lakr233's ChatBot-TGLM6B.
The client library for Claude API is anthropics's anthropic-sdk-python.
The client library for Bard API is acheong08's Bard.
Huge thanks to them!!! ???