poe_bot.mdx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. ---
  2. title: '🔮 Poe Bot'
  3. ---
  4. ### 🚀 Getting started
  5. 1. Install embedchain python package:
  6. ```bash
  7. pip install "embedchain[poe]"
  8. ```
  9. 2. Create a free account on [Poe](https://www.poe.com?utm_source=embedchain).
  10. 3. Click "Create Bot" button on top left.
  11. 4. Give it a handle and an optional description.
  12. 5. Select `Use API`.
  13. 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.
  14. 7. Copy your api key and paste it in `.env` as `POE_API_KEY`.
  15. 8. Now create your bot using the following code snippet
  16. ```bash
  17. from embedchain import PoeBot
  18. poe_bot = PoeBot()
  19. # add as many data sources as you want
  20. poe_bot.add("https://en.wikipedia.org/wiki/Adam_D%27Angelo")
  21. poe_bot.add("https://www.youtube.com/watch?v=pJQVAqmKua8")
  22. # start the bot
  23. # this start the poe bot server on port 8080 by default
  24. poe_bot.start()
  25. ```
  26. 9. You can refer the [Supported Data formats](https://docs.embedchain.ai/advanced/data_types) section to refer the supported data types in embedchain.
  27. 10. Click `Run check` to make sure your machine can be reached.
  28. 11. Make sure your bot is private if that's what you want.
  29. 12. Click `Create bot` at the bottom to finally create the bot
  30. 13. Now you bot is created.
  31. ### 💬 How to use
  32. - To ask the bot questions, just type your query in the Poe interface:
  33. ```text
  34. <your-question-here>
  35. ```
  36. - 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.