langchain.chains.openai_functions.openapi.openapi_spec_to_openai_fn¶
langchain.chains.openai_functions.openapi.openapi_spec_to_openai_fn(spec: OpenAPISpec) → Tuple[List[Dict[str, Any]], Callable][source]¶
Convert a valid OpenAPI spec to the JSON Schema format expected for OpenAIfunctions.
Parameters
spec – OpenAPI spec to convert.
Returns
Tuple of the OpenAI functions JSON schema and a default function for executinga request based on the OpenAI function schema.