void icon indicating copy to clipboard operation
void copied to clipboard

[Fix] system role for o-series models

Open animeshlego5 opened this issue 7 months ago • 1 comments

This PR fixes the prompt role issue for O-Series models (o4-mini and o3), which were previously receiving "role": "system". As per the OpenAI docs, these models should use "role": "developer".

Updated the role to "developer" for these models to align with the OpenAI specification.

The fix has been tested successfully. Please refer to the attached screenshot showcasing the correct prompt role in the API request after the change. image (1)

animeshlego5 avatar May 17 '25 11:05 animeshlego5

@animeshlego5 do you know if this applies to Azure models as well?

zpg6 avatar May 18 '25 16:05 zpg6

@zpg6 If you check the Azure OpenAI documentation, it's the same. https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/reasoning?tabs=python-secure%2Cpy#developer-messages

image

huni0103 avatar May 19 '25 04:05 huni0103

This was put into place for gemini models, can we make the logic this instead?: | system -> system | gemini -> system | developer -> developer Thanks!

andrewpareles avatar May 19 '25 05:05 andrewpareles

@andrewpareles I have changed the logic as you suggested and tested for a Gemini model (gemini-2.5-flash-preview-04-17), following is the screenshot. Lmk if you need anything changed :) image

animeshlego5 avatar May 19 '25 08:05 animeshlego5