Skip to content

Commit b0605ba

Browse files
committed
Make the keys publick
1 parent 01fed71 commit b0605ba

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

Tool/Sources/LangChain/DocumentLoader/TextLoader.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import Foundation
33

44
/// Load a text document from local file.
55
public 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
}

0 commit comments

Comments
 (0)