Deploy this function on flows.network, 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.
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.
- Create a bot from a template
- Configure the Configurations
Before we start, you need to create an Assistants app with the OpenAI playground. 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.
You will also need to sign into flows.network from your GitHub account. It is free.
Just click here to load the template.
Review the four configurations.
Congiguration | Description |
---|---|
ASSISTANT_ID | Get the Assistant ID from the OpenAI Assistants dashboard |
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.
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!
![image](https://private-user-images.githubusercontent.com/45785633/282469066-84805f7b-a3c5-49fd-bad7-4dbdace07fd6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQyMzI3MDYsIm5iZiI6MTcyNDIzMjQwNiwicGF0aCI6Ii80NTc4NTYzMy8yODI0NjkwNjYtODQ4MDVmN2ItYTNjNS00OWZkLWJhZDctNGRiZGFjZTA3ZmQ2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODIxVDA5MjY0NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg1MThkZjAyZDA1YjliMGM5YjA3ZWNkY2QxMTRkZDM1OTI2MGJkM2Y4MGRmN2Q0NWYyMDlhZTA3MmQ3YWY0YzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.0dAyhvuqYVZzIHszK5nVgo4AbbTO_GBDrKkozM6VsRI)
If you don't want to use OpenAI to create embeddings for your domain knowledge, please refer to