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-coreagentsAgentActionMessageLog
    Class●Since v0.1

    AgentActionMessageLog

    Representation of an action to be executed by an agent.

    This is similar to AgentAction, but includes a message log consisting of chat messages.

    This is useful when working with ChatModels, and is used to reconstruct conversation history from the agent's perspective.

    Copy
    AgentActionMessageLog(
      self,
      tool: str,
      tool_input: str | dict,
      log: str,
      **kwargs: Any = {}
    )

    Bases

    AgentAction

    Attributes

    attribute
    message_log: Sequence[BaseMessage]

    Similar to log, this can be used to pass along extra information about what exact messages were predicted by the LLM before parsing out the (tool, tool_input).

    This is again useful if (tool, tool_input) cannot be used to fully recreate the LLM prediction, and you need that LLM prediction (for future agent iteration).

    Compared to log, this is useful when the underlying LLM is a chat model (and therefore returns messages rather than a string).

    attribute
    type: Literal['AgentActionMessageLog']

    Inherited fromAgentAction

    Attributes

    Atool: str
    —

    The name of the Tool to execute.

    Atool_input: str | dict
    —

    The input to pass in to the Tool.

    Alog: str
    —

    Additional information to log about the action.

    Amessages: Sequence[BaseMessage]
    —

    List of messages.

    Methods

    Mis_lc_serializable
    —

    Return True as this class is serializable.

    Mget_lc_namespace
    —

    Get the namespace of the LangChain object.

    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

    Mis_lc_serializable
    —

    Return True as this class is serializable.

    Mget_lc_namespace
    —

    Get the namespace of the LangChain object.

    Mlc_id
    —

    Return a unique identifier for this class for serialization purposes.

    Mto_json
    —

    Convert the graph to a JSON-serializable format.

    Mto_json_not_implemented
    —

    Serialize a "not implemented" object.

    View source on GitHub