diff --git a/core/cat/looking_glass/agent_manager.py b/core/cat/looking_glass/agent_manager.py index c20bd946..de4698ef 100644 --- a/core/cat/looking_glass/agent_manager.py +++ b/core/cat/looking_glass/agent_manager.py @@ -116,8 +116,8 @@ def execute_agent(self, working_memory): fast_reply = mad_hatter.execute_hook("agent_fast_reply", fast_reply) if len(fast_reply.keys()) > 0: return fast_reply - prompt_prefix = mad_hatter.execute_hook("agent_prompt_prefix", prompts.MAIN_PROMPT_PREFIX) - prompt_suffix = mad_hatter.execute_hook("agent_prompt_suffix", prompts.MAIN_PROMPT_SUFFIX) + prompt_prefix = mad_hatter.execute_hook("agent_prompt_prefix", prompts.MAIN_PROMPT_PREFIX, working_memory) + prompt_suffix = mad_hatter.execute_hook("agent_prompt_suffix", prompts.MAIN_PROMPT_SUFFIX, working_memory) # tools currently recalled in working memory diff --git a/core/cat/mad_hatter/core_plugin/hooks/prompt.py b/core/cat/mad_hatter/core_plugin/hooks/prompt.py index 8e35c13c..8d749445 100644 --- a/core/cat/mad_hatter/core_plugin/hooks/prompt.py +++ b/core/cat/mad_hatter/core_plugin/hooks/prompt.py @@ -11,7 +11,7 @@ @hook(priority=0) -def agent_prompt_prefix(prefix, cat) -> str: +def agent_prompt_prefix(prefix, working_memory, cat) -> str: """Hook the main prompt prefix. Allows to edit the prefix of the *Main Prompt* that the Cat feeds to the *Agent*. @@ -24,6 +24,8 @@ def agent_prompt_prefix(prefix, cat) -> str: cat : CheshireCat Cheshire Cat instance. + working_memory : WorkingMemory + Returns ------- prefix : str @@ -53,6 +55,7 @@ def agent_prompt_instructions(instructions: str, cat) -> str: cat : CheshireCat Cheshire Cat instance. + Returns ------- instructions : str @@ -78,7 +81,7 @@ def agent_prompt_instructions(instructions: str, cat) -> str: @hook(priority=0) -def agent_prompt_suffix(prompt_suffix: str, cat) -> str: +def agent_prompt_suffix(prompt_suffix: str, working_memory, cat) -> str: """Hook the main prompt suffix. Allows to edit the suffix of the *Main Prompt* that the Cat feeds to the *Agent*. @@ -91,6 +94,8 @@ def agent_prompt_suffix(prompt_suffix: str, cat) -> str: cat : CheshireCat Cheshire Cat instance. + working_memory : WorkingMemory + Returns ------- suffix : str