From a80710a65b0e299355cdbedc51bdb4644091016f Mon Sep 17 00:00:00 2001 From: AI Christianson Date: Wed, 11 Dec 2024 14:07:18 -0500 Subject: [PATCH] make key snippets available to expert --- ra_aid/tools/expert.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ra_aid/tools/expert.py b/ra_aid/tools/expert.py index a0881eb..3110b98 100644 --- a/ra_aid/tools/expert.py +++ b/ra_aid/tools/expert.py @@ -43,6 +43,8 @@ def ask_expert(question: str) -> str: The expert can be extremely useful at logic questions, debugging, and reviewing complex source code, but you must provide all context including source manually. + The query will automatically include any key facts and code snippets from memory, along with any additional context you've provided. + Try to phrase your question in a way that it does not expand the scope of our top-level task. The expert can be prone to overthinking depending on what and how you ask it. @@ -64,6 +66,12 @@ def ask_expert(question: str) -> str: query_parts.append("# Key Facts About This Project") query_parts.append(key_facts) + # Add key snippets if they exist + key_snippets = get_memory_value('key_snippets') + if key_snippets and len(key_snippets) > 0: + query_parts.append('# Key Snippets') + query_parts.append(key_snippets) + # Add other context if it exists if expert_context: query_parts.append("\n# Additional Context")