Claude & Bard Telegram Bot
The Claude & Bard Telegram Bot is an innovative solution designed to bridge user interactions with two advanced AI models: Anthropic Claude and Google Bard. Using Telegram as its platform, it allows users to effortlessly interface with these AI technologies for various purposes.
APIs and Access
To leverage this bot, users require API access to either or both of the models:
- Claude API: Obtainable from the official portal.
- Bard API: Accessible via a reverse-engineering method.
Even if a user only has access to one of the models, the bot remains functional, albeit with some features potentially limited to the available model.
Features
The Claude & Bard Telegram Bot comes packed with several features aimed at enhancing user experience:
-
Claude Model:
- Streaming Output: Provides real-time answer generation.
- Adjustable Settings: Users can modify the model's version and temperature settings to tailor responses.
-
Bard Model:
- Response Variability: Offers toggling between different drafts of an answer.
- Search Integration: Displays reference links and Google search keywords, complete with image viewing capabilities from search results.
-
Additional features common to both models include:
- Partial Markdown support for better message formatting.
- The ability to handle lengthy inputs by dividing them into manageable segments.
- Functions for message resend and answer regeneration.
- Compatibility with private, group, and independent chat sessions.
Getting Started
To start using the Claude & Bard Telegram Bot, follow these simple steps depending on your deployment preference:
Deployment on Zeabur
A straightforward guide is available here for deploying via Zeabur.
Local Deployment
For those opting for local deployment:
- Clone the project's repository.
- Configure the bot:
- Create and populate a
config/config.yml
file, referencingconfig/config.example.yml
. - Alternatively, set environment variables as follows:
export BOT_TOKEN="your bot token" export USER_IDS="user_id1, user_id2,..." export CLAUDE_API="your claude api" export BARD_API="your bard api"
- Create and populate a
- Run the bot using one of two methods:
- Docker: Simply execute
docker compose up
. - Scripts: Use shell scripts if Python version 3.8 or higher is installed. Prepare your environment with
bash scripts/setup.sh
, then start the bot withbash scripts/run.sh
.
- Docker: Simply execute
Usage
Beyond setup, users can engage the bot with a suite of commands:
/id
: Retrieves the user's chat ID./start
: Initiates the bot with a helpful assistance message./help
: Displays guidance for utilization./reset
: Clears existing chat history./settings
: Reveals settings for Claude & Bard./mode
: Switches between using Claude or Bard.
Specific to Claude:
/model NAME
: Change to a specified model variant./temp VALUE
: Adjusts the response randomness./cutoff VALUE
: Modifies the frequency of streaming outputs.
Commands for segmented messaging and answer retries are also available.
Acknowledgements
The Claude & Bard Telegram Bot is inspired by Lakr233's ChatBot-TGLM6B and relies on libraries like anthropics-sdk-python for Claude and acheong08's Bard for Bard. These tools provided crucial components, and thanks are extended to the creators for their contributions.
With its rich features and ease of use, the Claude & Bard Telegram Bot opens up new vistas for interacting with AI through the familiar and accessible interface of Telegram.