Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/agent/tests/ChatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Small;
use PHPUnit\Framework\Attributes\UsesClass;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Symfony\AI\Agent\AgentInterface;
use Symfony\AI\Agent\Chat;
Expand All @@ -30,8 +31,8 @@
#[Small]
final class ChatTest extends TestCase
{
private AgentInterface&\PHPUnit\Framework\MockObject\MockObject $agent;
private MessageStoreInterface&\PHPUnit\Framework\MockObject\MockObject $store;
private AgentInterface&MockObject $agent;
private MessageStoreInterface&MockObject $store;
private Chat $chat;

protected function setUp(): void
Expand Down
3 changes: 2 additions & 1 deletion src/ai-bundle/src/Command/ChatCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Completion\CompletionInput;
use Symfony\Component\Console\Completion\CompletionSuggestions;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -96,7 +97,7 @@ protected function interact(InputInterface $input, OutputInterface $output): voi
);
$question->setErrorMessage('Agent %s is invalid.');

/** @var \Symfony\Component\Console\Helper\QuestionHelper $helper */
/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$selectedAgent = $helper->ask($input, $output, $question);

Expand Down
8 changes: 5 additions & 3 deletions src/platform/tests/Bridge/Ollama/OllamaClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
use PHPUnit\Framework\TestCase;
use Symfony\AI\Platform\Bridge\Ollama\Ollama;
use Symfony\AI\Platform\Bridge\Ollama\OllamaClient;
use Symfony\AI\Platform\Bridge\Ollama\OllamaResultConverter;
use Symfony\AI\Platform\Bridge\Ollama\PlatformFactory;
use Symfony\AI\Platform\Model;
use Symfony\AI\Platform\Result\RawHttpResult;
use Symfony\AI\Platform\Result\StreamResult;
use Symfony\Component\HttpClient\MockHttpClient;
use Symfony\Component\HttpClient\Response\JsonMockResponse;
Expand Down Expand Up @@ -153,8 +155,8 @@ public function testStreamingConverterWithDirectResponse()
]);

$mockResponse = $mockHttpClient->request('GET', 'http://test.example');
$rawResult = new \Symfony\AI\Platform\Result\RawHttpResult($mockResponse);
$converter = new \Symfony\AI\Platform\Bridge\Ollama\OllamaResultConverter();
$rawResult = new RawHttpResult($mockResponse);
$converter = new OllamaResultConverter();

$result = $converter->convert($rawResult, ['stream' => true]);

Expand All @@ -170,7 +172,7 @@ public function testStreamingConverterWithDirectResponse()
]);

$regularMockResponse = $regularMockHttpClient->request('GET', 'http://test.example');
$regularRawResult = new \Symfony\AI\Platform\Result\RawHttpResult($regularMockResponse);
$regularRawResult = new RawHttpResult($regularMockResponse);
$regularResult = $converter->convert($regularRawResult, ['stream' => false]);

$this->assertNotInstanceOf(StreamResult::class, $regularResult);
Expand Down
3 changes: 2 additions & 1 deletion src/store/tests/Document/VectorizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
use Symfony\AI\Store\Document\TextDocument;
use Symfony\AI\Store\Document\VectorDocument;
use Symfony\AI\Store\Document\Vectorizer;
use Symfony\AI\Store\Exception\RuntimeException;
use Symfony\AI\Store\Tests\Double\PlatformTestHandler;
use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Component\Uid\Uuid;
Expand Down Expand Up @@ -375,7 +376,7 @@ public function testVectorizeStringThrowsExceptionWhenNoVectorReturned()

$vectorizer = new Vectorizer($platform, $model);

$this->expectException(\Symfony\AI\Store\Exception\RuntimeException::class);
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('No vector returned for string vectorization.');

$vectorizer->vectorize($text);
Expand Down