https://github.com/stereoflo/go-chat-openai
https://github.com/stereoflo/go-chat-openai
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/stereoflo/go-chat-openai
- Owner: StereoFlo
- Created: 2023-05-25T16:28:07.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-01-16T15:14:44.000Z (over 2 years ago)
- Last Synced: 2025-02-25T12:48:41.927Z (over 1 year ago)
- Language: Go
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Telegram bot
### Description
In this repository, there is a Telegram chatbot that uses OpenAI for communication. Its distinguishing feature is the history, which serves as context for the conversation. The history can also be cleared.
To run the bot, you need to:
1) create a bot in BotFather
2) get the token
3) register on openai.com
4) get the token
5) rename the .env.example file to .env and edit it
After that, you need to build the program, and it can be used.
### How to build
To build the bot, you need to install Go from the website https://go.dev/dl/, clone the repository, navigate to the repository folder, and execute the command `go build -ldflags '-w -s' -o chat cmd/chat/main.go`. After that, you can run the binary file that was generated during the build from the command line: `chmod +x chat && ./chat`
### Run in docker container
You can run a program in a docker container if it's more convenient for you. To do this, run the command `docker-compose up`.