Skip to content

Commit 15e93ea

Browse files
committed
Fix the chatbot demo
1 parent 1cdd1c1 commit 15e93ea

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

demo/src/Audio/Chat.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Symfony\AI\Platform\Message\Message;
1818
use Symfony\AI\Platform\Message\MessageBag;
1919
use Symfony\AI\Platform\PlatformInterface;
20-
use Symfony\AI\Platform\Result\TextResult;
20+
use Symfony\AI\Platform\Response\TextResponse;
2121
use Symfony\Component\DependencyInjection\Attribute\Autowire;
2222
use Symfony\Component\HttpFoundation\RequestStack;
2323

@@ -56,7 +56,7 @@ public function submitMessage(string $message): void
5656
$messages->add(Message::ofUser($message));
5757
$result = $this->agent->call($messages);
5858

59-
\assert($result instanceof TextResult);
59+
\assert($result instanceof TextResponse);
6060

6161
$messages->add(Message::ofAssistant($result->getContent()));
6262

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,

demo/src/Wikipedia/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

@@ -41,7 +41,7 @@ public function submitMessage(string $message): void
4141
$messages->add(Message::ofUser($message));
4242
$result = $this->agent->call($messages);
4343

44-
\assert($result instanceof TextResult);
44+
\assert($result instanceof TextResponse);
4545

4646
$messages->add(Message::ofAssistant($result->getContent()));
4747

demo/src/YouTube/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

@@ -63,7 +63,7 @@ public function submitMessage(string $message): void
6363
$messages->add(Message::ofUser($message));
6464
$result = $this->agent->call($messages);
6565

66-
\assert($result instanceof TextResult);
66+
\assert($result instanceof TextResponse);
6767

6868
$messages->add(Message::ofAssistant($result->getContent()));
6969

0 commit comments

Comments
 (0)