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

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-classicagentsopenai_functions_agentbase
    Module●Since v1.0

    base

    Module implements an agent that uses OpenAI's APIs function enabled API.

    Functions

    function
    format_to_openai_function_messages

    Convert (AgentAction, tool output) tuples into FunctionMessages.

    function
    create_openai_functions_agent

    Create an agent that uses OpenAI function calling.

    Classes

    class
    BaseSingleActionAgent

    Base Single Action Agent class.

    class
    OpenAIFunctionsAgentOutputParser

    Parses a message into agent action/finish.

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

    If a function_call parameter is passed, then that is used to get the tool and tool input.

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

    deprecatedclass
    OpenAIFunctionsAgent

    An Agent driven by OpenAIs function powered API.

    View source on GitHub