This repository provides a general framework for integrating an OpenAI Assistant with a Telegram bot. It allows users to interact with the OpenAI-powered conversational agent through the Telegram platform.
Before you begin, ensure you have met the following requirements:
Python environment running version 3.7+.@BotFather to obtain a token.OpenAI account to obtain your API keys.You also need
Clone the repository to your local machine:
git clone https://github.com/efelem/telegram_openai_assistant
cd telegram_openai_assistantInstall the packages:
pip install -e .Create a .env file in the root directory and fill in your OpenAI and Telegram credentials:
ASSISTANT_ID=your-assistant-id
CLIENT_API_KEY=your-openai-api-key
TELEGRAM_TOKEN=your-telegram-bot-tokenTo start the bot, run the following command in your terminal:
chatbotThe bot should now be running and can be interacted with through your Telegram bot interface.
You can easily launch the Telegram bot client using the job.telegram_openai_assistant.yaml workflow file in our repository. Follow these simple steps to get started:
job.telegram_openai_assistant.yaml fileInstall DeepSquare CLI: If you haven’t already, install the DeepSquare CLI tool. Instructions can be found here.
Clone the Repository: Clone the repository containing the job.telegram_openai_assistant.yaml file.
Navigate to the Repository Directory: Open a terminal and navigate to the directory where you cloned the repository.
Run the Workflow File: Execute the following command:
deepsquare run job.telegram_openai_assistant.yamlMonitor the Job: Use the following command to monitor the status of your job:
deepsquare statusAccess the Telegram Bot: Once the job is complete, follow the instructions provided in the job logs to access and interact with the Telegram bot.
By following these steps, you can effortlessly launch and interact with the Telegram bot client on DeepSquare.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Distributed under the MIT License. See `LICENSE` for more information.
Project Link: https://github.com/efelem/telegram_openai_assistant