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-classicagentsoutput_parsersopenai_tools
    Moduleā—Since v1.0

    openai_tools

    Attributes

    Functions

    Classes

    View source on GitHub
    attribute
    OpenAIToolAgentAction: ToolAgentAction
    function
    parse_ai_message_to_tool_action
    function
    parse_ai_message_to_openai_tool_action
    class
    MultiActionAgentOutputParser
    class
    ToolAgentAction
    class
    OpenAIToolsAgentOutputParser

    Parse an AI message potentially containing tool_calls.

    Parse an AI message potentially containing tool_calls.

    Base class for parsing agent output into agent actions/finish.

    This is used for agents that can return multiple actions.

    Tool agent action.

    Parses a message into agent actions/finish.

    Is meant to be used with OpenAI models, as it relies on the specific tool_calls parameter from OpenAI to convey what tools to use.

    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.