-
Using gemini. 1.5 pro, I have a simple schema: const schema = z.object({title: z.string(), description: z.string()}) I want the title generated first then the description. But with this schema, it seems that the model is generating each property in alphabetical order. So description would be generated first, then title. Adding the specific order I want in the system prompt doesn't seem to help. If I put a_title and b_description, the order seems the want I want. Any idea if any alternative? Ideally I would like to keep the schema as it is. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It depends on the model afaik. OpenAI models generate in order from what I've seen. You could try to influence it with prompt engineering, i.e. tell the model about the order in the system prompt. |
Beta Was this translation helpful? Give feedback.
Just saw this here. Seems that this is the way it works with gemini for now. System prompt the order won't work. So the alphabetical prefix seems one way to work around it.