Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the new hook agent_fast_reply in process diagram #51

Open
sambarza opened this issue Oct 24, 2023 · 0 comments
Open

Add the new hook agent_fast_reply in process diagram #51

sambarza opened this issue Oct 24, 2023 · 0 comments
Assignees

Comments

@sambarza
Copy link
Collaborator

The new hook is called here:

 def execute_agent(self, working_memory):
        """Instantiate the Agent with tools.

        The method formats the main prompt and gather the allowed tools. It also instantiates a conversational Agent
        from Langchain.

        Returns
        -------
        agent_executor : AgentExecutor
            Instance of the Agent provided with a set of tools.
        """
        mad_hatter = self.cat.mad_hatter

        # prepare input to be passed to the agent.
        #   Info will be extracted from working memory
        agent_input = self.format_agent_input(working_memory)
        agent_input = mad_hatter.execute_hook("before_agent_starts", agent_input)
        # should we ran the default agent?
        fast_reply = {}
        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)
@sambarza sambarza self-assigned this Sep 14, 2024
sambarza added a commit to sambarza/cheshire-cat-ai-docs that referenced this issue Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant