Remove unnecessary *args from tool application function

This commit is contained in:
Dominik Jain
2025-03-31 13:42:35 +02:00
parent 605bca19b7
commit 03c320bcd4
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -181,7 +181,7 @@ class Tool(Component):
)
return result
def apply_ex(self, *args, log_call: bool = True, catch_exceptions: bool = True, **kwargs) -> str: # type: ignore
def apply_ex(self, log_call: bool = True, catch_exceptions: bool = True, **kwargs) -> str: # type: ignore
"""
Applies the tool with the given arguments
"""
@@ -192,7 +192,7 @@ class Tool(Component):
if log_call:
self._log_tool_application(inspect.currentframe())
try:
result = apply_fn(*args, **kwargs)
result = apply_fn(**kwargs)
except Exception as e:
if not catch_exceptions:
raise
+2 -2
View File
@@ -4,8 +4,8 @@ from serena.agent import SerenaAgent, Tool
def serena_tool_to_agno_function(tool: Tool) -> Function:
def entrypoint(*args, tool=tool, **kwargs): # type: ignore
tool.apply_ex(*args, log_call=True, catch_exceptions=True, **kwargs)
def entrypoint(tool=tool, **kwargs): # type: ignore
tool.apply_ex(log_call=True, catch_exceptions=True, **kwargs)
function = Function.from_callable(tool.get_apply_fn())
function.name = tool.get_name()
+2 -2
View File
@@ -57,9 +57,9 @@ def make_tool(
func_arg_metadata = func_metadata(apply_fn)
parameters = func_arg_metadata.arg_model.model_json_schema()
def execute_fn(ctx: Context, *args, **kwargs) -> str: # type: ignore
def execute_fn(ctx: Context, **kwargs) -> str: # type: ignore
mark_used(ctx)
return tool.apply_ex(*args, log_call=True, catch_exceptions=True, **kwargs)
return tool.apply_ex(log_call=True, catch_exceptions=True, **kwargs)
return MCPTool(
fn=execute_fn,