mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-28 01:32:17 +00:00
fix(mcp): keep local OpenAPI reads off the event loop
This commit is contained in:
parent
229f1fb6d9
commit
79060acfc9
1 changed files with 4 additions and 2 deletions
|
|
@ -170,8 +170,10 @@ async def load_openapi_spec_async(filepath: str) -> dict[str, Any]:
|
|||
r.raise_for_status()
|
||||
return r.json()
|
||||
|
||||
# fallback: local file
|
||||
# Local filesystem path
|
||||
return await asyncio.to_thread(_read_local_openapi_spec, filepath)
|
||||
|
||||
|
||||
def _read_local_openapi_spec(filepath: str) -> dict[str, Any]:
|
||||
if not os.path.exists(filepath):
|
||||
raise FileNotFoundError(f"OpenAPI spec not found at {filepath}")
|
||||
with open(filepath, "r", encoding="utf-8") as f:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue