remove ActionEvent from on_tool_use and on_tool_use_finished methods

This commit is contained in:
Pratyush Shukla
2025-02-03 21:21:38 +05:30
parent fc81156cf6
commit ade4e71eae
2 changed files with 0 additions and 27 deletions

View File

@@ -26,20 +26,6 @@ class ToolsHandler:
"""Run when tool ends running."""
self.last_used_tool = calling # type: ignore # BUG?: Incompatible types in assignment (expression has type "Union[ToolCalling, InstructorToolCalling]", variable has type "ToolCalling")
if agentops:
agentops.record(
agentops.ActionEvent(
action_type="on_tool_use",
params=calling.arguments,
returns=output,
logs={
"tool": calling.tool_name,
"tool_calling": calling,
"should_cache": should_cache,
},
)
)
if self.cache and should_cache and calling.tool_name != CacheTools().name:
self.cache.add(
tool=calling.tool_name,

View File

@@ -525,19 +525,6 @@ class ToolUsage:
}
)
if agentops:
agentops.record(
agentops.ActionEvent(
action_type="on_tool_use_finished",
params=tool_calling.arguments,
returns=event_data,
logs={
"tool": tool,
"tool_calling": tool_calling,
},
)
)
events.emit(source=self, event=ToolUsageFinished(**event_data))
def _prepare_event_data(self, tool: Any, tool_calling: ToolCalling) -> dict: