quickstart.mdx 931 B

1234567891011121314151617181920212223242526272829303132333435
  1. ---
  2. title: '🚀 Quickstart'
  3. description: '💡 Start building LLM powered bots under 30 seconds'
  4. ---
  5. Install embedchain python package:
  6. ```bash
  7. pip install embedchain
  8. ```
  9. Creating a chatbot involves 3 steps:
  10. - ⚙️ Import the App instance
  11. - 🗃️ Add Dataset
  12. - 💬 Query or Chat on the dataset and get answers (Interface Types)
  13. Run your first bot in python using the following code. Make sure to set the `OPENAI_API_KEY` 🔑 environment variable in the code.
  14. ```python
  15. import os
  16. from embedchain import App
  17. os.environ["OPENAI_API_KEY"] = "xxx"
  18. elon_musk_bot = App()
  19. # Embed Online Resources
  20. elon_musk_bot.add("web_page", "https://en.wikipedia.org/wiki/Elon_Musk")
  21. elon_musk_bot.add("web_page", "https://www.tesla.com/elon-musk")
  22. response = elon_musk_bot.query("How many companies does Elon Musk run?")
  23. print(response)
  24. # Answer: 'Elon Musk runs four companies: Tesla, SpaceX, Neuralink, and The Boring Company.'
  25. ```