-
-
Notifications
You must be signed in to change notification settings - Fork 103
Closed
Labels
BugSomething isn't workingSomething isn't workingDemoIssues & PRs about the demo applicationIssues & PRs about the demo applicationStatus: Needs ReviewStoreIssues & PRs about the AI Store componentIssues & PRs about the AI Store component
Description
this code in demo:
ai/demo/src/Blog/Command/QueryCommand.php
Lines 44 to 52 in a4747cb
$search = $io->ask('What do you want to know about?', 'New Symfony Features'); | |
$io->comment(\sprintf('Converting "%s" to vector & searching in Chroma DB ...', $search)); | |
$io->comment('Results are limited to 4 most similar documents.'); | |
$vector = $this->vectorizer->vectorize($search); | |
$queryResponse = $collection->query( | |
queryEmbeddings: [$vector->getData()], | |
nResults: 4, | |
); |
with this return:
ai/src/store/src/Document/VectorizerInterface.php
Lines 29 to 37 in a4747cb
* @return Vector|VectorDocument|array<Vector>|array<VectorDocument> | |
* | |
* @phpstan-return ( | |
* $values is string|\Stringable ? Vector : ( | |
* $values is EmbeddableDocumentInterface ? VectorDocument : ( | |
* $values is array<string|\Stringable> ? array<Vector> : array<VectorDocument> | |
* ) | |
* ) | |
* ) |
leads to:
------ ---------------------------------------------------------------------------------------------------------------
Line src/Blog/Command/QueryCommand.php
------ ---------------------------------------------------------------------------------------------------------------
50 Cannot call method getData() on array<Symfony\AI\Platform\Vector\Vector|Symfony\AI\Store\Document\VectorDocum
ent>|Symfony\AI\Platform\Vector\Vector|Symfony\AI\Store\Document\VectorDocument.
🪪 method.nonObject
------ ---------------------------------------------------------------------------------------------------------------
How to reproduce
Reproducible by removing that @phpstan-ignore in that demo class QueryCommand
and executing phpstan in demo folder.
Originally posted by @chr-hertel in #760 (comment)
Metadata
Metadata
Assignees
Labels
BugSomething isn't workingSomething isn't workingDemoIssues & PRs about the demo applicationIssues & PRs about the demo applicationStatus: Needs ReviewStoreIssues & PRs about the AI Store componentIssues & PRs about the AI Store component