Skip to content

Commit e6c8066

Browse files
committed
Fix the chatbot demo
1 parent 1cdd1c1 commit e6c8066

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

demo/src/Blog/Chat.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\AI\Agent\AgentInterface;
1515
use Symfony\AI\Platform\Message\Message;
1616
use Symfony\AI\Platform\Message\MessageBag;
17-
use Symfony\AI\Platform\Result\TextResult;
17+
use Symfony\AI\Platform\Response\TextResponse;
1818
use Symfony\Component\DependencyInjection\Attribute\Autowire;
1919
use Symfony\Component\HttpFoundation\RequestStack;
2020

@@ -51,7 +51,7 @@ public function submitMessage(string $message): void
5151
$messages->add(Message::ofUser($message));
5252
$result = $this->agent->call($messages);
5353

54-
\assert($result instanceof TextResult);
54+
\assert($result instanceof TextResponse);
5555

5656
$messages->add(Message::ofAssistant($result->getContent()));
5757

demo/src/Blog/Command/QueryCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4848
$io->comment(\sprintf('Converting "%s" to vector & searching in Chroma DB ...', $search));
4949
$io->comment('Results are limited to 4 most similar documents.');
5050

51-
$platformResponse = $this->platform->invoke(new Embeddings(), $search);
51+
$platformResponse = $this->platform->request(new Embeddings(), $search);
5252
$queryResponse = $collection->query(
5353
queryEmbeddings: [$platformResponse->asVectors()[0]->getData()],
5454
nResults: 4,

0 commit comments

Comments
 (0)