Home / Function/ aplan() — langchain Function Reference

aplan() — langchain Function Reference

Architecture documentation for the aplan() function in agent.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  44cf1bf5_a498_e468_d14a_0aa8267d73fb["aplan()"]
  37fcc3f3_2798_3648_915c_2bffdd19bff7["Agent"]
  44cf1bf5_a498_e468_d14a_0aa8267d73fb -->|defined in| 37fcc3f3_2798_3648_915c_2bffdd19bff7
  398e54db_7082_c561_dd79_f8ba427c6a37["get_full_inputs()"]
  44cf1bf5_a498_e468_d14a_0aa8267d73fb -->|calls| 398e54db_7082_c561_dd79_f8ba427c6a37
  3b577de0_fb5e_78d3_db9f_6c9a46325e38["aplan()"]
  44cf1bf5_a498_e468_d14a_0aa8267d73fb -->|calls| 3b577de0_fb5e_78d3_db9f_6c9a46325e38
  style 44cf1bf5_a498_e468_d14a_0aa8267d73fb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/agents/agent.py lines 774–793

    async def aplan(
        self,
        intermediate_steps: list[tuple[AgentAction, str]],
        callbacks: Callbacks = None,
        **kwargs: Any,
    ) -> AgentAction | AgentFinish:
        """Async given input, decided what to do.

        Args:
            intermediate_steps: Steps the LLM has taken to date,
                along with observations.
            callbacks: Callbacks to run.
            **kwargs: User inputs.

        Returns:
            Action specifying what tool to use.
        """
        full_inputs = self.get_full_inputs(intermediate_steps, **kwargs)
        full_output = await self.llm_chain.apredict(callbacks=callbacks, **full_inputs)
        return await self.output_parser.aparse(full_output)

Subdomains

Frequently Asked Questions

What does aplan() do?
aplan() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/agents/agent.py.
Where is aplan() defined?
aplan() is defined in libs/langchain/langchain_classic/agents/agent.py at line 774.
What does aplan() call?
aplan() calls 2 function(s): aplan, get_full_inputs.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free