File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
samples/chatbot/src/main/java/io/quarkiverse/langchain4j/sample/chatbot Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 33import static dev .langchain4j .data .document .splitter .DocumentSplitters .recursive ;
44
55import java .io .File ;
6+ import java .nio .file .Path ;
67import java .util .List ;
78
89import jakarta .enterprise .context .ApplicationScoped ;
1718import dev .langchain4j .store .embedding .EmbeddingStoreIngestor ;
1819import io .quarkus .logging .Log ;
1920import io .quarkus .runtime .StartupEvent ;
21+ import org .eclipse .microprofile .config .inject .ConfigProperty ;
2022
2123@ ApplicationScoped
2224public class IngestorExample {
@@ -35,10 +37,9 @@ public class IngestorExample {
3537 @ Inject
3638 EmbeddingModel embeddingModel ;
3739
38- public void ingest (@ Observes StartupEvent event ) {
39- Log .infof ("Ingesting documents..." );
40- List <Document > documents = FileSystemDocumentLoader .loadDocuments (new File ("src/main/resources/catalog" ).toPath (),
41- new TextDocumentParser ());
40+ public void ingest (@ Observes StartupEvent event , @ ConfigProperty (name = "offerings.folder" , defaultValue = "src/main/resources/catalog" ) Path source ) {
41+ Log .infof ("Ingesting documents from " + source .toAbsolutePath ());
42+ List <Document > documents = FileSystemDocumentLoader .loadDocuments (source , new TextDocumentParser ());
4243 var ingestor = EmbeddingStoreIngestor .builder ()
4344 .embeddingStore (store )
4445 .embeddingModel (embeddingModel )
You can’t perform that action at this time.
0 commit comments