quickstart.mdx 762 B

1234567891011121314151617181920212223242526272829
  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. Run your first bot in python using the following code. Make sure to set the `OPENAI_API_KEY` 🔑 environment variable in the code.
  10. ```python
  11. import os
  12. from embedchain Import App
  13. os.environ["OPENAI_API_KEY"] = "xxx"
  14. elon_musk_bot = App()
  15. # Embed Online Resources
  16. elon_musk_bot.add("web_page", "https://en.wikipedia.org/wiki/Elon_Musk")
  17. elon_musk_bot.add("web_page", "https://www.tesla.com/elon-musk")
  18. response = elon_bot.query("How many companies does Elon Musk run?")
  19. print(response)
  20. # Answer: 'Elon Musk runs four companies: Tesla, SpaceX, Neuralink, and The Boring Company.'
  21. ```