feat: add google doc support added (#155)
This commit is contained in:
committed by
GitHub
parent
c6dbbf5dd3
commit
68e732a426
13
embedchain/loaders/doc_file.py
Normal file
13
embedchain/loaders/doc_file.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from langchain.document_loaders import UnstructuredWordDocumentLoader
|
||||
|
||||
|
||||
class DocFileLoader:
|
||||
def load_data(self, url):
|
||||
loader = UnstructuredWordDocumentLoader(url)
|
||||
output = []
|
||||
data = loader.load()
|
||||
content = data[0].page_content
|
||||
meta_data = data[0].metadata
|
||||
meta_data["url"] = "local"
|
||||
output.append({"content": content, "meta_data": meta_data})
|
||||
return output
|
||||
Reference in New Issue
Block a user