LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • MCP Adapters
    Standard Tests
    Text Splitters
    • Overview
    • Agents
    • Callbacks
    • Chains
    • Chat models
    • Embeddings
    • Evaluation
    • Globals
    • Hub
    • Memory
    • Output parsers
    • Retrievers
    • Runnables
    • LangSmith
    • Storage
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    Standard Tests
    Text Splitters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Language
    Theme
    Pythonlangchain-classicagentstool_calling_agentbase
    Moduleā—Since v1.0

    base

    Attributes

    Functions

    Classes

    View source on GitHub
    attribute
    MessageFormatter: Callable[[Sequence[tuple[AgentAction, str]]], list[BaseMessage]]
    function
    format_to_tool_messages
    function
    create_tool_calling_agent
    class
    ToolsAgentOutputParser

    Convert (AgentAction, tool output) tuples into ToolMessage objects.

    Create an agent that uses tools.

    Parses a message into agent actions/finish.

    If a tool_calls parameter is passed, then that is used to get the tool names and tool inputs.

    If one is not passed, then the AIMessage is assumed to be the final output.