We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae689e0 commit d1d8facCopy full SHA for d1d8fac
1 file changed
Tool/Sources/LangChain/DocumentLoader/TextLoader.swift
@@ -23,10 +23,12 @@ public struct TextLoader: DocumentLoader {
23
options: options,
24
documentAttributes: nil
25
)
26
+ let modificationDate = try? url.resourceValues(forKeys: [.contentModificationDateKey])
27
+ .contentModificationDate
28
return [Document(pageContent: attributedString.string, metadata: [
29
"filename": url.lastPathComponent,
30
"extension": url.pathExtension,
- "contentModificationDate": (try? url.resourceValues(forKeys: [.contentModificationDateKey]).contentModificationDate) ?? Date()
31
+ "contentModificationDate": modificationDate ?? Date(),
32
])]
33
}
34
0 commit comments