Skip to content

Commit e620bf2

Browse files
committed
chore(prompt): Edit system prompts for more accuracy
1 parent 4bae4c9 commit e620bf2

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

biobot/main_rag.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def detect_handler(query, history, api_key):
6060
# Build context from recent conversation
6161
recent = [m for m in history if m["role"] != "system"][-8:]
6262
conversation_context = "\n".join(
63-
f"{'User' if m['role'] == 'user' else 'Assistant'}: {m['content'][:300]}"
63+
f"{'User' if m['role'] == 'user' else 'Assistant'}: {m['content'][:500]}"
6464
for m in recent
6565
)
6666

@@ -143,7 +143,7 @@ def detect_handler(query, history, api_key):
143143
"store_path": f"rag_store_{detected}.pkl",
144144
"simulate_cmd": None,
145145
"validation_strategy": "llm_review",
146-
"output_type": "python",
146+
"output_type": "file",
147147
"keywords": [detected]
148148
}
149149

@@ -164,7 +164,7 @@ def check_sufficient_info(query, history, api_key):
164164

165165
recent = [m for m in history if m["role"] != "system"][-8:]
166166
conversation = "\n".join(
167-
f"{'User' if m['role'] == 'user' else 'Assistant'}: {m['content'][:400]}"
167+
f"{'User' if m['role'] == 'user' else 'Assistant'}: {m['content'][:500]}"
168168
for m in recent
169169
)
170170

@@ -177,10 +177,10 @@ def check_sufficient_info(query, history, api_key):
177177
178178
DO NOT GENERATE CODE, your job is only to check whether a user's protocol request contains enough information to generate a working script.
179179
180-
If you judge that there are enough infomations in the whole conversation, you were given the conversation history for that, ONLY reply with exactly: SUFFICIENT , nothing more.
181-
Ask kindly for more informations if you assume that there are not enough informations in order to generate the code. You are specialized, you know what informations to ask.
180+
If you judge that there are enough infomations in the whole conversation, cause you were given the conversation history for that, ONLY reply with exactly: SUFFICIENT , nothing more.
181+
Ask kindly for more informations if you assume that there are not enough informations in order to generate the code. You are specialized, you know what informations to ask depending on the user query.
182182
Always suggest kindly a default set up in order to help the user when he does not provide you with sufficient informations.
183-
If the user asks you to use a default set up, do it and don't ask for informations then which means that you will reply ONLY with exactly : SUFFICIENT."""
183+
If the user asks you to use a default set up, complete a setup, choose some parameters along with the infos he gave you, do it and don't ask for informations then. This means that you will reply ONLY with exactly : SUFFICIENT."""
184184
},
185185
{
186186
"role": "user",
@@ -325,13 +325,13 @@ def validate_llm_review(code, handler_config, context_chunks, question):
325325
6. **Syntax and logic**: Is the syntax and logic correct? Would this file/script run without errors?
326326
7. **Completeness**: Is the output/script complete?
327327
328-
Note that sometimes, the generated output can be a script to generate another file usable for the liquid handler (example: python script to generate csv file). Make sure to make the difference and analyze what's important.
328+
Note that sometimes, the generated output can be a script to generate another file usable for the liquid handler (example: python script to generate csv file that will be used). Make sure to make the difference and analyze the logic of the usable file.
329329
330330
RESPONSE FORMAT:
331331
- If the code is correct and would work: respond with exactly "PASS" on the first line.
332332
- If there are issues: respond with exactly "FAIL" on the first line.
333333
334-
Don't be strict and accurate. Minor style issues are not failures. Focus on big issues that would prevent the code from working correctly on a real {handler_name} instrument. If you think that there aren't any or are not a big feal, you pass."""
334+
Don't be strict and accurate. Minor issues are not failures. Focus on big issues that would prevent the code from working correctly on a real {handler_name} instrument. If you think that there aren't any or there are minors/mid issues or are not a big deal, you pass."""
335335
},
336336
{
337337
"role": "user",

0 commit comments

Comments
 (0)