At a glance
This guide will walk you through how to deploy a simple echo assistant to fly.io, and publish that assistant to OneChat. Our echo assistant is built with python/fastapi.Before you begin
Create an account on OneChat1. Run Echo Assistant Locally
git clone https://github.com/OneChat-Official/EchoAssistant.git
- Navigate to repo folder and run
pip install -r requirements.txt
to install dependencies - Run
fastapi run dev
to run the assistant locally. If it runs, we’re good to move on to the next section - (optional) visit swagger UI and send sample requests. By default fastapi hosts swagger UI at http://127.0.0.1:8000/docs.
2. Deploy Echo Assistant with fly.io
We will deploy our echo assistant with fly.io because it has a free tier and is easy to use. Optionally for this step you can deploy to any other hosting provider you choose.- Install flyctl
- Create an account with
fly auth signup
or login withfly auth login
. - Run
fly launch
from inside your project source directory to create, configure, and (for most apps) deploy a new application. - If prompted, run
fly deploy
to deploy your new app (or to redeploy after changes!). - Note the url for your newly deployed app. It should be similar to
https://echo-assistant.fly.dev/
. This is important for the next step.
3. Publish Echo Assistant to OneChat
- Sign in to OneChat
- Go to Explore Assistants > Create New assistant
- Fill in form to create assistant
- Chat Endpoint is the endpoint that will handle incoming messages. For us, it should be similar to
https://echo-assistant.fly.dev/chat/
- Chat Endpoint is the endpoint that will handle incoming messages. For us, it should be similar to
- Click Create to publish your assistant.
- All done! Now you should be able to chat with your newly published assistant!
Troubleshooting
Email me with any issues. I’m happy to help!Next Steps
- Modify Echo Assistant to do something useful and redeploy it
- See ChatGPT Clone for an example of a more useful OneChat assistant