Skip to content

Commit 0f07686

Browse files
committed
[Store] Add a way to store document content when using Chroma DB
1 parent b83c469 commit 0f07686

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/store/src/Bridge/ChromaDb/Store.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ public function add(VectorDocument ...$documents): void
4242
$ids[] = (string) $document->id;
4343
$vectors[] = $document->vector->getData();
4444
$metadata[] = $document->metadata->getArrayCopy();
45+
$originalDocuments[] = $document->metadata['content'];
4546
}
4647

4748
$collection = $this->client->getOrCreateCollection($this->collectionName);
48-
$collection->add($ids, $vectors, $metadata);
49+
$collection->add($ids, $vectors, $metadata, $originalDocuments);
4950
}
5051

5152
public function query(Vector $vector, array $options = []): array

0 commit comments

Comments
 (0)