reduce_openapi_spec#

langchain_community.agent_toolkits.openapi.spec.reduce_openapi_spec(spec: dict, dereference: bool = True) β†’ ReducedOpenAPISpec[source]#

Simplify/distill/minify a spec somehow.

I want a smaller target for retrieval and (more importantly) I want smaller results from retrieval. I was hoping https://openapi.tools/ would have some useful bits to this end, but doesn’t seem so.

Parameters:
  • spec (dict) – The OpenAPI spec.

  • dereference (bool) – Whether to dereference the spec. Default is True.

Returns:

The reduced OpenAPI spec.

Return type:

ReducedOpenAPISpec

Examples using reduce_openapi_spec