Fixed all ruff issues
This commit is contained in:
+7
-10
@@ -39,9 +39,8 @@ class PromptBuilder:
|
||||
for tool in self.tools.values()
|
||||
)
|
||||
|
||||
def _format_episodic_context(self) -> str:
|
||||
def _format_episodic_context(self, memory) -> str:
|
||||
"""Format episodic memory context for the prompt."""
|
||||
memory = get_memory()
|
||||
lines = []
|
||||
|
||||
if memory.episodic.last_search_results:
|
||||
@@ -85,9 +84,8 @@ class PromptBuilder:
|
||||
|
||||
return "\n".join(lines)
|
||||
|
||||
def _format_stm_context(self) -> str:
|
||||
def _format_stm_context(self, memory) -> str:
|
||||
"""Format short-term memory context for the prompt."""
|
||||
memory = get_memory()
|
||||
lines = []
|
||||
|
||||
if memory.stm.current_workflow:
|
||||
@@ -111,10 +109,8 @@ class PromptBuilder:
|
||||
|
||||
return "\n".join(lines)
|
||||
|
||||
def _format_config_context(self) -> str:
|
||||
def _format_config_context(self, memory) -> str:
|
||||
"""Format configuration context."""
|
||||
memory = get_memory()
|
||||
|
||||
lines = ["CURRENT CONFIGURATION:"]
|
||||
if memory.ltm.config:
|
||||
for key, value in memory.ltm.config.items():
|
||||
@@ -125,6 +121,7 @@ class PromptBuilder:
|
||||
|
||||
def build_system_prompt(self) -> str:
|
||||
"""Build the complete system prompt."""
|
||||
# Get memory once for all context formatting
|
||||
memory = get_memory()
|
||||
|
||||
# Base instruction
|
||||
@@ -142,17 +139,17 @@ class PromptBuilder:
|
||||
tools_section = f"\nAVAILABLE TOOLS:\n{tools_desc}" if tools_desc else ""
|
||||
|
||||
# Configuration
|
||||
config_section = self._format_config_context()
|
||||
config_section = self._format_config_context(memory)
|
||||
if config_section:
|
||||
config_section = f"\n{config_section}"
|
||||
|
||||
# STM context
|
||||
stm_context = self._format_stm_context()
|
||||
stm_context = self._format_stm_context(memory)
|
||||
if stm_context:
|
||||
stm_context = f"\n{stm_context}"
|
||||
|
||||
# Episodic context
|
||||
episodic_context = self._format_episodic_context()
|
||||
episodic_context = self._format_episodic_context(memory)
|
||||
|
||||
# Important rules
|
||||
rules = """
|
||||
|
||||
Reference in New Issue
Block a user