quickstart.mdx 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. ---
  2. title: '⚡ Quickstart'
  3. description: '💡 Start building ChatGPT like apps in a minute on your own data'
  4. ---
  5. Install python package:
  6. ```bash
  7. pip install embedchain
  8. ```
  9. Creating an app involves 3 steps:
  10. <Steps>
  11. <Step title="⚙️ Import app instance">
  12. ```python
  13. from embedchain import Pipeline as App
  14. app = App()
  15. ```
  16. <Accordion title="Customize your app by a simple YAML config" icon="gear-complex">
  17. Embedchain provides a wide range of options to customize your app. You can customize the model, data sources, and much more.
  18. Explore the custom configurations [here](https://docs.embedchain.ai/advanced/configuration).
  19. <CodeGroup>
  20. ```python yaml_app.py
  21. from embedchain import Pipeline as App
  22. app = App.from_config(config_path="config.yaml")
  23. ```
  24. ```python json_app.py
  25. from embedchain import Pipeline as App
  26. app = App.from_config(config_path="config.json")
  27. ```
  28. ```python app.py
  29. from embedchain import Pipeline as App
  30. config = {} # Add your config here
  31. app = App.from_config(config=config)
  32. ```
  33. </CodeGroup>
  34. </Accordion>
  35. </Step>
  36. <Step title="🗃️ Add data sources">
  37. ```python
  38. app.add("https://en.wikipedia.org/wiki/Elon_Musk")
  39. app.add("https://www.forbes.com/profile/elon-musk")
  40. # app.add("path/to/file/elon_musk.pdf")
  41. ```
  42. <Accordion title="Embedchain supports adding data from many data sources." icon="files">
  43. Embedchain supports adding data from many data sources including web pages, PDFs, databases, and more.
  44. Explore the list of supported [data sources](https://docs.embedchain.ai/data-sources/overview).
  45. </Accordion>
  46. </Step>
  47. <Step title="💬 Ask questions, chat, or search through your data with ease">
  48. ```python
  49. app.query("What is the net worth of Elon Musk today?")
  50. # Answer: The net worth of Elon Musk today is $258.7 billion.
  51. ```
  52. <hr />
  53. <Accordion title="Want to chat with your app?" icon="face-thinking">
  54. Embedchain provides a wide range of features to interact with your app. You can chat with your app, ask questions, search through your data, and much more.
  55. ```python
  56. app.chat("How many companies does Elon Musk run? Name those")
  57. # Answer: Elon Musk runs 3 companies: Tesla, SpaceX, and Neuralink.
  58. app.chat("What is his net worth today?")
  59. # Answer: The net worth of Elon Musk today is $258.7 billion.
  60. ```
  61. To learn about other features, click [here](https://docs.embedchain.ai/get-started/introduction)
  62. </Accordion>
  63. </Step>
  64. <Step title="🚀 Seamlessly launch your App on the Embedchain Platform!">
  65. ```python
  66. app.deploy()
  67. # 🔑 Enter your Embedchain API key. You can find the API key at https://app.embedchain.ai/settings/keys/
  68. # ec-xxxxxx
  69. # 🛠️ Creating pipeline on the platform...
  70. # 🎉🎉🎉 Pipeline created successfully! View your pipeline: https://app.embedchain.ai/pipelines/xxxxx
  71. # 🛠️ Adding data to your pipeline...
  72. # ✅ Data of type: web_page, value: https://www.forbes.com/profile/elon-musk added successfully.
  73. ```
  74. <Accordion title="Share your app with others" icon="laptop-mobile">
  75. You can now share your app with others from our platform.
  76. Access your app on our [platform](https://app.embedchain.ai/).
  77. </Accordion>
  78. </Step>
  79. </Steps>