diff --git a/examples/anthropic/stream.php b/examples/anthropic/stream.php index a6a55093b..5046d6e58 100644 --- a/examples/anthropic/stream.php +++ b/examples/anthropic/stream.php @@ -17,7 +17,7 @@ require_once dirname(__DIR__).'/bootstrap.php'; $platform = PlatformFactory::create(env('ANTHROPIC_API_KEY'), httpClient: http_client()); -$model = new Claude(); +$model = new Claude(Claude::SONNET_37); $messages = new MessageBag( Message::forSystem('You are a thoughtful philosopher.'), diff --git a/examples/anthropic/toolcall.php b/examples/anthropic/toolcall.php index 06a37a835..9fee56792 100644 --- a/examples/anthropic/toolcall.php +++ b/examples/anthropic/toolcall.php @@ -21,7 +21,7 @@ require_once dirname(__DIR__).'/bootstrap.php'; $platform = PlatformFactory::create(env('ANTHROPIC_API_KEY'), httpClient: http_client()); -$model = new Claude(); +$model = new Claude(Claude::SONNET_37); $wikipedia = new Wikipedia(http_client()); $toolbox = new Toolbox([$wikipedia], logger: logger()); diff --git a/examples/bedrock/toolcall-nova.php b/examples/bedrock/toolcall-nova.php index 2b361b9f4..0dbc25a00 100644 --- a/examples/bedrock/toolcall-nova.php +++ b/examples/bedrock/toolcall-nova.php @@ -27,7 +27,7 @@ } $platform = PlatformFactory::create(); -$model = new Nova(); +$model = new Nova(Nova::PRO); $wikipedia = new Wikipedia(http_client()); $toolbox = new Toolbox([$wikipedia]); diff --git a/examples/elevenlabs/text-to-speech-as-stream.php b/examples/elevenlabs/text-to-speech-as-stream.php index abe696449..f16b9f5e2 100644 --- a/examples/elevenlabs/text-to-speech-as-stream.php +++ b/examples/elevenlabs/text-to-speech-as-stream.php @@ -19,7 +19,7 @@ apiKey: env('ELEVEN_LABS_API_KEY'), httpClient: http_client(), ); -$model = new ElevenLabs(options: [ +$model = new ElevenLabs(ElevenLabs::ELEVEN_MULTILINGUAL_V2, [ 'voice' => 'Dslrhjl3ZpzrctukrQSN', // Brad (https://elevenlabs.io/app/voice-library?voiceId=Dslrhjl3ZpzrctukrQSN) 'stream' => true, ]); diff --git a/examples/elevenlabs/text-to-speech.php b/examples/elevenlabs/text-to-speech.php index b37c7da6d..8e2a80e73 100644 --- a/examples/elevenlabs/text-to-speech.php +++ b/examples/elevenlabs/text-to-speech.php @@ -19,7 +19,7 @@ apiKey: env('ELEVEN_LABS_API_KEY'), httpClient: http_client(), ); -$model = new ElevenLabs(options: [ +$model = new ElevenLabs(ElevenLabs::ELEVEN_MULTILINGUAL_V2, [ 'voice' => 'Dslrhjl3ZpzrctukrQSN', // Brad (https://elevenlabs.io/app/voice-library?voiceId=Dslrhjl3ZpzrctukrQSN) ]); diff --git a/examples/mistral/chat-multiple.php b/examples/mistral/chat-multiple.php index 8921b8916..8f361d458 100644 --- a/examples/mistral/chat-multiple.php +++ b/examples/mistral/chat-multiple.php @@ -22,7 +22,7 @@ Message::forSystem('Just give short answers.'), Message::ofUser('What is your favorite color?'), ); -$result = $platform->invoke(new Mistral(), $messages, [ +$result = $platform->invoke(new Mistral(Mistral::MISTRAL_LARGE), $messages, [ 'temperature' => 1.5, 'n' => 10, ]); diff --git a/examples/mistral/chat.php b/examples/mistral/chat.php index 33b08405c..d880efa35 100644 --- a/examples/mistral/chat.php +++ b/examples/mistral/chat.php @@ -17,7 +17,7 @@ require_once dirname(__DIR__).'/bootstrap.php'; $platform = PlatformFactory::create(env('MISTRAL_API_KEY'), http_client()); -$model = new Mistral(); +$model = new Mistral(Mistral::MISTRAL_LARGE); $messages = new MessageBag(Message::ofUser('What is the best French cheese?')); $result = $platform->invoke($model, $messages, [ diff --git a/examples/mistral/stream.php b/examples/mistral/stream.php index b6653b10a..a6a5473e8 100644 --- a/examples/mistral/stream.php +++ b/examples/mistral/stream.php @@ -17,7 +17,7 @@ require_once dirname(__DIR__).'/bootstrap.php'; $platform = PlatformFactory::create(env('MISTRAL_API_KEY'), http_client()); -$model = new Mistral(); +$model = new Mistral(Mistral::MISTRAL_LARGE); $messages = new MessageBag(Message::ofUser('What is the eighth prime number?')); $result = $platform->invoke($model, $messages, [ diff --git a/examples/mistral/token-metadata.php b/examples/mistral/token-metadata.php index 76bd84af3..1ce8f5c34 100644 --- a/examples/mistral/token-metadata.php +++ b/examples/mistral/token-metadata.php @@ -19,7 +19,7 @@ require_once dirname(__DIR__).'/bootstrap.php'; $platform = PlatformFactory::create(env('MISTRAL_API_KEY'), http_client()); -$model = new Mistral(); +$model = new Mistral(Mistral::MISTRAL_LARGE); $agent = new Agent($platform, $model, outputProcessors: [new TokenOutputProcessor()], logger: logger()); diff --git a/examples/mistral/toolcall-stream.php b/examples/mistral/toolcall-stream.php index b13a54ab7..5f7a9e50d 100644 --- a/examples/mistral/toolcall-stream.php +++ b/examples/mistral/toolcall-stream.php @@ -21,7 +21,7 @@ require_once dirname(__DIR__).'/bootstrap.php'; $platform = PlatformFactory::create(env('MISTRAL_API_KEY'), http_client()); -$model = new Mistral(); +$model = new Mistral(Mistral::MISTRAL_LARGE); $transcriber = new YouTubeTranscriber(http_client()); $toolbox = new Toolbox([$transcriber], logger: logger()); diff --git a/examples/mistral/toolcall.php b/examples/mistral/toolcall.php index 44ee8aea7..b8a9710ba 100644 --- a/examples/mistral/toolcall.php +++ b/examples/mistral/toolcall.php @@ -21,7 +21,7 @@ require_once dirname(__DIR__).'/bootstrap.php'; $platform = PlatformFactory::create(env('MISTRAL_API_KEY'), http_client()); -$model = new Mistral(); +$model = new Mistral(Mistral::MISTRAL_LARGE); $toolbox = new Toolbox([new Clock()], logger: logger()); $processor = new AgentProcessor($toolbox); diff --git a/examples/perplexity/academic-search.php b/examples/perplexity/academic-search.php index 8e7149c26..033b53f66 100644 --- a/examples/perplexity/academic-search.php +++ b/examples/perplexity/academic-search.php @@ -19,7 +19,7 @@ require_once dirname(__DIR__).'/bootstrap.php'; $platform = PlatformFactory::create(env('PERPLEXITY_API_KEY'), http_client()); -$model = new Perplexity(); +$model = new Perplexity(Perplexity::SONAR); $agent = new Agent($platform, $model, outputProcessors: [new SearchResultProcessor()], logger: logger()); $messages = new MessageBag(Message::ofUser('What is the best French cheese of the first quarter-century of 21st century?')); diff --git a/examples/perplexity/chat.php b/examples/perplexity/chat.php index b52d07382..ce906e4dd 100644 --- a/examples/perplexity/chat.php +++ b/examples/perplexity/chat.php @@ -17,7 +17,7 @@ require_once dirname(__DIR__).'/bootstrap.php'; $platform = PlatformFactory::create(env('PERPLEXITY_API_KEY'), http_client()); -$model = new Perplexity(); +$model = new Perplexity(Perplexity::SONAR); $messages = new MessageBag(Message::ofUser('What is the best French cheese?')); $response = $platform->invoke($model, $messages); diff --git a/examples/perplexity/disable-search.php b/examples/perplexity/disable-search.php index d60874f64..fb003d1a1 100644 --- a/examples/perplexity/disable-search.php +++ b/examples/perplexity/disable-search.php @@ -17,7 +17,7 @@ require_once dirname(__DIR__).'/bootstrap.php'; $platform = PlatformFactory::create(env('PERPLEXITY_API_KEY'), http_client()); -$model = new Perplexity(); +$model = new Perplexity(Perplexity::SONAR); $messages = new MessageBag(Message::ofUser('What is 2 + 2?')); $response = $platform->invoke($model, $messages, [ diff --git a/examples/perplexity/image-input-url.php b/examples/perplexity/image-input-url.php index ea8c08432..0bb832242 100644 --- a/examples/perplexity/image-input-url.php +++ b/examples/perplexity/image-input-url.php @@ -20,7 +20,7 @@ require_once dirname(__DIR__).'/bootstrap.php'; $platform = PlatformFactory::create(env('PERPLEXITY_API_KEY'), http_client()); -$model = new Perplexity(); +$model = new Perplexity(Perplexity::SONAR); $agent = new Agent($platform, $model, outputProcessors: [new SearchResultProcessor()], logger: logger()); $messages = new MessageBag( diff --git a/examples/perplexity/pdf-input-url.php b/examples/perplexity/pdf-input-url.php index 6454498c0..c3f7434b0 100644 --- a/examples/perplexity/pdf-input-url.php +++ b/examples/perplexity/pdf-input-url.php @@ -20,7 +20,7 @@ require_once dirname(__DIR__).'/bootstrap.php'; $platform = PlatformFactory::create(env('PERPLEXITY_API_KEY'), http_client()); -$model = new Perplexity(); +$model = new Perplexity(Perplexity::SONAR); $agent = new Agent($platform, $model, outputProcessors: [new SearchResultProcessor()], logger: logger()); $messages = new MessageBag( diff --git a/examples/perplexity/stream.php b/examples/perplexity/stream.php index 5f2bb526a..8311ae583 100644 --- a/examples/perplexity/stream.php +++ b/examples/perplexity/stream.php @@ -19,7 +19,7 @@ require_once dirname(__DIR__).'/bootstrap.php'; $platform = PlatformFactory::create(env('PERPLEXITY_API_KEY'), http_client()); -$model = new Perplexity(); +$model = new Perplexity(Perplexity::SONAR); $agent = new Agent($platform, $model, outputProcessors: [new SearchResultProcessor()], logger: logger()); $messages = new MessageBag( diff --git a/examples/perplexity/token-metadata.php b/examples/perplexity/token-metadata.php index 3f32e2597..400b03216 100644 --- a/examples/perplexity/token-metadata.php +++ b/examples/perplexity/token-metadata.php @@ -19,7 +19,7 @@ require_once dirname(__DIR__).'/bootstrap.php'; $platform = PlatformFactory::create(env('PERPLEXITY_API_KEY'), http_client()); -$model = new Perplexity(); +$model = new Perplexity(Perplexity::SONAR); $agent = new Agent($platform, $model, outputProcessors: [new TokenOutputProcessor()], logger: logger()); $messages = new MessageBag( diff --git a/examples/perplexity/web-search.php b/examples/perplexity/web-search.php index 42a85126d..92ca9a2f8 100644 --- a/examples/perplexity/web-search.php +++ b/examples/perplexity/web-search.php @@ -17,7 +17,7 @@ require_once dirname(__DIR__).'/bootstrap.php'; $platform = PlatformFactory::create(env('PERPLEXITY_API_KEY'), http_client()); -$model = new Perplexity(); +$model = new Perplexity(Perplexity::SONAR); $messages = new MessageBag(Message::ofUser('What is the best French cheese?')); $response = $platform->invoke($model, $messages, [ diff --git a/src/agent/tests/InputProcessor/ModelOverrideInputProcessorTest.php b/src/agent/tests/InputProcessor/ModelOverrideInputProcessorTest.php index bfa1f42f9..1ce0abd45 100644 --- a/src/agent/tests/InputProcessor/ModelOverrideInputProcessorTest.php +++ b/src/agent/tests/InputProcessor/ModelOverrideInputProcessorTest.php @@ -35,8 +35,8 @@ final class ModelOverrideInputProcessorTest extends TestCase { public function testProcessInputWithValidModelOption() { - $gpt = new Gpt(); - $claude = new Claude(); + $gpt = new Gpt(Gpt::GPT_4O); + $claude = new Claude(Claude::SONNET_37); $input = new Input($gpt, new MessageBag(), ['model' => $claude]); $processor = new ModelOverrideInputProcessor(); @@ -47,7 +47,7 @@ public function testProcessInputWithValidModelOption() public function testProcessInputWithoutModelOption() { - $gpt = new Gpt(); + $gpt = new Gpt(Gpt::GPT_4O); $input = new Input($gpt, new MessageBag()); $processor = new ModelOverrideInputProcessor(); @@ -61,7 +61,7 @@ public function testProcessInputWithInvalidModelOption() $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Option "model" must be an instance of "'.Model::class.'".'); - $gpt = new Gpt(); + $gpt = new Gpt(Gpt::GPT_4O); $model = new MessageBag(); $input = new Input($gpt, new MessageBag(), ['model' => $model]); diff --git a/src/agent/tests/InputProcessor/SystemPromptInputProcessorTest.php b/src/agent/tests/InputProcessor/SystemPromptInputProcessorTest.php index e0177ff4d..84325c047 100644 --- a/src/agent/tests/InputProcessor/SystemPromptInputProcessorTest.php +++ b/src/agent/tests/InputProcessor/SystemPromptInputProcessorTest.php @@ -48,7 +48,7 @@ public function testProcessInputAddsSystemMessageWhenNoneExists() { $processor = new SystemPromptInputProcessor('This is a system prompt'); - $input = new Input(new Gpt(), new MessageBag(Message::ofUser('This is a user message'))); + $input = new Input(new Gpt(Gpt::GPT_4O), new MessageBag(Message::ofUser('This is a user message'))); $processor->processInput($input); $messages = $input->messages->getMessages(); @@ -66,7 +66,7 @@ public function testProcessInputDoesNotAddSystemMessageWhenOneExists() Message::forSystem('This is already a system prompt'), Message::ofUser('This is a user message'), ); - $input = new Input(new Gpt(), $messages); + $input = new Input(new Gpt(Gpt::GPT_4O), $messages); $processor->processInput($input); $messages = $input->messages->getMessages(); @@ -93,7 +93,7 @@ public function execute(ToolCall $toolCall): mixed }, ); - $input = new Input(new Gpt(), new MessageBag(Message::ofUser('This is a user message'))); + $input = new Input(new Gpt(Gpt::GPT_4O), new MessageBag(Message::ofUser('This is a user message'))); $processor->processInput($input); $messages = $input->messages->getMessages(); @@ -133,7 +133,7 @@ public function execute(ToolCall $toolCall): mixed true, ); - $input = new Input(new Gpt(), new MessageBag(Message::ofUser('This is a user message'))); + $input = new Input(new Gpt(Gpt::GPT_4O), new MessageBag(Message::ofUser('This is a user message'))); $processor->processInput($input); $messages = $input->messages->getMessages(); @@ -175,7 +175,7 @@ public function execute(ToolCall $toolCall): mixed }, ); - $input = new Input(new Gpt(), new MessageBag(Message::ofUser('This is a user message'))); + $input = new Input(new Gpt(Gpt::GPT_4O), new MessageBag(Message::ofUser('This is a user message'))); $processor->processInput($input); $messages = $input->messages->getMessages(); @@ -198,7 +198,7 @@ public function testWithTranslatedSystemPrompt() { $processor = new SystemPromptInputProcessor('This is a', null, $this->getTranslator(), true); - $input = new Input(new Gpt(), new MessageBag(Message::ofUser('This is a user message')), []); + $input = new Input(new Gpt(Gpt::GPT_4O), new MessageBag(Message::ofUser('This is a user message')), []); $processor->processInput($input); $messages = $input->messages->getMessages(); @@ -218,7 +218,7 @@ public function testWithTranslationDomainSystemPrompt() 'prompts' ); - $input = new Input(new Gpt(), new MessageBag(), []); + $input = new Input(new Gpt(Gpt::GPT_4O), new MessageBag(), []); $processor->processInput($input); $messages = $input->messages->getMessages(); diff --git a/src/platform/src/Bridge/Anthropic/Claude.php b/src/platform/src/Bridge/Anthropic/Claude.php index e1bec6e4f..a208773a5 100644 --- a/src/platform/src/Bridge/Anthropic/Claude.php +++ b/src/platform/src/Bridge/Anthropic/Claude.php @@ -35,7 +35,7 @@ class Claude extends Model * @param array $options The default options for the model usage */ public function __construct( - string $name = self::SONNET_37, + string $name, array $options = ['max_tokens' => 1000], ) { $capabilities = [ diff --git a/src/platform/src/Bridge/Bedrock/Nova/Nova.php b/src/platform/src/Bridge/Bedrock/Nova/Nova.php index 0064d142b..2839fd4c7 100644 --- a/src/platform/src/Bridge/Bedrock/Nova/Nova.php +++ b/src/platform/src/Bridge/Bedrock/Nova/Nova.php @@ -28,7 +28,7 @@ final class Nova extends Model * @param array $options The default options for the model usage */ public function __construct( - string $name = self::PRO, + string $name, array $options = ['max_tokens' => 1000], ) { $capabilities = [ diff --git a/src/platform/src/Bridge/ElevenLabs/ElevenLabs.php b/src/platform/src/Bridge/ElevenLabs/ElevenLabs.php index 63ba580d1..476f1d9f4 100644 --- a/src/platform/src/Bridge/ElevenLabs/ElevenLabs.php +++ b/src/platform/src/Bridge/ElevenLabs/ElevenLabs.php @@ -32,7 +32,7 @@ final class ElevenLabs extends Model public const SCRIBE_V1_EXPERIMENTAL = 'scribe_v1_experimental'; public function __construct( - string $name = self::ELEVEN_MULTILINGUAL_V2, + string $name, array $options = [], ) { parent::__construct($name, [], $options); diff --git a/src/platform/src/Bridge/Mistral/Embeddings.php b/src/platform/src/Bridge/Mistral/Embeddings.php index 6f96f5f48..e9321027d 100644 --- a/src/platform/src/Bridge/Mistral/Embeddings.php +++ b/src/platform/src/Bridge/Mistral/Embeddings.php @@ -25,7 +25,7 @@ final class Embeddings extends Model * @param array $options */ public function __construct( - string $name = self::MISTRAL_EMBED, + string $name, array $options = [], ) { parent::__construct($name, [Capability::INPUT_MULTIPLE], $options); diff --git a/src/platform/src/Bridge/Mistral/Mistral.php b/src/platform/src/Bridge/Mistral/Mistral.php index 44e8e03fd..9d2a4533a 100644 --- a/src/platform/src/Bridge/Mistral/Mistral.php +++ b/src/platform/src/Bridge/Mistral/Mistral.php @@ -36,7 +36,7 @@ final class Mistral extends Model * @param array $options */ public function __construct( - string $name = self::MISTRAL_LARGE, + string $name, array $options = [], ) { $capabilities = [ diff --git a/src/platform/src/Bridge/OpenAi/Gpt.php b/src/platform/src/Bridge/OpenAi/Gpt.php index 286456f5f..a60d4b580 100644 --- a/src/platform/src/Bridge/OpenAi/Gpt.php +++ b/src/platform/src/Bridge/OpenAi/Gpt.php @@ -74,7 +74,7 @@ class Gpt extends Model * @param array $options The default options for the model usage */ public function __construct( - string $name = self::GPT_4O, + string $name, array $options = [], ) { $capabilities = [ diff --git a/src/platform/src/Bridge/Perplexity/Perplexity.php b/src/platform/src/Bridge/Perplexity/Perplexity.php index 93a7a20d5..8a8ae700c 100644 --- a/src/platform/src/Bridge/Perplexity/Perplexity.php +++ b/src/platform/src/Bridge/Perplexity/Perplexity.php @@ -29,7 +29,7 @@ final class Perplexity extends Model * @param array $options */ public function __construct( - string $name = self::SONAR, + string $name, array $options = [], ) { $capabilities = [ diff --git a/src/platform/tests/Bridge/Anthropic/Contract/AssistantMessageNormalizerTest.php b/src/platform/tests/Bridge/Anthropic/Contract/AssistantMessageNormalizerTest.php index 72ba32b29..81c00c0a5 100644 --- a/src/platform/tests/Bridge/Anthropic/Contract/AssistantMessageNormalizerTest.php +++ b/src/platform/tests/Bridge/Anthropic/Contract/AssistantMessageNormalizerTest.php @@ -36,7 +36,7 @@ public function testSupportsNormalization() $normalizer = new AssistantMessageNormalizer(); $this->assertTrue($normalizer->supportsNormalization(new AssistantMessage('Hello'), context: [ - Contract::CONTEXT_MODEL => new Claude(), + Contract::CONTEXT_MODEL => new Claude(Claude::SONNET_37), ])); $this->assertFalse($normalizer->supportsNormalization('not an assistant message')); } diff --git a/src/platform/tests/Bridge/Anthropic/ModelClientTest.php b/src/platform/tests/Bridge/Anthropic/ModelClientTest.php index 16a527fc2..d9e978991 100644 --- a/src/platform/tests/Bridge/Anthropic/ModelClientTest.php +++ b/src/platform/tests/Bridge/Anthropic/ModelClientTest.php @@ -27,7 +27,7 @@ class ModelClientTest extends TestCase protected function setUp(): void { - $this->model = new Claude(); + $this->model = new Claude(Claude::SONNET_37); } public function testAnthropicBetaHeaderIsSetWithSingleBetaFeature() diff --git a/src/platform/tests/Bridge/Bedrock/Nova/ContractTest.php b/src/platform/tests/Bridge/Bedrock/Nova/ContractTest.php index b04583e6d..91fcb59fd 100644 --- a/src/platform/tests/Bridge/Bedrock/Nova/ContractTest.php +++ b/src/platform/tests/Bridge/Bedrock/Nova/ContractTest.php @@ -55,7 +55,7 @@ public function testConvert(MessageBag $bag, array $expected) new UserMessageNormalizer(), ); - $this->assertEquals($expected, $contract->createRequestPayload(new Nova(), $bag)); + $this->assertEquals($expected, $contract->createRequestPayload(new Nova(Nova::PRO), $bag)); } /** diff --git a/src/platform/tests/Bridge/ElevenLabs/Contract/ElevenLabsContractTest.php b/src/platform/tests/Bridge/ElevenLabs/Contract/ElevenLabsContractTest.php index a50d0eeb7..baaddc3f3 100644 --- a/src/platform/tests/Bridge/ElevenLabs/Contract/ElevenLabsContractTest.php +++ b/src/platform/tests/Bridge/ElevenLabs/Contract/ElevenLabsContractTest.php @@ -29,7 +29,7 @@ public function testItCanCreatePayloadWithAudio() $contract = ElevenLabsContract::create(); - $payload = $contract->createRequestPayload(new ElevenLabs(), $audio); + $payload = $contract->createRequestPayload(new ElevenLabs(ElevenLabs::ELEVEN_MULTILINGUAL_V2), $audio); $this->assertSame([ 'type' => 'input_audio', diff --git a/src/platform/tests/Bridge/ElevenLabs/ElevenLabsClientTest.php b/src/platform/tests/Bridge/ElevenLabs/ElevenLabsClientTest.php index 9656e4eee..2d5dad788 100644 --- a/src/platform/tests/Bridge/ElevenLabs/ElevenLabsClientTest.php +++ b/src/platform/tests/Bridge/ElevenLabs/ElevenLabsClientTest.php @@ -41,7 +41,7 @@ public function testSupportsModel() 'https://api.elevenlabs.io/v1', ); - $this->assertTrue($client->supports(new ElevenLabs())); + $this->assertTrue($client->supports(new ElevenLabs(ElevenLabs::ELEVEN_MULTILINGUAL_V2))); $this->assertFalse($client->supports(new Model('any-model'))); } @@ -129,7 +129,7 @@ public function testClientCannotPerformTextToSpeechRequestWithoutValidPayload() $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('The payload must contain a "text" key'); $this->expectExceptionCode(0); - $client->request(new ElevenLabs(options: [ + $client->request(new ElevenLabs(ElevenLabs::ELEVEN_MULTILINGUAL_V2, [ 'voice' => 'Dslrhjl3ZpzrctukrQSN', ]), []); } @@ -154,7 +154,7 @@ public function testClientCanPerformTextToSpeechRequest() 'my-api-key', ); - $client->request(new ElevenLabs(options: [ + $client->request(new ElevenLabs(ElevenLabs::ELEVEN_MULTILINGUAL_V2, [ 'voice' => 'Dslrhjl3ZpzrctukrQSN', ]), [ 'text' => 'foo', @@ -183,7 +183,7 @@ public function testClientCanPerformTextToSpeechRequestAsStream() 'my-api-key', ); - $result = $client->request(new ElevenLabs(options: [ + $result = $client->request(new ElevenLabs(ElevenLabs::ELEVEN_MULTILINGUAL_V2, [ 'voice' => 'Dslrhjl3ZpzrctukrQSN', 'stream' => true, ]), [ diff --git a/src/platform/tests/Bridge/ElevenLabs/ElevenLabsConverterTest.php b/src/platform/tests/Bridge/ElevenLabs/ElevenLabsConverterTest.php index df09588c6..f7232254d 100644 --- a/src/platform/tests/Bridge/ElevenLabs/ElevenLabsConverterTest.php +++ b/src/platform/tests/Bridge/ElevenLabs/ElevenLabsConverterTest.php @@ -34,7 +34,7 @@ public function testSupportsModel() { $converter = new ElevenLabsResultConverter(new MockHttpClient()); - $this->assertTrue($converter->supports(new ElevenLabs())); + $this->assertTrue($converter->supports(new ElevenLabs(ElevenLabs::ELEVEN_MULTILINGUAL_V2))); $this->assertFalse($converter->supports(new Model('any-model'))); } diff --git a/src/platform/tests/Bridge/Mistral/Contract/DocumentNormalizerTest.php b/src/platform/tests/Bridge/Mistral/Contract/DocumentNormalizerTest.php index 8306f526b..0f2f58644 100644 --- a/src/platform/tests/Bridge/Mistral/Contract/DocumentNormalizerTest.php +++ b/src/platform/tests/Bridge/Mistral/Contract/DocumentNormalizerTest.php @@ -29,7 +29,7 @@ public function testSupportsNormalization() $normalizer = new DocumentNormalizer(); $this->assertTrue($normalizer->supportsNormalization(new Document('some content', 'application/pdf'), context: [ - Contract::CONTEXT_MODEL => new Mistral(), + Contract::CONTEXT_MODEL => new Mistral(Mistral::MISTRAL_LARGE), ])); $this->assertFalse($normalizer->supportsNormalization('not a document')); } diff --git a/src/platform/tests/Bridge/Mistral/Contract/DocumentUrlNormalizerTest.php b/src/platform/tests/Bridge/Mistral/Contract/DocumentUrlNormalizerTest.php index e5ecb3daf..7fe911fec 100644 --- a/src/platform/tests/Bridge/Mistral/Contract/DocumentUrlNormalizerTest.php +++ b/src/platform/tests/Bridge/Mistral/Contract/DocumentUrlNormalizerTest.php @@ -29,7 +29,7 @@ public function testSupportsNormalization() $normalizer = new DocumentUrlNormalizer(); $this->assertTrue($normalizer->supportsNormalization(new DocumentUrl('https://example.com/document.pdf'), context: [ - Contract::CONTEXT_MODEL => new Mistral(), + Contract::CONTEXT_MODEL => new Mistral(Mistral::MISTRAL_LARGE), ])); $this->assertFalse($normalizer->supportsNormalization('not a document url')); } diff --git a/src/platform/tests/Bridge/Perplexity/Contract/FileUrlNormalizerTest.php b/src/platform/tests/Bridge/Perplexity/Contract/FileUrlNormalizerTest.php index 7dafe4a2c..62d6390d8 100644 --- a/src/platform/tests/Bridge/Perplexity/Contract/FileUrlNormalizerTest.php +++ b/src/platform/tests/Bridge/Perplexity/Contract/FileUrlNormalizerTest.php @@ -31,7 +31,7 @@ public function testSupportsNormalization() $normalizer = new FileUrlNormalizer(); $this->assertTrue($normalizer->supportsNormalization(new DocumentUrl(\dirname(__DIR__, 6).'/fixtures/not-a-document.pdf'), context: [ - Contract::CONTEXT_MODEL => new Perplexity(), + Contract::CONTEXT_MODEL => new Perplexity(Perplexity::SONAR), ])); $this->assertFalse($normalizer->supportsNormalization('not a document')); } diff --git a/src/platform/tests/Bridge/Perplexity/ModelClientTest.php b/src/platform/tests/Bridge/Perplexity/ModelClientTest.php index b04a5af3e..c9bcc5b6a 100644 --- a/src/platform/tests/Bridge/Perplexity/ModelClientTest.php +++ b/src/platform/tests/Bridge/Perplexity/ModelClientTest.php @@ -81,7 +81,7 @@ public function testItIsSupportingTheCorrectModel() { $modelClient = new ModelClient(new MockHttpClient(), 'pplx-api-key'); - $this->assertTrue($modelClient->supports(new Perplexity())); + $this->assertTrue($modelClient->supports(new Perplexity(Perplexity::SONAR))); } public function testItIsExecutingTheCorrectRequest() @@ -96,7 +96,7 @@ public function testItIsExecutingTheCorrectRequest() }; $httpClient = new MockHttpClient([$resultCallback]); $modelClient = new ModelClient($httpClient, 'pplx-api-key'); - $modelClient->request(new Perplexity(), ['model' => 'sonar', 'messages' => [['role' => 'user', 'content' => 'test message']]]); + $modelClient->request(new Perplexity(Perplexity::SONAR), ['model' => 'sonar', 'messages' => [['role' => 'user', 'content' => 'test message']]]); } public function testItIsExecutingTheCorrectRequestWithArrayPayload() @@ -111,6 +111,6 @@ public function testItIsExecutingTheCorrectRequestWithArrayPayload() }; $httpClient = new MockHttpClient([$resultCallback]); $modelClient = new ModelClient($httpClient, 'pplx-api-key'); - $modelClient->request(new Perplexity(), ['model' => 'sonar', 'messages' => [['role' => 'user', 'content' => 'Hello']]]); + $modelClient->request(new Perplexity(Perplexity::SONAR), ['model' => 'sonar', 'messages' => [['role' => 'user', 'content' => 'Hello']]]); } } diff --git a/src/platform/tests/Bridge/Perplexity/PerplexityTest.php b/src/platform/tests/Bridge/Perplexity/PerplexityTest.php index 31b7aa3f2..176a476d2 100644 --- a/src/platform/tests/Bridge/Perplexity/PerplexityTest.php +++ b/src/platform/tests/Bridge/Perplexity/PerplexityTest.php @@ -25,7 +25,7 @@ final class PerplexityTest extends TestCase { public function testItCreatesPerplexityWithDefaultSettings() { - $perplexity = new Perplexity(); + $perplexity = new Perplexity(Perplexity::SONAR); $this->assertSame(Perplexity::SONAR, $perplexity->getName()); $this->assertSame([], $perplexity->getOptions());