This bot leverages the power of OpenAI for natural language understanding and ElevenLabs for generating custom voices. The bot allows users to create and manage conversational agents with personalized voices, maintaining context throughout the conversation.
-
Clone the repository:
git clone https://github.com/glebshbv/oneonone.git cd oneonone
-
Install dependencies:
pip install -r requirements.txt
-
Set up your environment variables (see Environment Variables below).
-
Run the bot:
python main.py
-
The bot comes with Docker and Docker Compose configured. Just run this command inside folder:
docker-compose up --build
You need to create a .env
file in the root directory of your project to store the following environment variables:
API_TOKEN
: API token to access /admin APIs.TELEGRAM_BOT_TOKEN
: Your Telegram bot token obtained from BotFather.TELEGRAM_WEBHOOK_TOKEN
: Telegram Webhook token (configure webhooks in advance)CHATS
: A comma-separated list of Telegram chat IDs where the bot will send messages. Example:CHATS="123456789,987654321"
OPENAI_API_KEY
: Your API key for OpenAI.ELEVEN_API_KEY
: Your API key for ElevenLabs.ELEVEN_VOICE_ID
: Your ElevenLabs Voice ID.CLOUDFLARE_R2_ACCESS_KEY_ID
: Cloudflare R2 ConfigCLOUDFLARE_R2_SECRET_ACCESS_KEY
: Cloudflare R2 ConfigCLOUDFLARE_R2_BUCKET_NAME
: Cloudflare R2 ConfigCLOUDFLARE_R2_ENDPOINT_URL
: Cloudflare R2 ConfigCLOUDFLARE_R2_PUBLIC_ENDPOINT_URL
: Cloudflare R2 ConfigCLOUDFLARE_R2_REGION
: Cloudflare R2 ConfigDATABASE_URL
: Postgres DB StringDEFAULT_PROMPT
: Your starting prompt for conversation
Example .env
file:
API_TOKEN=super-token
TELEGRAM_BOT_TOKEN=super-token
TELEGRAM_WEBHOOK_TOKEN=super-token
OPENAI_API_KEY=super-token
HOST=host
ELEVEN_API_KEY=super-token
ELEVEN_VOICE_ID=super-id
CLOUDFLARE_R2_ACCESS_KEY_ID=super-token
CLOUDFLARE_R2_SECRET_ACCESS_KEY=super-token
CLOUDFLARE_R2_BUCKET_NAME=super-name
CLOUDFLARE_R2_REGION=apac
CLOUDFLARE_R2_ENDPOINT_URL=your-url
CLOUDFLARE_R2_PUBLIC_ENDPOINT_URL=public-endpoint
DATABASE_URL=postgresql+psycopg2://username:password@host/db
DEFAULT_PROMPT=default-prompt
- Start a conversation with the bot in Telegram.
- The bot will respond to your messages, maintaining the context of the conversation.
- Voice responses are generated using ElevenLabs, providing a custom voice for the bot.
- You can customize the bot's behavior and voice through the OpenAI and ElevenLabs integrations.
- Conversational AI: Uses OpenAI to generate context-aware responses.
- Custom Voices: Uses ElevenLabs to create personalized voices for the bot.
- Contextual Memory: The bot maintains the context of the conversation.
- Multi-Chat Support: Can be configured to send messages to multiple Telegram chats.
- Message Handling: The bot receives messages via the Telegram API.
- Natural Language Processing: OpenAI processes the text to generate an appropriate response.
- Voice Generation: ElevenLabs converts the text response into audio using a custom voice.
- Message Delivery: The bot sends the response back to the user in both text and voice formats, maintaining conversation continuity.
Contributions are welcome! Please fork this repository and submit a pull request.
This project is licensed under the MIT License.
Developed by Gleb Shabanov