quickstart.mdx 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. </Steps>