LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-coreagentsAgentFinish
    Class●Since v0.1

    AgentFinish

    Copy
    AgentFinish(
      self,
      return_values: dict,
      log: str,
      **kwargs: Any = {}

    Bases

    Serializable

    Constructors

    Attributes

    Methods

    Inherited fromSerializable

    Attributes

    Alc_secrets: dict[str, str]
    —

    A map of constructor argument names to secret ids.

    Alc_attributes: dict
    —

    List of attribute names that should be included in the serialized kwargs.

    Amodel_config

    Methods

    View source on GitHub
    )
    M
    lc_id
    —

    Return a unique identifier for this class for serialization purposes.

    Mto_json
    —

    Serialize the object to JSON.

    Mto_json_not_implemented
    —

    Serialize a "not implemented" object.

    constructor
    __init__
    NameType
    return_valuesdict
    logstr
    attribute
    return_values: dict
    attribute
    log: str
    attribute
    type: Literal['AgentFinish']
    attribute
    messages: Sequence[BaseMessage]
    method
    is_lc_serializable
    method
    get_lc_namespace

    Final return value of an ActionAgent.

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

    Dictionary of return values.

    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).

    Messages that correspond to this observation.

    Return True as this class is serializable.

    Get the namespace of the LangChain object.