mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
fix(mypy): fix validate_tool_name return type signatures (#20184)
Move ToolNameValidationResult class definition outside the fallback function and use consistent return type annotation to satisfy mypy. Files fixed: - proxy/_experimental/mcp_server/mcp_server_manager.py - proxy/management_endpoints/mcp_management_endpoints.py
This commit is contained in:
parent
5bd5df3ca6
commit
65fb18b568
2 changed files with 10 additions and 14 deletions
|
|
@ -70,16 +70,14 @@ try:
|
|||
validate_tool_name,
|
||||
)
|
||||
except ImportError:
|
||||
from typing import Any
|
||||
from pydantic import BaseModel
|
||||
SEP_986_URL = "https://github.com/modelcontextprotocol/protocol/blob/main/proposals/0001-tool-name-validation.md"
|
||||
|
||||
def validate_tool_name(name: str) -> Any:
|
||||
from pydantic import BaseModel
|
||||
|
||||
class ToolNameValidationResult(BaseModel):
|
||||
is_valid: bool = True
|
||||
warnings: list = []
|
||||
class ToolNameValidationResult(BaseModel):
|
||||
is_valid: bool = True
|
||||
warnings: list = []
|
||||
|
||||
def validate_tool_name(name: str) -> ToolNameValidationResult:
|
||||
return ToolNameValidationResult()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -63,15 +63,13 @@ if MCP_AVAILABLE:
|
|||
validate_tool_name,
|
||||
)
|
||||
except ImportError:
|
||||
from typing import Any
|
||||
from pydantic import BaseModel
|
||||
|
||||
def validate_tool_name(name: str) -> Any:
|
||||
from pydantic import BaseModel
|
||||
|
||||
class ToolNameValidationResult(BaseModel):
|
||||
is_valid: bool = True
|
||||
warnings: list = []
|
||||
class ToolNameValidationResult(BaseModel):
|
||||
is_valid: bool = True
|
||||
warnings: list = []
|
||||
|
||||
def validate_tool_name(name: str) -> ToolNameValidationResult:
|
||||
return ToolNameValidationResult()
|
||||
|
||||
from litellm.proxy._experimental.mcp_server.db import (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue