File tree Expand file tree Collapse file tree
Tool/Sources/LangChain/DocumentLoader Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,10 +3,11 @@ import Foundation
33
44/// Load a text document from local file.
55public struct TextLoader : DocumentLoader {
6- enum MetadataKeys {
7- static let filename = " filename "
8- static let `extension` = " extension "
9- static let contentModificationDate = " contentModificationDate "
6+ public enum MetadataKeys {
7+ public static let filename = " filename "
8+ public static let `extension` = " extension "
9+ public static let contentModificationDate = " contentModificationDate "
10+ public static let filePath = " filePath "
1011 }
1112
1213 let url : URL
@@ -38,6 +39,7 @@ public struct TextLoader: DocumentLoader {
3839 MetadataKeys . contentModificationDate: . number(
3940 ( modificationDate ?? Date ( ) ) . timeIntervalSince1970
4041 ) ,
42+ MetadataKeys . filePath: . string( url. path) ,
4143 ] ) ]
4244 }
4345}
You can’t perform that action at this time.
0 commit comments