File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 33namespace NeuronAI \RAG \DataLoader ;
44
55use NeuronAI \RAG \Document ;
6+ use NeuronAI \RAG \Splitters \DocumentSplitter ;
67
78class FileDataLoader implements DataLoaderInterface
89{
@@ -79,7 +80,7 @@ protected function getDocumentsFromDirectory(string $directory): array
7980 closedir ($ handle );
8081 }
8182
82- return $ documents ;
83+ return DocumentSplitter:: splitDocuments ( $ documents) ;
8384 }
8485
8586 /**
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace NeuronAI \RAG \DataLoader ;
4+
5+ use NeuronAI \RAG \Document ;
6+ use NeuronAI \RAG \Splitters \DocumentSplitter ;
7+
8+ class StringDataLoader implements DataLoaderInterface
9+ {
10+ public function __construct (protected string $ content ) {}
11+
12+ public function getDocuments (): array
13+ {
14+ return DocumentSplitter::splitDocument (new Document ($ this ->content ));
15+ }
16+ }
You can’t perform that action at this time.
0 commit comments