We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0605ba commit 4860fc8Copy full SHA for 4860fc8
1 file changed
Tool/Sources/LangChain/DocumentLoader/DocumentLoader.swift
@@ -9,6 +9,11 @@ public struct Document: Codable {
9
self.pageContent = pageContent
10
self.metadata = metadata
11
}
12
+
13
+ public func metadata<Key>(_ keyPath: KeyPath<Key.Type, String>) -> JSONValue? {
14
+ let key = Key.self[keyPath: keyPath]
15
+ return metadata[key]
16
+ }
17
18
19
public protocol DocumentLoader {
0 commit comments