From 4c151e7b03b204b489abea4eda9643eaefe957c3 Mon Sep 17 00:00:00 2001 From: Chris Bridges Date: Thu, 12 Dec 2024 14:19:16 +0000 Subject: [PATCH] formatting fixes (whoops) --- src/Providers/Anthropic/Maps/MessageMap.php | 5 ++--- tests/Providers/Anthropic/MessageMapTest.php | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) 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?', - ] + ], ]); });