Skip to content

Conversation

@hariprasathys22
Copy link
Contributor

#138
feat: Add [merge_system_prompt] option for models that don't support system instructions (e.g., Gemma 3)

Description
Problem
When using certain AI models like Gemma 3 via Google AI API, the application fails with error:

Added a new boolean field merge_system_prompt to the OpenAIAgent model that allows administrators to configure how system instructions are sent to the API.

Changes Made

merge_system_prompt = models.BooleanField( _("Merge System Prompt to User Message"), default=False, help_text=_("Enable for models that don't support system instructions (e.g., Gemma 3)") )

How It Works
Before (Standard Behavior):
messages = [ {"role": "system", "content": "You are a translator..."}, {"role": "user", "content": "Hello, how are you?"} ]

After (With merge_system_prompt=True):
messages = [ {"role": "user", "content": "You are a translator...\n\nHello, how are you?"} ]

@versun versun merged commit 72eeff7 into versun:main Dec 11, 2025
1 check failed
@versun
Copy link
Owner

versun commented Dec 11, 2025

Thank you @hariprasathys22 for your contribution! The merge_system_prompt feature is a great addition that enables support for models that don't support system instructions (like Gemma 3).

I've merged your PR and created a follow-up fix PR (#141) to address some token calculation issues. The feature is now working correctly.

Thanks again for your valuable contribution to RSSBox! 🎉

@hariprasathys22
Copy link
Contributor Author

Thank you @versun

@hariprasathys22
Copy link
Contributor Author

There is one more issue i have faced, when i integrated the gemma ai, that in the advanced settings, reasoning_factor is given value as "minimal", but for google ai model has reasoning_factor as "low", "high" etc.,

Can I fix it in the next PR.

@versun
Copy link
Owner

versun commented Dec 12, 2025

No need, as you can directly modify the value of this parameter in the advanced settings.

CleanShot 2025-12-12 at 20 15 17@2x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants