diff --git a/src/Providers/Anthropic/Maps/MessageMap.php b/src/Providers/Anthropic/Maps/MessageMap.php index ac2ddc2..397f0d9 100644 --- a/src/Providers/Anthropic/Maps/MessageMap.php +++ b/src/Providers/Anthropic/Maps/MessageMap.php @@ -25,13 +25,12 @@ public static function map(array $messages): array { return array_values(array_map( fn (Message $message): array => self::mapMessage($message), - array_filter($messages, fn (Message $message): bool => !$message instanceof SystemMessage) + array_filter($messages, fn (Message $message): bool => ! $message instanceof SystemMessage) )); } - + /** * @param array $messages - * @param null|string $systemPrompt * @return array */ public static function mapSystemMessages(array $messages, ?string $systemPrompt): array diff --git a/tests/Providers/Anthropic/MessageMapTest.php b/tests/Providers/Anthropic/MessageMapTest.php index 7ca43f3..af5e6af 100644 --- a/tests/Providers/Anthropic/MessageMapTest.php +++ b/tests/Providers/Anthropic/MessageMapTest.php @@ -28,7 +28,7 @@ it('filters system messages out when calling map', function (): void { expect(MessageMap::map([ new UserMessage('Who are you?'), - new SystemMessage('I am Groot.') + new SystemMessage('I am Groot.'), ]))->toBe([[ 'role' => 'user', 'content' => [ @@ -159,6 +159,6 @@ [ 'type' => 'text', 'text' => 'Who are you?', - ] + ], ]); });