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: '⚙️ Custom' |
| #3 | --- |
| #4 | |
| #5 | When we say "custom", we mean that you can customize the loader and chunker to your needs. This is done by passing a custom loader and chunker to the `add` method. |
| #6 | |
| #7 | ```python |
| #8 | from embedchain import App |
| #9 | import your_loader |
| #10 | from my_module import CustomLoader |
| #11 | from my_module import CustomChunker |
| #12 | |
| #13 | app = App() |
| #14 | loader = CustomLoader() |
| #15 | chunker = CustomChunker() |
| #16 | |
| #17 | app.add("source", data_type="custom", loader=loader, chunker=chunker) |
| #18 | ``` |
| #19 | |
| #20 | <Note> |
| #21 | The custom loader and chunker must be a class that inherits from the [`BaseLoader`](https://github.com/embedchain/embedchain/blob/main/embedchain/loaders/base_loader.py) and [`BaseChunker`](https://github.com/embedchain/embedchain/blob/main/embedchain/chunkers/base_chunker.py) classes respectively. |
| #22 | </Note> |
| #23 | |
| #24 | <Note> |
| #25 | If the `data_type` is not a valid data type, the `add` method will fallback to the `custom` data type and expect a custom loader and chunker to be passed by the user. |
| #26 | </Note> |
| #27 | |
| #28 | Example: |
| #29 | |
| #30 | ```python |
| #31 | from embedchain import App |
| #32 | from embedchain.loaders.github import GithubLoader |
| #33 | |
| #34 | app = App() |
| #35 | |
| #36 | loader = GithubLoader(config={"token": "ghp_xxx"}) |
| #37 | |
| #38 | app.add("repo:embedchain/embedchain type:repo", data_type="github", loader=loader) |
| #39 | |
| #40 | app.query("What is Embedchain?") |
| #41 | # Answer: Embedchain is a Data Platform for Large Language Models (LLMs). It allows users to seamlessly load, index, retrieve, and sync unstructured data in order to build dynamic, LLM-powered applications. There is also a JavaScript implementation called embedchain-js available on GitHub. |
| #42 | ``` |
| #43 |