Home / Function/ evaluate_agent_trajectory() — langchain Function Reference

evaluate_agent_trajectory() — langchain Function Reference

Architecture documentation for the evaluate_agent_trajectory() function in schema.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  f9083201_751d_03a7_715e_48b36d32dabf["evaluate_agent_trajectory()"]
  942e26b5_86b7_44c9_5c6d_e12c17d223b8["AgentTrajectoryEvaluator"]
  f9083201_751d_03a7_715e_48b36d32dabf -->|defined in| 942e26b5_86b7_44c9_5c6d_e12c17d223b8
  7026853a_ec84_d1d0_4656_2bb45a043e17["_check_evaluation_args()"]
  f9083201_751d_03a7_715e_48b36d32dabf -->|calls| 7026853a_ec84_d1d0_4656_2bb45a043e17
  dead35f2_5d91_cb2b_4630_f4d666053668["_evaluate_agent_trajectory()"]
  f9083201_751d_03a7_715e_48b36d32dabf -->|calls| dead35f2_5d91_cb2b_4630_f4d666053668
  style f9083201_751d_03a7_715e_48b36d32dabf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/evaluation/schema.py lines 447–476

    def evaluate_agent_trajectory(
        self,
        *,
        prediction: str,
        agent_trajectory: Sequence[tuple[AgentAction, str]],
        input: str,  # noqa: A002
        reference: str | None = None,
        **kwargs: Any,
    ) -> dict:
        """Evaluate a trajectory.

        Args:
            prediction: The final predicted response.
            agent_trajectory:
                The intermediate steps forming the agent trajectory.
            input: The input to the agent.
            reference: The reference answer.
            **kwargs: Additional keyword arguments.

        Returns:
            The evaluation result.
        """
        self._check_evaluation_args(reference=reference, input_=input)
        return self._evaluate_agent_trajectory(
            prediction=prediction,
            input=input,
            agent_trajectory=agent_trajectory,
            reference=reference,
            **kwargs,
        )

Domain

Subdomains

Frequently Asked Questions

What does evaluate_agent_trajectory() do?
evaluate_agent_trajectory() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/evaluation/schema.py.
Where is evaluate_agent_trajectory() defined?
evaluate_agent_trajectory() is defined in libs/langchain/langchain_classic/evaluation/schema.py at line 447.
What does evaluate_agent_trajectory() call?
evaluate_agent_trajectory() calls 2 function(s): _check_evaluation_args, _evaluate_agent_trajectory.

Analyze Your Own Codebase

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

Try Supermodel Free