mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
fixes for mypy
This commit is contained in:
parent
94038108ad
commit
1e230e87e3
1 changed files with 2 additions and 1 deletions
|
|
@ -70,7 +70,8 @@ async def create_mcp_list_tools_events(
|
|||
mcp_tools_dict = []
|
||||
for tool in filtered_mcp_tools:
|
||||
if hasattr(tool, 'model_dump') and callable(getattr(tool, 'model_dump')):
|
||||
mcp_tools_dict.append(tool.model_dump())
|
||||
# Type cast to help mypy understand this is safe after hasattr check
|
||||
mcp_tools_dict.append(cast(Any, tool).model_dump())
|
||||
elif hasattr(tool, '__dict__'):
|
||||
mcp_tools_dict.append(tool.__dict__)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue