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
  5abe9fa6_dd3a_d566_d506_61ece1034db8["aplan()"]
  0d209def_9564_c52d_db1c_fc156804d62d["LLMSingleActionAgent"]
  5abe9fa6_dd3a_d566_d506_61ece1034db8 -->|defined in| 0d209def_9564_c52d_db1c_fc156804d62d
  fee0e58f_9dfb_24a8_7d9e_adaef341cc83["parse()"]
  5abe9fa6_dd3a_d566_d506_61ece1034db8 -->|calls| fee0e58f_9dfb_24a8_7d9e_adaef341cc83
  3b577de0_fb5e_78d3_db9f_6c9a46325e38["aplan()"]
  5abe9fa6_dd3a_d566_d506_61ece1034db8 -->|calls| 3b577de0_fb5e_78d3_db9f_6c9a46325e38
  style 5abe9fa6_dd3a_d566_d506_61ece1034db8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/agents/agent.py lines 666–689

    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.
        """
        output = await self.llm_chain.arun(
            intermediate_steps=intermediate_steps,
            stop=self.stop,
            callbacks=callbacks,
            **kwargs,
        )
        return self.output_parser.parse(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 666.
What does aplan() call?
aplan() calls 2 function(s): aplan, parse.

Analyze Your Own Codebase

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

Try Supermodel Free