-
-
Notifications
You must be signed in to change notification settings - Fork 122
Open
Labels
RFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)StoreIssues & PRs about the AI Store componentIssues & PRs about the AI Store component
Description
Hi,
I'm using ChromaDB bridge and the query method return only 4 results. Why this value has been hardcoded ?
Here the expected code:
/**
* @param array{where?: array<string, string>, whereDocument?: array<string, mixed>, nResults?: int} $options
*/
public function query(Vector $vector, array $options = []): array
{
$collection = $this->client->getOrCreateCollection($this->collectionName);
$queryResponse = $collection->query(
queryEmbeddings: [$vector->getData()],
nResults: $options['nResults'] ?? 4, // if no limit (aka nResults) passed, use the hardcoded value
where: $options['where'] ?? null,
whereDocument: $options['whereDocument'] ?? null,
);
$documents = [];
for ($i = 0; $i < \count($queryResponse->metadatas[0]); ++$i) {
$documents[] = new VectorDocument(
id: Uuid::fromString($queryResponse->ids[0][$i]),
vector: new Vector($queryResponse->embeddings[0][$i]),
metadata: new Metadata($queryResponse->metadatas[0][$i]),
);
}
return $documents;
}What do you think about that? I'm able to create the PR. Just tell me.
Metadata
Metadata
Assignees
Labels
RFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)StoreIssues & PRs about the AI Store componentIssues & PRs about the AI Store component