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.
- Clone the repository
- Install dependencies with
go mod tidy
- Set the environment variables
TELEGRAM_TOKEN
,MONGODB_URI
andOPENAI_KEY
- Run the project with
go run .
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.
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.
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.
- stream support
- voice message support
- Capability to receive and read text files
- GPT-4