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: '📁 Directory/Folder' |
| #3 | --- |
| #4 | |
| #5 | To use an entire directory as data source, just add `data_type` as `directory` and pass in the path of the local directory. |
| #6 | |
| #7 | ### Without customization |
| #8 | |
| #9 | ```python |
| #10 | import os |
| #11 | from embedchain import App |
| #12 | |
| #13 | os.environ["OPENAI_API_KEY"] = "sk-xxx" |
| #14 | |
| #15 | app = App() |
| #16 | app.add("./elon-musk", data_type="directory") |
| #17 | response = app.query("list all files") |
| #18 | print(response) |
| #19 | # Answer: Files are elon-musk-1.txt, elon-musk-2.pdf. |
| #20 | ``` |
| #21 | |
| #22 | ### Customization |
| #23 | |
| #24 | ```python |
| #25 | import os |
| #26 | from embedchain import App |
| #27 | from embedchain.loaders.directory_loader import DirectoryLoader |
| #28 | |
| #29 | os.environ["OPENAI_API_KEY"] = "sk-xxx" |
| #30 | lconfig = { |
| #31 | "recursive": True, |
| #32 | "extensions": [".txt"] |
| #33 | } |
| #34 | loader = DirectoryLoader(config=lconfig) |
| #35 | app = App() |
| #36 | app.add("./elon-musk", loader=loader) |
| #37 | response = app.query("what are all the files related to?") |
| #38 | print(response) |
| #39 | |
| #40 | # Answer: The files are related to Elon Musk. |
| #41 | ``` |
| #42 |