diff --git a/rl/llm/engines.py b/rl/llm/engines.py index 3ff3a37..bb4c3f8 100644 --- a/rl/llm/engines.py +++ b/rl/llm/engines.py @@ -304,7 +304,13 @@ def _convert_openai_to_gemini( prompt = prompt[:-1] return ( system_prompt, - [{"role": msg["role"], "parts": [msg["content"]]} for msg in prompt], + [ + { + "role": "model" if msg["role"] == "assistant" else msg["role"], + "parts": [msg["content"]], + } + for msg in prompt + ], last_message, )