Modify prompt using saist.rules#14
Conversation
X3NOSAURUS
commented
May 13, 2025
- Created PromptRules class to read saist.rules from the working directory
- PROMPT_OVERRIDE to fully replace the prompt
- PROMPT_PRE and PROMPT_POST to modify prompt before/after
- Integrated apply_rules into analyze_single_file to adjust the prompt
- Falls back to original prompt if saist.rules doesn't exist or is empty
…ctory - PROMPT_OVERRIDE to fully replace the prompt - PROMPT_PRE and PROMPT_POST to modify prompt before/after - Integrated apply_rules into analyze_single_file to adjust the prompt - Falls back to original prompt if saist.rules doesn't exist or is empty
|
Consider updating the docs, and adding a saist.rules example file? |
- PRE and POST no longer skipped when using OVERRIDE - Standardised logging - Added example rules file - Updated README
|
Check how the README renders... |
|
This is looking better, but I've had a quick review and the DETECT prompt is already split into PRE and POST in the prompts class. This should probably be tidied up... |
- Changed system prompt definition within analyze_single_file to match the updated logic
-Ammened system prompt back to DIRECT for simplicity - Moved return out of else in load_rules
Apologies for the delay in sorting this one properly - I realised my first go at it was a mess! |
|
Hmmm, it now looks like you don't provide the detect post part of the prompt to the system_prompt at all? |
I was just using DETECT as this combines the pre and post within the prompts class - In my apply rules func I combine the pre and post (with the override if there is one). I can pass pre and post separately if that would be preferred? edit: Sorry - I see where I was going wrong now and have pushed a new commit |
…riginal prompt with the new pre and post. I don't think this is the desired intention. -final_prompt should now contain pre and post (if they are present) wrapping either the original detect prompt or the overridden detect prompt
|
In my apply rules func I combine the user defined pre and post (if present) with the prompt (overridden prompt if there is one). I think this should now work as intended |