Data types
๐ Directory/Folder
Get Started
- โก Quickstart
- ๐ Introduction
- โ FAQs
- ๐ป Full stack
- ๐ Integrations
Components
- ๐งฉ Introduction
- ๐๏ธ Data sources
- Overview
- Data types
- ๐ฐ PDF
- ๐ CSV
- ๐ JSON
- ๐ Text
- ๐ Directory/Folder
- ๐ HTML Web page
- ๐ฝ๏ธ Youtube Channel
- ๐บ Youtube Video
- ๐ Code Docs website
- ๐ Mdx file
- ๐ Docx file
- ๐ Notion
- ๐บ๏ธ Sitemap
- ๐งพ XML file
- โ๐ฌ Question and answer pair
- ๐ OpenAPI
- ๐ฌ Gmail
- ๐ Github
- ๐ Postgres
- ๐ฌ MySQL
- ๐ค Slack
- ๐ฌ Discord
- ๐จ๏ธ Discourse
- ๐ Substack
- ๐ Beehiiv
- ๐ Directory/Folder
- ๐พ Dropbox
- ๐ผ๏ธ Image
- ๐ค Audio
- โ๏ธ Custom
- Data type handling
- ๐๏ธ Vector databases
- ๐ค Large language models (LLMs)
- ๐งฉ Embedding models
- ๐ฌ Evaluation
Community
Product
Data types
๐ Directory/Folder
To use an entire directory as data source, just add data_type
as directory
and pass in the path of the local directory.
Without customization
import os
from embedchain import App
os.environ["OPENAI_API_KEY"] = "sk-xxx"
app = App()
app.add("./elon-musk", data_type="directory")
response = app.query("list all files")
print(response)
# Answer: Files are elon-musk-1.txt, elon-musk-2.pdf.
Customization
import os
from embedchain import App
from embedchain.loaders.directory_loader import DirectoryLoader
os.environ["OPENAI_API_KEY"] = "sk-xxx"
lconfig = {
"recursive": True,
"extensions": [".txt"]
}
loader = DirectoryLoader(config=lconfig)
app = App()
app.add("./elon-musk", loader=loader)
response = app.query("what are all the files related to?")
print(response)
# Answer: The files are related to Elon Musk.
Was this page helpful?
On this page