There is a little guide - which was mentioned in the announcement of the new o3-mini model.
Let us have a closer look into one of the example prompts and talk about it.
I want to build a Python app that takes user questions and looks
them up in a database where they are mapped to answers. If there
is close match, it retrieves the matched answer. If there isn't,
it asks the user to provide an answer and stores the
question/answer pair in the database. Make a plan for the directory
structure you'll need, then return each file in full. Only supply
your reasoning at the beginning and end, not throughout the code.
Interesting sidenote:
this prompt shows that the OpenAI devs might be working on a database solution to cache answers.
But let’s go over to the prompt format.
First thing I see is
I want to build a Python app
it can be shortend to
Build a Python app
which removes uneccessary shyness/politeness
Secondly we have this part:
't,
it asks the user to provide an answer and stores the
question/answer pair in the database. Make a plan for the directory
structure you'
Keep an eye on the single quotes. This has a meaning in programming languages and could be seen as a grouping command and could be avoided.
and lastely I am very unsure about this:
Only supply your reasoning at the beginning and end, not throughout the code.
Do you mean it shouldn’t mix explanations with code output?
What about comments in the code?
I would propose this:
Add comments to explain the code blocks in a way that
makes it understandable for junior devs
without knowledge of your task descriptions.
If any explanation is wanted you will receive a specific command for that later.
Possible commands for future tasks may be:
"explain" to get a short summary
or
"explain in detail" to get a detailed explanation with additional reasoning
and then give a precise definition of the desired output with an example
Now just follow the desired format precisely:
1. Outline the directory structure as a tree view in bash
2. Provide each file in full
Example format:
---
[treeview of the code]
### filename
[complete code]
### next filename
[complete code]
---
I'll be gone for a break.
I expect that you have finished the whole project when I return.
:smiley: Happy coding!
So the full optimized prompt could look like this:
Build a Python app that maps user questions to database entries:
When a question closely matches an existing entry,
retrieve and display its answer;
otherwise,
prompt the user for an answer and store the new question-answer pair.
Add comments to explain the code blocks in a way that
makes it understandable for junior devs
without knowledge of your task descriptions.
If any explanation is wanted you will receive a specific command for that later.
Possible commands for future tasks may be:
"explain" to get a short summary
or
"explain in detail" to get a detailed explanation with additional reasoning
Now just follow the desired format precisely:
1. Outline the directory structure as a tree view in bash
2. Provide each file in full
Example format:
---
[treeview of the code]
### filename
[complete code]
### next filename
[complete code]
---
I'll be gone for a break.
I expect that you have finished the whole project when I return.
:smiley: Happy coding!
Looking forward for your tipps and tricks