diff --git a/langchain/agents/agent_toolkits/openapi/spec.py b/langchain/agents/agent_toolkits/openapi/spec.py index 72f3ff9d61..b819623982 100644 --- a/langchain/agents/agent_toolkits/openapi/spec.py +++ b/langchain/agents/agent_toolkits/openapi/spec.py @@ -68,12 +68,12 @@ def reduce_openapi_spec(spec: dict, dereference: bool = True) -> ReducedOpenAPIS I was hoping https://openapi.tools/ would have some useful bits to this end, but doesn't seem so. """ - # 1. Consider only get, post endpoints. + # 1. Consider only get, post, patch, delete endpoints. endpoints = [ (f"{operation_name.upper()} {route}", docs.get("description"), docs) for route, operation in spec["paths"].items() for operation_name, docs in operation.items() - if operation_name in ["get", "post"] + if operation_name in ["get", "post", "patch", "delete"] ] # 2. Replace any refs so that complete docs are retrieved.