Skip to content

Commit

Permalink
Dev2049/obsidian patch (#4204)
Browse files Browse the repository at this point in the history
thanks @shkarlsson for the fix! (just updated formatting)

---------

Co-authored-by: shkarlsson <sven.henrik.karlsson@gmail.com>
  • Loading branch information
dev2049 and shkarlsson committed May 5, 2023
1 parent 2324f19 commit f1fc4df
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion langchain/document_loaders/obsidian.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@ def load(self) -> List[Document]:

front_matter = self._parse_front_matter(text)
text = self._remove_front_matter(text)
metadata = {"source": str(p.name), "path": str(p), **front_matter}
metadata = {
"source": str(p.name),
"path": str(p),
"created": p.stat().st_ctime,
"last_modified": p.stat().st_mtime,
"last_accessed": p.stat().st_atime,
**front_matter,
}
docs.append(Document(page_content=text, metadata=metadata))

return docs

0 comments on commit f1fc4df

Please sign in to comment.