mirror of https://github.com/langgenius/dify.git
Apply suggestions from code review
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
parent
ff29b68b27
commit
f2ea86875d
|
|
@ -180,7 +180,7 @@ class MCPClientWithAuthRetry(MCPClient):
|
|||
"""
|
||||
return self._execute_with_retry(super().list_tools)
|
||||
|
||||
def invoke_tool(self, tool_name: str, tool_args: dict[str, Any], _meta: dict[str, Any]) -> CallToolResult:
|
||||
def invoke_tool(self, tool_name: str, tool_args: dict[str, Any], _meta: dict[str, Any] | None = None) -> CallToolResult:
|
||||
"""
|
||||
Invoke a tool on the MCP server with auth retry.
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class MCPClient:
|
|||
response = self._session.list_tools()
|
||||
return response.tools
|
||||
|
||||
def invoke_tool(self, tool_name: str, tool_args: dict[str, Any], _meta: dict[str, Any]) -> CallToolResult:
|
||||
def invoke_tool(self, tool_name: str, tool_args: dict[str, Any], _meta: dict[str, Any] | None = None) -> CallToolResult:
|
||||
"""Call a tool"""
|
||||
if not self._session:
|
||||
raise ValueError("Session not initialized.")
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ class MCPTool(Tool):
|
|||
if value is not None and not (isinstance(value, str) and value.strip() == "")
|
||||
}
|
||||
|
||||
def invoke_remote_mcp_tool(self, tool_parameters: dict[str, Any], _meta: dict[str, Any]) -> CallToolResult:
|
||||
def invoke_remote_mcp_tool(self, tool_parameters: dict[str, Any], _meta: dict[str, Any] | None) -> CallToolResult:
|
||||
headers = self.headers.copy() if self.headers else {}
|
||||
tool_parameters = self._handle_none_parameter(tool_parameters)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue