quickstart.mdx 1.2 KB

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 --upgrade 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("https://en.wikipedia.org/wiki/Elon_Musk")
  21. elon_musk_bot.add("https://www.forbes.com/profile/elon-musk")
  22. response = elon_musk_bot.query("How many companies does Elon Musk run and name those?")
  23. print(response)
  24. # Answer: 'Elon Musk currently runs several companies. As of my knowledge, he is the CEO and lead designer of SpaceX, the CEO and product architect of Tesla, Inc., the CEO and founder of Neuralink, and the CEO and founder of The Boring Company. However, please note that this information may change over time, so it's always good to verify the latest updates.'
  25. ```