Skip to content

Commit 7afdddc

Browse files
committed
feature #653 [Platform] Remove default model names from constructor parameters (OskarStark)
This PR was squashed before being merged into the main branch. Discussion ---------- [Platform] Remove default model names from constructor parameters | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | Docs? | no | Issues | Forgotten in #577 | License | MIT Commits ------- 70e86c2 [Platform] Remove default model names from constructor parameters
2 parents dcfbd0d + 70e86c2 commit 7afdddc

39 files changed

+53
-53
lines changed

examples/anthropic/stream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
require_once dirname(__DIR__).'/bootstrap.php';
1818

1919
$platform = PlatformFactory::create(env('ANTHROPIC_API_KEY'), httpClient: http_client());
20-
$model = new Claude();
20+
$model = new Claude(Claude::SONNET_37);
2121

2222
$messages = new MessageBag(
2323
Message::forSystem('You are a thoughtful philosopher.'),

examples/anthropic/toolcall.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
require_once dirname(__DIR__).'/bootstrap.php';
2222

2323
$platform = PlatformFactory::create(env('ANTHROPIC_API_KEY'), httpClient: http_client());
24-
$model = new Claude();
24+
$model = new Claude(Claude::SONNET_37);
2525

2626
$wikipedia = new Wikipedia(http_client());
2727
$toolbox = new Toolbox([$wikipedia], logger: logger());

examples/bedrock/toolcall-nova.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
}
2828

2929
$platform = PlatformFactory::create();
30-
$model = new Nova();
30+
$model = new Nova(Nova::PRO);
3131

3232
$wikipedia = new Wikipedia(http_client());
3333
$toolbox = new Toolbox([$wikipedia]);

examples/elevenlabs/text-to-speech-as-stream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
apiKey: env('ELEVEN_LABS_API_KEY'),
2020
httpClient: http_client(),
2121
);
22-
$model = new ElevenLabs(options: [
22+
$model = new ElevenLabs(ElevenLabs::ELEVEN_MULTILINGUAL_V2, [
2323
'voice' => 'Dslrhjl3ZpzrctukrQSN', // Brad (https://elevenlabs.io/app/voice-library?voiceId=Dslrhjl3ZpzrctukrQSN)
2424
'stream' => true,
2525
]);

examples/elevenlabs/text-to-speech.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
apiKey: env('ELEVEN_LABS_API_KEY'),
2020
httpClient: http_client(),
2121
);
22-
$model = new ElevenLabs(options: [
22+
$model = new ElevenLabs(ElevenLabs::ELEVEN_MULTILINGUAL_V2, [
2323
'voice' => 'Dslrhjl3ZpzrctukrQSN', // Brad (https://elevenlabs.io/app/voice-library?voiceId=Dslrhjl3ZpzrctukrQSN)
2424
]);
2525

examples/mistral/chat-multiple.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
Message::forSystem('Just give short answers.'),
2323
Message::ofUser('What is your favorite color?'),
2424
);
25-
$result = $platform->invoke(new Mistral(), $messages, [
25+
$result = $platform->invoke(new Mistral(Mistral::MISTRAL_LARGE), $messages, [
2626
'temperature' => 1.5,
2727
'n' => 10,
2828
]);

examples/mistral/chat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
require_once dirname(__DIR__).'/bootstrap.php';
1818

1919
$platform = PlatformFactory::create(env('MISTRAL_API_KEY'), http_client());
20-
$model = new Mistral();
20+
$model = new Mistral(Mistral::MISTRAL_LARGE);
2121

2222
$messages = new MessageBag(Message::ofUser('What is the best French cheese?'));
2323
$result = $platform->invoke($model, $messages, [

examples/mistral/stream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
require_once dirname(__DIR__).'/bootstrap.php';
1818

1919
$platform = PlatformFactory::create(env('MISTRAL_API_KEY'), http_client());
20-
$model = new Mistral();
20+
$model = new Mistral(Mistral::MISTRAL_LARGE);
2121

2222
$messages = new MessageBag(Message::ofUser('What is the eighth prime number?'));
2323
$result = $platform->invoke($model, $messages, [

examples/mistral/token-metadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
require_once dirname(__DIR__).'/bootstrap.php';
2020

2121
$platform = PlatformFactory::create(env('MISTRAL_API_KEY'), http_client());
22-
$model = new Mistral();
22+
$model = new Mistral(Mistral::MISTRAL_LARGE);
2323

2424
$agent = new Agent($platform, $model, outputProcessors: [new TokenOutputProcessor()], logger: logger());
2525

examples/mistral/toolcall-stream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
require_once dirname(__DIR__).'/bootstrap.php';
2222

2323
$platform = PlatformFactory::create(env('MISTRAL_API_KEY'), http_client());
24-
$model = new Mistral();
24+
$model = new Mistral(Mistral::MISTRAL_LARGE);
2525

2626
$transcriber = new YouTubeTranscriber(http_client());
2727
$toolbox = new Toolbox([$transcriber], logger: logger());

0 commit comments

Comments
 (0)