Skip to content

Commit

Permalink
fix: also name-wrangle ToolRegistry.execute
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Dec 10, 2024
1 parent 9c9d9f6 commit 225f392
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/llmling/tools/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ def get_schemas(self) -> list[py2openai.OpenAIFunctionTool]:
return [self.get_schema(name) for name in self._items]

@logfire.instrument("Executing tool {name}")
async def execute(self, name: str, **params: Any) -> Any:
async def execute(self, _name: str, **params: Any) -> Any:
"""Execute a registered function.
Args:
name: Name of the function to execute
_name: Name of the function to execute
**params: Parameters to pass to the function
Returns:
Expand All @@ -125,9 +125,9 @@ async def execute(self, name: str, **params: Any) -> Any:
ToolError: If execution fails
"""
try:
tool = self.get(name)
tool = self.get(_name)
except KeyError as exc:
msg = f"Function {name} not found"
msg = f"Function {_name} not found"
raise ToolNotFoundError(msg) from exc

# Let the original exception propagate
Expand Down

0 comments on commit 225f392

Please sign in to comment.