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-classicchainsopenai_functionsopenapiget_openapi_chain
    Function●Since v1.0Deprecated

    get_openapi_chain

    Copy
    get_openapi_chain(
      spec: OpenAPISpec | str,
      llm: BaseLanguageModel | None = 
    View source on GitHub
    None
    ,
    prompt
    :
    BasePromptTemplate
    |
    None
    =
    None
    ,
    request_chain
    :
    Chain
    |
    None
    =
    None
    ,
    llm_chain_kwargs
    :
    dict
    |
    None
    =
    None
    ,
    verbose
    :
    bool
    =
    False
    ,
    headers
    :
    dict
    |
    None
    =
    None
    ,
    params
    :
    dict
    |
    None
    =
    None
    ,
    **
    kwargs
    :
    Any
    =
    {
    }
    )
    ->
    SequentialChain

    Parameters

    NameTypeDescription
    spec*OpenAPISpec | str

    OpenAPISpec or url/file/text string corresponding to one.

    llmBaseLanguageModel | None
    Default:None

    language model, should be an OpenAI function-calling model.

    promptBasePromptTemplate | None
    Default:None
    request_chainChain | None
    Default:None
    paramsdict | None
    Default:None
    headersdict | None
    Default:None
    verbosebool
    Default:False
    llm_chain_kwargsdict | None
    Default:None
    **kwargsAny
    Default:{}

    Create a chain for querying an API from a OpenAPI spec.

    Deprecated

    This function and all related utilities in this module are deprecated. Use LLM tool calling features directly with an HTTP client instead.

    Main prompt template to use.

    Chain for taking the functions output and executing the request.

    Request parameters.

    Request headers.

    Whether to run the chain in verbose mode.

    LLM chain additional keyword arguments.

    Additional keyword arguments to pass to the chain.