filePath = $filePath; } /** * Load from file path. * * @return Document[] */ public function load(): array { $text = file_get_contents($this->filePath->getRealPath()); $metadata = ['source' => $this->filePath->getRealPath()]; return [new Document(pageContent:$text, metadata: $metadata)]; } }