https://github.com/hormold/py-tg-chat
Selfhosted telegram bot to talk with GPT-3 like in ChatGPT. It support web search (DDG), saved contexts and group chats
https://github.com/hormold/py-tg-chat
bot chatgpt duckduckgo gpt-3 openai python telegram telegram-bot
Last synced: about 2 months ago
JSON representation
Selfhosted telegram bot to talk with GPT-3 like in ChatGPT. It support web search (DDG), saved contexts and group chats
- Host: GitHub
- URL: https://github.com/hormold/py-tg-chat
- Owner: Hormold
- License: mit
- Created: 2023-02-01T16:08:00.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T09:17:01.000Z (over 3 years ago)
- Last Synced: 2025-06-11T04:16:27.842Z (about 1 year ago)
- Topics: bot, chatgpt, duckduckgo, gpt-3, openai, python, telegram, telegram-bot
- Language: Python
- Homepage:
- Size: 178 KB
- Stars: 3
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Self hosted telegram bot to talk with GPT-3 using OpenAI Model with converstion manager
Simple telegram bot for generating text using ChatGPT model.
Bot remember your conversation context and use it for generating next answer.
It requires token from [https://openai.com/](https://openai.com/) but you can use it for free. Requests are non limited and completed free of charge from the OpenAI API. All you need is an API key.
## Installation (Poetry)
1. Install [Poetry](https://python-poetry.org/docs/#installation)
2. Navigate to project folder. If you want to save env in project folder use: ```poetry config virtualenvs.create false --local```
3. Run ```poetry install```
4. Run ```poetry shell```
5. Edit ```.env``` file and set your tokens (see below)
6. And then ```python3 main.py```
## Environment variables
- OPENAI_TOKEN - your token from [https://openai.com/](https://openai.com/)
- BOT_TOKEN - your bot token from [https://telegram.me/BotFather](https://telegram.me/BotFather)
- OPENAI_ENGINE - engine for generating text. Default is text-davinci-003 (paid)