get_openapi_chain#
- langchain.chains.openai_functions.openapi.get_openapi_chain(spec: OpenAPISpec | str, llm: BaseLanguageModel | None = 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 [source]#
Create a chain for querying an API from a OpenAPI spec.
- Parameters:
spec (Union[OpenAPISpec, str]) – OpenAPISpec or url/file/text string corresponding to one.
llm (Optional[BaseLanguageModel]) – language model, should be an OpenAI function-calling model, e.g. ChatOpenAI(model=”gpt-3.5-turbo-0613”).
prompt (Optional[BasePromptTemplate]) – Main prompt template to use.
request_chain (Optional[Chain]) – Chain for taking the functions output and executing the request.
llm_chain_kwargs (Optional[Dict])
verbose (bool)
headers (Optional[Dict])
params (Optional[Dict])
kwargs (Any)
- Return type: