Improve expert prompt.
This commit is contained in:
parent
6a0dd0a950
commit
c677da1e11
|
|
@ -42,9 +42,6 @@ def emit_expert_context(context: str) -> str:
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
context: The context to add
|
context: The context to add
|
||||||
|
|
||||||
Returns:
|
|
||||||
Confirmation message
|
|
||||||
"""
|
"""
|
||||||
expert_context.append(context)
|
expert_context.append(context)
|
||||||
|
|
||||||
|
|
@ -61,9 +58,6 @@ def read_files_with_limit(file_paths: List[str], max_lines: int = 10000) -> str:
|
||||||
file_paths: List of file paths to read
|
file_paths: List of file paths to read
|
||||||
max_lines: Maximum total lines to read (default: 10000)
|
max_lines: Maximum total lines to read (default: 10000)
|
||||||
|
|
||||||
Returns:
|
|
||||||
String containing concatenated file contents with headers
|
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
- Each file's contents will be prefaced with its path as a header
|
- Each file's contents will be prefaced with its path as a header
|
||||||
- Stops reading files when max_lines limit is reached
|
- Stops reading files when max_lines limit is reached
|
||||||
|
|
@ -99,9 +93,6 @@ def read_files_with_limit(file_paths: List[str], max_lines: int = 10000) -> str:
|
||||||
|
|
||||||
def read_related_files() -> str:
|
def read_related_files() -> str:
|
||||||
"""Read related files from memory.
|
"""Read related files from memory.
|
||||||
|
|
||||||
Returns:
|
|
||||||
String containing concatenated file contents with headers
|
|
||||||
"""
|
"""
|
||||||
related_files = get_related_files()
|
related_files = get_related_files()
|
||||||
if not related_files:
|
if not related_files:
|
||||||
|
|
@ -125,12 +116,6 @@ def ask_expert(question: str) -> str:
|
||||||
Try to phrase your question in a way that it does not expand the scope of our top-level task.
|
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.
|
The expert can be prone to overthinking depending on what and how you ask it.
|
||||||
|
|
||||||
Args:
|
|
||||||
question: The question to ask the expert
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
The expert's response
|
|
||||||
"""
|
"""
|
||||||
global expert_context
|
global expert_context
|
||||||
|
|
||||||
|
|
@ -168,6 +153,7 @@ def ask_expert(question: str) -> str:
|
||||||
query_parts.extend(['\n# Additional Context', '\n'.join(expert_context)])
|
query_parts.extend(['\n# Additional Context', '\n'.join(expert_context)])
|
||||||
|
|
||||||
query_parts.extend(['# Question', question])
|
query_parts.extend(['# Question', question])
|
||||||
|
query_parts.extend(['\n # Addidional Requirements', "Do not expand the scope unnecessarily."])
|
||||||
|
|
||||||
# Join all parts
|
# Join all parts
|
||||||
full_query = '\n'.join(query_parts)
|
full_query = '\n'.join(query_parts)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue