[Bug] Undefined constant Doctrine\ORM\Query\Lexer::T_IDENTIFIER
Hello, I've encountered this error when i execute answerQuestion :
Undefined constant Doctrine\ORM\Query\Lexer::T_IDENTIFIER
vendor/theodo-group/llphant/src/Embeddings/VectorStores/Doctrine/PgVectorL2OperatorDql.php:23
Here my code :
$config = new OpenAIConfig();
$config->apiKey = $_ENV['OPENAI_API_KEY'];
$embeddingGenerator = new OpenAI3SmallEmbeddingGenerator($config);
$vectorStore = new DoctrineVectorStore($entityManager, Document::class);
$qa = new QuestionAnswering(
$vectorStore,
$embeddingGenerator,
new OpenAIChat($config)
);
$answer = $qa->answerQuestion('what is the secret of Alice?');
Have you an idea ? Thank you
Hey @gponty.
Can you follow the example in tests/Integration/Embeddings/VectorStores/Doctrine/DoctrineVectorStoreTest.php which are working and see if you still have the problem?
if yes, can you provide your the entity and the code your are using to build the $entityManager ?
Thank you @MaximeThoonsen I found the problem, I'm using ORM 3 while LLPHANT uses version 2.
@gponty We should make it compliant with the new version. How did you manage to use it and what framework do you use?
Nothing :). I just switched back to version 2, for now it's just a POC. I'm working on Symfony 7.
yea so i changed it as it has changed from Lexer:: to TokenType:: which is in Doctrine\ORM\Query\TokenType that has all of those constants now