mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
Remove ToolUsageStartedEvent emission in tool usage process
- Remove unnecessary event emission for tool usage start - Simplify tool usage event handling - Eliminate redundant event data preparation step
This commit is contained in:
@@ -22,7 +22,6 @@ from crewai.utilities.events.tool_usage_events import (
|
||||
ToolSelectionErrorEvent,
|
||||
ToolUsageErrorEvent,
|
||||
ToolUsageFinishedEvent,
|
||||
ToolUsageStartedEvent,
|
||||
ToolValidateInputErrorEvent,
|
||||
)
|
||||
|
||||
@@ -140,8 +139,6 @@ class ToolUsage:
|
||||
tool: Any,
|
||||
calling: Union[ToolCalling, InstructorToolCalling],
|
||||
) -> str: # TODO: Fix this return type
|
||||
event_data = self._prepare_event_data(tool, calling) # type: ignore
|
||||
crewai_event_bus.emit(self, ToolUsageStartedEvent(**event_data))
|
||||
if self._check_tool_repeated_usage(calling=calling): # type: ignore # _check_tool_repeated_usage of "ToolUsage" does not return a value (it only ever returns None)
|
||||
try:
|
||||
result = self._i18n.errors("task_repeated_usage").format(
|
||||
|
||||
Reference in New Issue
Block a user