fix: use .replace() instead of .format() in infer_intent to avoid KeyError on JSON prompt - #19
Conversation
|
fix : groq_client.py infer_intent function by using .replace instead of .format |
|
@copilot check for which issue that the check is failing |
…_generator with intent param Agent-Logs-Url: https://github.com/Neuropole/apricot/sessions/f9f90f4a-4747-41aa-98ca-761f97030019 Co-authored-by: haddybhaiya <88364904+haddybhaiya@users.noreply.github.com>
Fixed in commit
The CI was failing with
|
|
apparently the changes proposed are the same changed which are in the branch test-branch-phase3 |
|
Automated Code Review Comment: Bugs
Improvements
Suggestions
Code looks good overall, but could benefit from additional improvements for better maintainability and robustness. ✅ def test_empty_context(): def test_intent_extraction_failure(): def test_commit_tests_failure(): def test_generate_review_with_intent(): |
|
Good work fixing the files @haddybhaiya , i shall merge the pr once the bot works as intended |
|
we Ball!! |
infer_intentwas crashing withKeyError: '"purpose"'becauseINTENT_PROMPT.format(diff=...)misinterpreted the JSON curly braces in the prompt template as Python format placeholders.Changes
agent/llm/prompts.py— Added missingINTENT_PROMPTwith a{diff}placeholder and a JSON output format exampleagent/llm/groq_client.py— Addedinfer_intentfunction using.replace("{diff}", diff[:8000])instead of.format()agent/llm/test_generator.py— Addedintent: dict = Noneparameter, injected into prompt as---INTENT---block