Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juntao/openai-assistant-telegram
Build an external Telegram bot for your openAI Assistant Applications
https://github.com/juntao/openai-assistant-telegram
Last synced: about 1 month ago
JSON representation
Build an external Telegram bot for your openAI Assistant Applications
- Host: GitHub
- URL: https://github.com/juntao/openai-assistant-telegram
- Owner: juntao
- License: apache-2.0
- Created: 2023-12-05T05:33:57.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-05T05:33:59.000Z (about 1 year ago)
- Last Synced: 2024-11-29T21:43:24.684Z (about 1 month ago)
- Language: Rust
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#
A Telegram bot for you OpenAI Assistant Applications
[Deploy this function on flows.network](#deploy-your-telegram-bot-in-3-simple-steps), and you will get a Telegram 🤖 to interact with your OpenAI applications based on the Assitant APIs. It helps expand the usage of your Assistants apps and connect the app with your audiences. It's an essential but simple step to make your Assistant apps in production.
## How it works
This flow function (or 🤖) will be triggered when a new message is sent to the Telegram bot. Then, the flow function will create a new thread for this user, call the retrieval API from OpenAI's Assistants, and finally answer the user's questions. The user can also type `/restart` to the bot to create a new thread.
## Deploy your telegram bot in 3 simple steps
1. Create a bot from a template
2. Configure the Configurations### 0 Prerequisites
Before we start, you need to create an Assistants app with [the OpenAI playground](https://platform.openai.com/assistants). The OpenAI's Assistant basically is a RAG-based LLM agent. You can upload your own knowledge base to customize the Assistant's behavior and make sure the assistant provides correct answers. After that, you can easily see your assistant ID beginning with `asst_` on the dashboard. You will need to bring your own [OpenAI API key](https://openai.com/blog/openai-api).
You will also need to sign into [flows.network](https://flows.network/) from your GitHub account. It is free.
### 1 Create a bot from a template
[**Just click here**](https://flows.network/flow/createByTemplate/openai-assistant-telegram) to load the template.
### 2 Configure the Configurations
[](https://github.com/flows-network/openai-assistant-telegram/assets/45785633/86ec46bc-a931-4420-918c-cf744471cd1d)
Review the four configurations.
|Congiguration| Description |
|----|---|
| ASSISTANT_ID | Get the Assistant ID from [the OpenAI Assistants dashboard](https://platform.openai.com/assistants) |
| OPENAI_API_KEY | OpenAI API key|
|telegram_token| Get the Telegram token from @botfather |Then click on the Create and Build button to continue.
We don't need to set up other SaaS providers here. Click Deploy to finish the deployment.
### Wait for the magic!
This is it! You are now on the flow details page waiting for the flow function to build. As soon as the flow's status becomes `running`, the bot is ready to answer questions from your users!
If you don't want to use OpenAI to create embeddings for your domain knowledge, please refer to
* [RAG-embedding](https://github.com/flows-network/demo-RAG-embeddings)
* [RAG-discord](https://github.com/flows-network/demo-RAG-discord-bot)
* [RAG-web-ui](https://github.com/flows-network/demo-RAG-chatbot-web)