parent
78f3fc404d
commit
7e7bd03970
@ -0,0 +1,25 @@
|
||||
package com.plexworlds.l3.vectors;
|
||||
|
||||
|
||||
|
||||
import dev.langchain4j.data.document.Document;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
||||
import static dev.langchain4j.data.document.loader.FileSystemDocumentLoader.*;
|
||||
|
||||
// TODO: go figure https://github.com/langchain4j/langchain4j-examples
|
||||
@Slf4j
|
||||
public class DocLoader {
|
||||
|
||||
|
||||
|
||||
|
||||
private static void loadSingleDocument(Path path) {
|
||||
Document document = loadDocument(path);
|
||||
log.info("");
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.plexworlds.l3.vectors;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class FileLoader {
|
||||
|
||||
public static List<String> getAllFileNames(String rootDir) throws IOException {
|
||||
try (Stream<Path> paths = Files.walk(Paths.get(rootDir))) {
|
||||
return paths
|
||||
.filter(Files::isRegularFile)
|
||||
.map(Path::toAbsolutePath)
|
||||
.map(Path::toString)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue