Toggle Menu
Prev Up Next

# `langchain_community.agent_toolkits.openapi.spec`.reduce_openapi_spec

langchain_community.agent_toolkits.openapi.spec.reduce_openapi_spec(spec: dict, dereference: bool = True) → ReducedOpenAPISpec

  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) –

    - dereference (bool) –

  Return type

    ReducedOpenAPISpec

# Examples using reduce_openapi_spec

- NOTE: In this example. We must set `allow_dangerous_request=True` to enable the OpenAPI Agent to automatically use the Request Tool.