Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

fix: Gemini system prompt #381

Merged
merged 1 commit into from
Jul 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Platform/Bridge/Google/Contract/MessageBagNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function supportsModel(Model $model): bool
* role: 'model'|'user',
* parts: array<int, mixed>
* }>,
* system_instruction?: array{parts: array{text: string}}
* system_instruction?: array{parts: array{text: string}[]}
* }
*/
public function normalize(mixed $data, ?string $format = null, array $context = []): array
Expand All @@ -46,7 +46,7 @@ public function normalize(mixed $data, ?string $format = null, array $context =

if (null !== $systemMessage = $data->getSystemMessage()) {
$array['system_instruction'] = [
'parts' => ['text' => $systemMessage->content],
'parts' => [['text' => $systemMessage->content]],
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public static function provideMessageBagData(): iterable
['role' => 'user', 'parts' => [['text' => 'Hello there']]],
],
'system_instruction' => [
'parts' => ['text' => 'You are a cat. Your name is Neko.'],
'parts' => [['text' => 'You are a cat. Your name is Neko.']],
],
],
];
Expand Down