Giter Site home page Giter Site logo

iamwavecut / telegram-chatgpt-bot Goto Github PK

View Code? Open in Web Editor NEW
77.0 2.0 4.0 198 KB

Simple Telegram bot integration to OpenAI ChatGPT API, written in Go

Home Page: https://t.me/net_nebot

License: MIT License

Dockerfile 2.67% Go 97.33%
chatgpt chatgpt-api go golang telegram telegram-bot chat chat-bot chat-bots chatbot

telegram-chatgpt-bot's Introduction

Simple Telegram bot integration to OpenAI ChatGPT API


Disclaimer

โš ๏ธ This code represents a working instance of the bot named @net_nebot on Telegram. Other bots may be running the same code, and may be used for malicious purposes. Use at your own risk!

This is not an official OpenAI nor Telegram product. This is a community project.

The code is provided as is, and is not guaranteed to work.


Self-hosting

The easiest way to self-host the bot is to build a Docker image and run it on a server of your choice. The Dockerfile is provided in the repository.

You will need to provide the following arguments to the build command:

docker build -t telegram-chatgpt-bot . \
  --build-arg OPENAI_TOKEN=<required, your_api_token> \
  --build-arg BOT_TOKEN=<required, your_bot_token> \
  --build-arg CHAT_MODEL=<optional, defaults to 'gpt-3.5-turbo-1106'> 

You can also run the bot locally

docker run -d --restart always --name  telegram-chatgpt-bot telegram-chatgpt-bot

Translations

The bot is currently available in the following languages: English, Russian, Belarusian, Ukrainian. Feel free to contribute translations for other languages! The ChatGPT API itself understands a lot more languages, so go give it a try!

telegram-chatgpt-bot's People

Contributors

dependabot[bot] avatar iamwavecut avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

telegram-chatgpt-bot's Issues

Control context length

Bot fails on context length error, if it's longer than 4096 tokens.

Should implement context trimmer.

Unescaped entities in requests

TBD: Needs to find out steps to reproduce.

400: Bad Request: can't parse entities: Can't find end of the entity starting at byte offset N

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.