Closed OskarStark closed 1 month ago
what do you think about like a tupel of document classes:
TextDocument
and VectorDocument
- both have an UUID and Metadata
/**
* @param TextDocument|TextDocument[] $documents
*/
DocumentEmbedder::create(TextDocument|array $documents, ...): void
// only converting than
$vectorDocuments[] = new VectorDocument($vectors[$i], $document->id, $document->metadata);
// and drop text in store context completely
/**
* @param VectorDocument|VectorDocument[] $documents
**/
StoreInterface::add(VectorDocument|array $documents): void;
/**
* @return VectorDocument[]
*/
VectorStoreInterface::query(Vector $vector, array $options = []): array;
I like it, I thought sth like this without inheritance too in the beginning
thought about a Document
interface with getId(): Uuid
and getMetadata(): Metadata;
- but i don't see a user of that interface in our code :D
No I don't think we need that abstraction upstream
you want to tackle that with your PRs or shall I?
If you have time, go ahead. Either use my PR or open a new one where you do the transformation completely
Superseded by
Can be merged after
85