repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | --- |
| #2 | title: "App" |
| #3 | --- |
| #4 | |
| #5 | Create a RAG app object on Embedchain. This is the main entrypoint for a developer to interact with Embedchain APIs. An app configures the llm, vector database, embedding model, and retrieval strategy of your choice. |
| #6 | |
| #7 | ### Attributes |
| #8 | |
| #9 | <ParamField path="local_id" type="str"> |
| #10 | App ID |
| #11 | </ParamField> |
| #12 | <ParamField path="name" type="str" optional> |
| #13 | Name of the app |
| #14 | </ParamField> |
| #15 | <ParamField path="config" type="BaseConfig"> |
| #16 | Configuration of the app |
| #17 | </ParamField> |
| #18 | <ParamField path="llm" type="BaseLlm"> |
| #19 | Configured LLM for the RAG app |
| #20 | </ParamField> |
| #21 | <ParamField path="db" type="BaseVectorDB"> |
| #22 | Configured vector database for the RAG app |
| #23 | </ParamField> |
| #24 | <ParamField path="embedding_model" type="BaseEmbedder"> |
| #25 | Configured embedding model for the RAG app |
| #26 | </ParamField> |
| #27 | <ParamField path="chunker" type="ChunkerConfig"> |
| #28 | Chunker configuration |
| #29 | </ParamField> |
| #30 | <ParamField path="client" type="Client" optional> |
| #31 | Client object (used to deploy an app to Embedchain platform) |
| #32 | </ParamField> |
| #33 | <ParamField path="logger" type="logging.Logger"> |
| #34 | Logger object |
| #35 | </ParamField> |
| #36 | |
| #37 | ## Usage |
| #38 | |
| #39 | You can create an app instance using the following methods: |
| #40 | |
| #41 | ### Default setting |
| #42 | |
| #43 | ```python Code Example |
| #44 | from embedchain import App |
| #45 | app = App() |
| #46 | ``` |
| #47 | |
| #48 | |
| #49 | ### Python Dict |
| #50 | |
| #51 | ```python Code Example |
| #52 | from embedchain import App |
| #53 | |
| #54 | config_dict = { |
| #55 | 'llm': { |
| #56 | 'provider': 'gpt4all', |
| #57 | 'config': { |
| #58 | 'model': 'orca-mini-3b-gguf2-q4_0.gguf', |
| #59 | 'temperature': 0.5, |
| #60 | 'max_tokens': 1000, |
| #61 | 'top_p': 1, |
| #62 | 'stream': False |
| #63 | } |
| #64 | }, |
| #65 | 'embedder': { |
| #66 | 'provider': 'gpt4all' |
| #67 | } |
| #68 | } |
| #69 | |
| #70 | # load llm configuration from config dict |
| #71 | app = App.from_config(config=config_dict) |
| #72 | ``` |
| #73 | |
| #74 | ### YAML Config |
| #75 | |
| #76 | <CodeGroup> |
| #77 | |
| #78 | ```python main.py |
| #79 | from embedchain import App |
| #80 | |
| #81 | # load llm configuration from config.yaml file |
| #82 | app = App.from_config(config_path="config.yaml") |
| #83 | ``` |
| #84 | |
| #85 | ```yaml config.yaml |
| #86 | llm: |
| #87 | provider: gpt4all |
| #88 | config: |
| #89 | model: 'orca-mini-3b-gguf2-q4_0.gguf' |
| #90 | temperature: 0.5 |
| #91 | max_tokens: 1000 |
| #92 | top_p: 1 |
| #93 | stream: false |
| #94 | |
| #95 | embedder: |
| #96 | provider: gpt4all |
| #97 | ``` |
| #98 | |
| #99 | </CodeGroup> |
| #100 | |
| #101 | ### JSON Config |
| #102 | |
| #103 | <CodeGroup> |
| #104 | |
| #105 | ```python main.py |
| #106 | from embedchain import App |
| #107 | |
| #108 | # load llm configuration from config.json file |
| #109 | app = App.from_config(config_path="config.json") |
| #110 | ``` |
| #111 | |
| #112 | ```json config.json |
| #113 | { |
| #114 | "llm": { |
| #115 | "provider": "gpt4all", |
| #116 | "config": { |
| #117 | "model": "orca-mini-3b-gguf2-q4_0.gguf", |
| #118 | "temperature": 0.5, |
| #119 | "max_tokens": 1000, |
| #120 | "top_p": 1, |
| #121 | "stream": false |
| #122 | } |
| #123 | }, |
| #124 | "embedder": { |
| #125 | "provider": "gpt4all" |
| #126 | } |
| #127 | } |
| #128 | ``` |
| #129 | |
| #130 | </CodeGroup> |
| #131 |