DeepCode
DeepCode copied to clipboard
[Question]: suppressing ```json quoted output
Do you need to ask a question?
- [x] I have searched the existing question and discussions and this question is not already answered.
- [x] I believe this is a legitimate question, not just a bug or feature request.
Your Question
Hello,
Interesting project! Just looking around and came across this:
https://github.com/HKUDS/DeepCode/blob/64266f7472c3dcedd89ed30c2e8327152105382f/prompts/code_prompts.py#L40-L41
Just a thought, but why try to "fight" the LLM on this point? It was fine tuned to return fenced code-blocks, and trying to suppress that with strong language and repetition is likely not how you want the LLM to spend it's attention, is it?
Why not just parse fenced code-blocks like most tools?
Just wondering. 😊
Additional Context
No response
Thank you for raising this very valuable question! Our initial design rationale was: 1.Reduce ambiguity: Using raw JSON is the most explicit, preventing parsers from selecting the wrong JSON block or performance-first path. 2.Direct JSON is the fastest parsing route.
Future optimizations will include: 1.Removing mandatory constraints to allow the LLM to use natural Markdown formatting. 2.Relying on our existing robust parsing logic to handle various output formats. 3.Simplifying prompts so the LLM can focus on content quality rather than formatting constraints.