Home / Function/ plan() — langchain Function Reference

plan() — langchain Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  8994748a_d5a3_a0e6_1869_05215e6046e5["plan()"]
  2066c331_3189_1880_ba09_f5a3c375c553["BaseSingleActionAgent"]
  8994748a_d5a3_a0e6_1869_05215e6046e5 -->|defined in| 2066c331_3189_1880_ba09_f5a3c375c553
  ff3ae374_f735_73ee_26e0_538ba433911c["plan()"]
  8994748a_d5a3_a0e6_1869_05215e6046e5 -->|calls| ff3ae374_f735_73ee_26e0_538ba433911c
  style 8994748a_d5a3_a0e6_1869_05215e6046e5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/agents/agent.py lines 68–84

    def plan(
        self,
        intermediate_steps: list[tuple[AgentAction, str]],
        callbacks: Callbacks = None,
        **kwargs: Any,
    ) -> AgentAction | AgentFinish:
        """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.
        """

Subdomains

Calls

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free