diff --git a/examples/bedrock/chat-claude.php b/examples/bedrock/chat-claude.php index dac981f23..1da23b022 100644 --- a/examples/bedrock/chat-claude.php +++ b/examples/bedrock/chat-claude.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -use Symfony\AI\Platform\Bridge\Bedrock\Anthropic\Claude; +use Symfony\AI\Platform\Bridge\Anthropic\Claude; use Symfony\AI\Platform\Bridge\Bedrock\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; diff --git a/examples/bedrock/image-claude-binary.php b/examples/bedrock/image-claude-binary.php index 23d94e1f9..9d3fa9df9 100644 --- a/examples/bedrock/image-claude-binary.php +++ b/examples/bedrock/image-claude-binary.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -use Symfony\AI\Platform\Bridge\Bedrock\Anthropic\Claude; +use Symfony\AI\Platform\Bridge\Anthropic\Claude; use Symfony\AI\Platform\Bridge\Bedrock\PlatformFactory; use Symfony\AI\Platform\Message\Content\Image; use Symfony\AI\Platform\Message\Message; diff --git a/examples/bedrock/toolcall-claude.php b/examples/bedrock/toolcall-claude.php index 21e1f4921..16b23403b 100644 --- a/examples/bedrock/toolcall-claude.php +++ b/examples/bedrock/toolcall-claude.php @@ -13,7 +13,7 @@ use Symfony\AI\Agent\Toolbox\AgentProcessor; use Symfony\AI\Agent\Toolbox\Tool\Wikipedia; use Symfony\AI\Agent\Toolbox\Toolbox; -use Symfony\AI\Platform\Bridge\Bedrock\Anthropic\Claude; +use Symfony\AI\Platform\Bridge\Anthropic\Claude; use Symfony\AI\Platform\Bridge\Bedrock\PlatformFactory; use Symfony\AI\Platform\Message\Message; use Symfony\AI\Platform\Message\MessageBag; diff --git a/src/platform/src/Bridge/Bedrock/Anthropic/Claude.php b/src/platform/src/Bridge/Bedrock/Anthropic/Claude.php deleted file mode 100644 index c5f4754a8..000000000 --- a/src/platform/src/Bridge/Bedrock/Anthropic/Claude.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\AI\Platform\Bridge\Bedrock\Anthropic; - -use Symfony\AI\Platform\Capability; -use Symfony\AI\Platform\Model; - -/** - * @author Christopher Hertel - */ -class Claude extends Model -{ - public const HAIKU_3 = 'claude-3-haiku-20240307'; - public const HAIKU_35 = 'claude-3-5-haiku-latest'; - public const SONNET_3 = 'claude-3-sonnet-20240229'; - public const SONNET_35 = 'claude-3-5-sonnet-latest'; - public const SONNET_37 = 'claude-3-7-sonnet-latest'; - public const SONNET_4 = 'claude-sonnet-4-20250514'; - public const SONNET_4_0 = 'claude-sonnet-4-0'; - public const OPUS_3 = 'claude-3-opus-20240229'; - public const OPUS_4 = 'claude-opus-4-20250514'; - public const OPUS_4_0 = 'claude-opus-4-0'; - public const OPUS_4_1 = 'claude-opus-4-1'; - - /** - * @param array $options The default options for the model usage - */ - public function __construct(string $name, array $options = []) - { - $capabilities = [ - Capability::INPUT_MESSAGES, - Capability::INPUT_IMAGE, - Capability::OUTPUT_TEXT, - Capability::OUTPUT_STREAMING, - Capability::TOOL_CALLING, - ]; - - if (!isset($options['max_tokens'])) { - $options['max_tokens'] = 1000; - } - - parent::__construct($name, $capabilities, $options); - } -} diff --git a/src/platform/src/Bridge/Bedrock/Anthropic/ClaudeModelClient.php b/src/platform/src/Bridge/Bedrock/Anthropic/ClaudeModelClient.php index 13935a8e9..a2be5356a 100644 --- a/src/platform/src/Bridge/Bedrock/Anthropic/ClaudeModelClient.php +++ b/src/platform/src/Bridge/Bedrock/Anthropic/ClaudeModelClient.php @@ -14,6 +14,7 @@ use AsyncAws\BedrockRuntime\BedrockRuntimeClient; use AsyncAws\BedrockRuntime\Input\InvokeModelRequest; use AsyncAws\BedrockRuntime\Result\InvokeModelResponse; +use Symfony\AI\Platform\Bridge\Anthropic\Claude; use Symfony\AI\Platform\Bridge\Bedrock\RawBedrockResult; use Symfony\AI\Platform\Exception\RuntimeException; use Symfony\AI\Platform\Model; diff --git a/src/platform/src/Bridge/Bedrock/Anthropic/ClaudeResultConverter.php b/src/platform/src/Bridge/Bedrock/Anthropic/ClaudeResultConverter.php index 077afb64c..4fe27ad8d 100644 --- a/src/platform/src/Bridge/Bedrock/Anthropic/ClaudeResultConverter.php +++ b/src/platform/src/Bridge/Bedrock/Anthropic/ClaudeResultConverter.php @@ -11,6 +11,7 @@ namespace Symfony\AI\Platform\Bridge\Bedrock\Anthropic; +use Symfony\AI\Platform\Bridge\Anthropic\Claude; use Symfony\AI\Platform\Bridge\Bedrock\RawBedrockResult; use Symfony\AI\Platform\Exception\RuntimeException; use Symfony\AI\Platform\Model; diff --git a/src/platform/tests/Bridge/Bedrock/Anthropic/ClaudeResultConverterTest.php b/src/platform/tests/Bridge/Bedrock/Anthropic/ClaudeResultConverterTest.php index 6fae26f9c..de455def9 100644 --- a/src/platform/tests/Bridge/Bedrock/Anthropic/ClaudeResultConverterTest.php +++ b/src/platform/tests/Bridge/Bedrock/Anthropic/ClaudeResultConverterTest.php @@ -15,7 +15,7 @@ use AsyncAws\Core\Test\ResultMockFactory; use PHPUnit\Framework\Attributes\TestDox; use PHPUnit\Framework\TestCase; -use Symfony\AI\Platform\Bridge\Bedrock\Anthropic\Claude; +use Symfony\AI\Platform\Bridge\Anthropic\Claude; use Symfony\AI\Platform\Bridge\Bedrock\Anthropic\ClaudeResultConverter; use Symfony\AI\Platform\Bridge\Bedrock\RawBedrockResult; use Symfony\AI\Platform\Exception\RuntimeException; diff --git a/src/platform/tests/Bridge/Bedrock/Anthropic/ClaudeTest.php b/src/platform/tests/Bridge/Bedrock/Anthropic/ClaudeTest.php deleted file mode 100644 index d23a8e853..000000000 --- a/src/platform/tests/Bridge/Bedrock/Anthropic/ClaudeTest.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Bridge\Bedrock\Anthropic; - -use PHPUnit\Framework\TestCase; -use Symfony\AI\Platform\Bridge\Anthropic\Claude; - -/** - * @author Oskar Stark - */ -final class ClaudeTest extends TestCase -{ - public function testItCreatesClaudeWithDefaultSettings() - { - $claude = new Claude(Claude::SONNET_35); - - $this->assertSame(Claude::SONNET_35, $claude->getName()); - $this->assertSame(['max_tokens' => 1000], $claude->getOptions()); - } - - public function testItCreatesClaudeWithCustomSettingsIncludingMaxTokens() - { - $claude = new Claude(Claude::SONNET_35, ['temperature' => 0.5, 'max_tokens' => 2000]); - - $this->assertSame(Claude::SONNET_35, $claude->getName()); - $this->assertSame(['temperature' => 0.5, 'max_tokens' => 2000], $claude->getOptions()); - } - - public function testItCreatesClaudeWithCustomSettingsWithoutMaxTokens() - { - $claude = new Claude(Claude::SONNET_35, ['temperature' => 0.5]); - - $this->assertSame(Claude::SONNET_35, $claude->getName()); - $this->assertSame(['temperature' => 0.5, 'max_tokens' => 1000], $claude->getOptions()); - } -}