diff --git a/app/services/ai_backend/gemini.rb b/app/services/ai_backend/gemini.rb index 20540119..9ef28f35 100644 --- a/app/services/ai_backend/gemini.rb +++ b/app/services/ai_backend/gemini.rb @@ -42,8 +42,8 @@ def set_client_config(config) @client_config = { contents: config[:messages], - system_instruction: system_message(config[:instructions]) - } + system_instruction: ( system_message(config[:instructions]) if @assistant.language_model.supports_system_message?) + }.compact end def get_oneoff_message(instructions, messages, params = {})