langchain_core.agents.AgentFinish

class langchain_core.agents.AgentFinish[source]

Bases: Serializable

The final return value of an ActionAgent.

Agents return an AgentFinish when they have reached a stopping condition.

Override init to support instantiation by position for backward compat.

param log: str [Required]

Additional information to log about the return value. This is used to pass along the full LLM prediction, not just the parsed out return value. For example, if the full LLM prediction was Final Answer: 2 you may want to just return 2 as a return value, but pass along the full string as a log (for debugging or observability purposes).

param return_values: dict [Required]

Dictionary of return values.

param type: Literal['AgentFinish'] = 'AgentFinish'
property messages: Sequence[BaseMessage]

Return the messages that correspond to this observation.