Skip to content

This is a simple Telegram chatbot that uses the OpenAI GPT-3.5-turbo model to generate responses. It stores message history per user and sends it to the GPT-3.5-turbo API for context-aware conversation.

Notifications You must be signed in to change notification settings

FirePhenix/go_chatgpt_telegram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README.md

Telegram Chatbot with GPT-3.5-turbo

This is a simple Telegram chatbot that uses the OpenAI GPT-3.5-turbo model to generate responses. It stores message history per user and sends it to the GPT-3.5-turbo API for context-aware conversation.

Dependencies

Installation

  1. Clone the repository
  2. Install dependencies with go mod tidy
  3. Set the environment variables TELEGRAM_TOKEN, MONGODB_URI and OPENAI_KEY
  4. Run the project with go run .

Usage

Users can interact with the chatbot in Telegram, sending messages and receiving GPT-3.5-turbo-generated replies. The chatbot also supports the following commands:

  • /new: Starts a new conversation, clearing the previous message history for the user.

Data Structures

  • Message: Represents a message in the conversation, with a role (user or assistant) and content.
  • ChatResponse: Represents the GPT-3.5-turbo API response, with choices, message content, and usage information.

Note

This is a basic implementation of a Telegram chatbot using the GPT-3.5-turbo API.

for support voice message, you need to install fmmpeg library.

Todo list

  • stream support
  • voice message support
  • Capability to receive and read text files
  • GPT-4

About

This is a simple Telegram chatbot that uses the OpenAI GPT-3.5-turbo model to generate responses. It stores message history per user and sends it to the GPT-3.5-turbo API for context-aware conversation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages