mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-07 21:50:25 +00:00
Dev2049/obsidian patch (#4204)
thanks @shkarlsson for the fix! (just updated formatting) --------- Co-authored-by: shkarlsson <sven.henrik.karlsson@gmail.com>
This commit is contained in:
parent
2324f19c85
commit
f1fc4dfebc
@ -53,7 +53,14 @@ class ObsidianLoader(BaseLoader):
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user