<?php
namespace App\AI\SymfonyAiExtend\Contract; use App\AI\SymfonyAiExtend\Message\DeveloperMessage; use Symfony\AI\Platform\Bridge\OpenAi\Gpt; use Symfony\AI\Platform\Contract\Normalizer\ModelContractNormalizer; use Symfony\AI\Platform\Model; final class DeveloperMessageNormalizer extends ModelContractNormalizer { public function normalize(mixed $data, ?string $format = null, array $context = []): array { return [ 'type' => 'message', 'role' => 'developer', 'content' => $data->getContent(), ]; } protected function supportedDataClass(): string { return DeveloperMessage::class; } protected function supportsModel(Model $model): bool { return $model instanceof Gpt; } }