Skip to content

Latest commit

 

History

History
114 lines (70 loc) · 7.52 KB

README.md

File metadata and controls

114 lines (70 loc) · 7.52 KB

RU

Telegram-бот ChatGPT: Твой персональный AI-ассистент без границ

Описание

Этот Telegram-бот предоставляет удобный доступ к мощным моделям ChatGPT 3.5, ChatGPT 4 Turbo, ChatGPT 4, ChatGPT 4o и другим, прямо в Telegram. Он создан для тех, кто сталкивается с ограничениями из-за санкций и нестабильным VPN, а также для тех, кто хочет экономить на подписке OpenAI.

Преимущества

  • Доступность: Обходи санкции и блокировки VPN.
  • Экономия: Плати только за использованные токены. Идеально подходит для тех, кто не хочет платить 20$ в месяц за подписку OpenAI.
  • Гибкость: Используй GPT-3.5 для обычных задач и переключайся на GPT-4, когда нужна максимальная производительность.
  • Удобство: Забудь про сложные настройки и приложения – все в Telegram.

Кому это нужно?

  • Тем, кто находится в странах под санкциями и испытывает проблемы с VPN.
  • Тем, кто хочет пользоваться ChatGPT, не переплачивая за подписку.
  • Тем, кто ценит удобство и простоту использования.

Демо

Новый бот ИИ: https://t.me/sliamb_ai_bot

Технологии

  • Aiogram 3.3.0: Фреймворк для создания Telegram-ботов на Python.
  • Anyio 4.2.0: Библиотека для асинхронного программирования.
  • Alembic 1.13.1: Инструмент для миграций базы данных.
  • OpenAI 1.11.1: Библиотека для работы с API OpenAI.
  • SQLAlchemy 2.0.25: ORM для работы с базами данных.
  • WalletPay 1.3.1: Библиотека для интеграции платежей.
  • PostgreSQL: База данных.
  • Docker: Контейнеризация приложения.

Архитектура

Бот использует асинхронную архитектуру с базой данных PostgreSQL, управляемой через SQLAlchemy. В базе данных хранятся данные пользователей, баланс и настройки. Для поддержания контекста общения с ChatGPT сохраняется история переписки (настраиваемый период). Курс RUB/USD автоматически обновляется раз в день.

Функциональность

  • Пополнение баланса через WalletPay или криптовалютные переводы.
  • Ежедневное резервное копирование базы данных.
  • Админ-панель с возможностью:
    • Скачивания и загрузки базы данных.
    • Управления сессиями пользователей.
    • Просмотра статистики.
    • Управления логами.

Установка и запуск

  1. Склонируйте репозиторий.
  2. Отредактируйте файл .env, добавив необходимые ключи и токены (токен OpenAI необходимо вводить вручную на сервере).
  3. Запустите приложение в Docker-контейнере.

Предупреждение

Не храните токен OpenAI в открытом репозитории, чтобы избежать его блокировки.

ChatGPT

ChatGPT

ChatGPT

EN

What is it?

This is a simple telegram bot. It gives direct access to ChatGPT 3.5, ChatGPT 4 Turbo, ChatGPT 4, etc.

Who is this for?

For those people who are forced to stay in a country under sanctions, and the VPN is constantly blocked and constantly hanging. For those who can't afford $20 per month for the latest version of ChatGPT from OpenAI. This bot allows you to use the original ChatGPT sparingly, in a dosed manner. Payment is only for tokens. For example, I use GPT-3.5 on a regular basis, but when it fails, I switch to GPT-4, it comes out very cheap.

This bot is not needed by those who are not in sanctions, you can just download and officially use the application from OpenAI. 3.5 is free, 4 - you will have to pay.

How to use it?

  1. Select a server without sanctions, install the application, sign up for OpenAI, throw in $ 5 and use it.
  2. You can just use my - https://t.me/shliamb2_bot You can just try it.

ChatGPT

ChatGPT

ChatGPT

Main technologies and libraries:

  1. Aiogram 3.3.0,
  2. Anyio 4.2.0
  3. Alembic 1.13.1
  4. Openai 1.11.1
  5. SQLAlchemy 2.0.25
  6. WalletPay 1.3.1 , etc.

How it works

  • The database is based on PostgreSQL, it works asynchronously, in a docker container. Working with the database via SQLAlchemy. The database stores the basic data and user settings, the account. Statistics of expenses that the client can download through the bot settings. The RUB - USD exchange rate is also stored in the database. It is updated once a day via the central bank's server. Also, in the database cell for each user, correspondence with ChatGPT is stored for the selected period in order for the chat to have a communication context. You can delete this function or set the desired time in the bot settings.

  • At the moment, you can top up your balance by paying via WALLET PAY, or transferring crypts.

  • Once a day, the database is saved to a folder on the server.

  • There is an admin menu available to the administrator. You can download a database file in it, you can also stop sessions online, clear the database and fill in your own. You can also view all the statistics there. Download the log file, you can also clear it there.

  • Running on the server boils down to cloning the repository, manually editing the .env file, you need to enter all the keys and tokens into it. The OpenAI token must be entered on the server by hand, since when it is detected on GitHab, its effect on OpenAI stops.