Creating prompts for two tasks

I am a beginner in prompt engineering. I need to create a prompt for two tasks . Can someone provide suggestions
Currently I am using below format
Context
Input variables


Task 1

Task 2

How can I make sure that only the respective rules are applied for that particular task.
Please share your thoughts on this

Hi!
In general it will be sufficient to clearly instruct the model. Does not sound very helpful, I know, but you want to keep the two tasks completely separate.
Here is an example from the Prompting Guide:
https://platform.openai.com/docs/guides/prompt-engineering/tactic-specify-the-steps-required-to-complete-a-task

What may happen is that your rules for the tasks are too complex for the model and it gets confused. Have you tried if the model can perform both tasks separately in sufficient quality? After confirming this you start to instruct the model to perform the second task following the completion of the first until you hit a barrier.

1 Like

The format you provided, is it for a user prompt or a system prompt (I mean the instruction if you are using GPTs)?

For higher reliability, it’s better to mention the rules in the user prompt because user prompts always carry more weight than system prompts.