V-know/ChatGPT-Telegram-Bot
소개
UI를 지원하며 매끄러운 AI 경험을 제공하는 Telegram 봇입니다.
AI 및 머신러닝측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- -1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalChatGPT Telegram Bot
English | 中文
A Telegram bot with a silky smooth AI experience.
⚡Feature
[✓] Support for both Azure OpenAI and native OpenAI.
[✓] Real-time (streaming) response to AI, with faster and smoother experience.
[✓] Generate picture based on OpenAI DALL·E 3 model.
[✓] 15 preset bot identities that can be quickly switched.
[✓] Support for custom bot identities to meet personalized needs.
[✓] Support to clear the contents of the chat with a single click, and restart the conversation at any time.
[✓]Native Telegram bot button support, making it easy and intuitive to implement required functions.
[✓] User level division, with different levels enjoying different single session token numbers, context numbers, and session frequencies.
[✓] Support English and Chinese on UI
[✓] Containerization.
[✓] More...

👨💻TODO
[x] Allow users to use their own OpenAI Key in the bot to gain more freedom.
[x] Improve ErrorHandler.
🤖Quick Experience
Telegram Bot: RoboAceBot
🛠️Deployment
Install Dependencies
pip install -r requirements.txt
Configure Database
Install Database
You can quickly create a local MySQL database using:
docker-compose up -d -f db/docker-compose.yaml
Initialize Database
mysql -uusername -p -e "source db/database.sql"
Add Configuration
All the required configurations are in config.yaml, please refer to config.yaml.example for file format and content.
| Parameter | Optional | Description |
|---|---|---|
BOT.TOKEN |
No | Create a bot from @botFather and get the Token. |
DEVELOPER_CHAT_ID |
No | Telegram account ID that receives messages when the bot encounters an error. You can use @get_id_bot to get your ID. |
MYSQL |
No | Parameters related to MySQL connection. |
TIME_SPAN |
No | The time window size used to calculate the ratelimit, in minutes. |
RATE_LIMIT |
No | key is the user level, and value is the maximum number of chats that can be made within the TIME_SPAN time period. |
CONTEXT_COUNT |
No | key is the user level, and value is the number of contexts included in each chat. |
MAX_TOKEN |
No | key is the user level, and value is the maximum number of tokens returned by the AI per chat. |
AI.TYPE |
Yes | The type of AI used, with two options: openai and azure. The default is openai. |
AI.BASE |
Yes | When checking resources from the Azure portal, this value can be found in the "Keys and Endpoints" section. Alternatively, this value can be found in "Azure OpenAI Studio" > "Playground" > "Code View". Only needs to be set when AI.TYPE is azure. |
AI.VERSION |
Yes | The version number of Azure OpenAI, only needs to be set when AI.TYPEis azure. |
AI.MODEL |
Yes | The deployment name of Azure OpenAI, or the Model of OpenAI. |
If you are using Azure's OpenAI, you can obtain all the required content at this link:
Get started using ChatGPT and GPT-4 with Azure OpenAI Services
🚀Start
python main.py | tee >> debug.log
Docker build & Run
docker run --rm --name chatgpt-telegram-bot -v ./config.yaml:/app/config.yaml ghcr.io/v-know/chatgpt-telegram-bot:latest
Docker Compose
docker-compose up -d
❤️In Conclusion
I hope this project can provide you with a smooth AI experience and help more people create and use their own Telegram bots.
Star History
관련 프로젝트 살펴보기
불러오는 중…