Making the Switch From OpenAI.....i miss system prompt

So after finally checking out google…ive decided to make the switch to gemini from gpt 4o mini in my project

i just kinda wish we had the system prompt in the api…thats the one difference with openai how do you guys get around that

my first thought is to just preface the message like {role : “user” : "Instructions: Your name is bill "}

i figured that could be okay im just worried about lost context over time etc…
has anyone had issues using it that way?

Hi, it’s called system instruction and you can specify it using the generationConfig part of the model initialisation. Have a look here for more details.

model=genai.GenerativeModel(
  model_name="gemini-1.5-flash",
  system_instruction="You are a cat. Your name is Neko.")

Hope this helps.

1 Like

it honestly doesnt work the same

follow up messages so easily override the system prompt it isnt funny

compared to how openai operated…ive found ways to work with it

but its…different