Skip to content

fix: Gemini system prompt #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2025
Merged

fix: Gemini system prompt #98

merged 1 commit into from
Jul 12, 2025

Conversation

chr-hertel
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
Docs? no
Issues
License MIT

Cherry picking php-llm/llm-chain#381

I started to get 400 Bad Request from Gemini API, not sure if it was due
to changing a model or what. Changing `system_instruction.parts` into a
list like in the
[docs](https://ai.google.dev/gemini-api/docs/text-generation#system-instructions)
fixed it.

Tested at least with `gemini-1.5-pro` and `gemini-2.5-pro` and
`gemini-2.0-flash`, works fine.
@chr-hertel chr-hertel requested a review from Nyholm as a code owner July 12, 2025 07:34
@chr-hertel chr-hertel added Bug Something isn't working Platform Issues & PRs about the AI Platform component labels Jul 12, 2025
@chr-hertel
Copy link
Contributor Author

Thank you @valtzu.

@chr-hertel chr-hertel merged commit 6f2ea11 into main Jul 12, 2025
29 of 30 checks passed
@chr-hertel chr-hertel deleted the fix-gemini-system-prompt branch July 12, 2025 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Platform Issues & PRs about the AI Platform component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants