# reduce_openapi_spec

> **Function** in `langchain_community`

📖 [View in docs](https://reference.langchain.com/python/langchain-community/agent_toolkits/openapi/spec/reduce_openapi_spec)

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.

## Signature

```python
reduce_openapi_spec(
    spec: dict,
    dereference: bool = True,
) -> ReducedOpenAPISpec
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `spec` | `dict` | Yes | The OpenAPI spec. |
| `dereference` | `bool` | No | Whether to dereference the spec. Default is True. (default: `True`) |

## Returns

`ReducedOpenAPISpec`

The reduced OpenAPI spec.

---

[View source on GitHub](https://github.com/langchain-ai/langchain-community/blob/a6a6079511ac8a5c1293337f88096b8641562e77/libs/community/langchain_community/agent_toolkits/openapi/spec.py#L26)