Skip to content

Commit

Permalink
formatting fixes (whoops)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisB-TL committed Dec 12, 2024
1 parent 1fc1127 commit 4c151e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Providers/Anthropic/Maps/MessageMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<int, Message> $messages
* @param null|string $systemPrompt
* @return array<int, mixed>
*/
public static function mapSystemMessages(array $messages, ?string $systemPrompt): array
Expand Down
4 changes: 2 additions & 2 deletions tests/Providers/Anthropic/MessageMapTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down Expand Up @@ -159,6 +159,6 @@
[
'type' => 'text',
'text' => 'Who are you?',
]
],
]);
});

0 comments on commit 4c151e7

Please sign in to comment.