repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | --- |
| #2 | title: '🔮 Poe Bot' |
| #3 | --- |
| #4 | |
| #5 | ### 🚀 Getting started |
| #6 | |
| #7 | 1. Install embedchain python package: |
| #8 | |
| #9 | ```bash |
| #10 | pip install fastapi-poe==0.0.16 |
| #11 | ``` |
| #12 | |
| #13 | 2. Create a free account on [Poe](https://www.poe.com?utm_source=embedchain). |
| #14 | 3. Click "Create Bot" button on top left. |
| #15 | 4. Give it a handle and an optional description. |
| #16 | 5. Select `Use API`. |
| #17 | 6. Under `API URL` enter your server or ngrok address. You can use your machine's public IP or DNS. Otherwise, employ a proxy server like [ngrok](https://ngrok.com/) to make your local bot accessible. |
| #18 | 7. Copy your api key and paste it in `.env` as `POE_API_KEY`. |
| #19 | 8. You will need to set `OPENAI_API_KEY` for generating embeddings and using LLM. Copy your OpenAI API key from [here](https://platform.openai.com/account/api-keys) and paste it in `.env` as `OPENAI_API_KEY`. |
| #20 | 9. Now create your bot using the following code snippet. |
| #21 | |
| #22 | ```bash |
| #23 | # make sure that you have set OPENAI_API_KEY and POE_API_KEY in .env file |
| #24 | from embedchain.bots import PoeBot |
| #25 | |
| #26 | poe_bot = PoeBot() |
| #27 | |
| #28 | # add as many data sources as you want |
| #29 | poe_bot.add("https://en.wikipedia.org/wiki/Adam_D%27Angelo") |
| #30 | poe_bot.add("https://www.youtube.com/watch?v=pJQVAqmKua8") |
| #31 | |
| #32 | # start the bot |
| #33 | # this start the poe bot server on port 8080 by default |
| #34 | poe_bot.start() |
| #35 | ``` |
| #36 | |
| #37 | 10. You can paste the above in a file called `your_script.py` and then simply do |
| #38 | |
| #39 | ```bash |
| #40 | python your_script.py |
| #41 | ``` |
| #42 | |
| #43 | Now your bot will start running at port `8080` by default. |
| #44 | |
| #45 | 11. You can refer the [Supported Data formats](https://docs.embedchain.ai/advanced/data_types) section to refer the supported data types in embedchain. |
| #46 | |
| #47 | 12. Click `Run check` to make sure your machine can be reached. |
| #48 | 13. Make sure your bot is private if that's what you want. |
| #49 | 14. Click `Create bot` at the bottom to finally create the bot |
| #50 | 15. Now your bot is created. |
| #51 | |
| #52 | ### 💬 How to use |
| #53 | |
| #54 | - To ask the bot questions, just type your query in the Poe interface: |
| #55 | ```text |
| #56 | <your-question-here> |
| #57 | ``` |
| #58 | |
| #59 | - If you wish to add more data source to the bot, simply update your script and add as many `.add` as you like. You need to restart the server. |
| #60 |