mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +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,
|
ToolSelectionErrorEvent,
|
||||||
ToolUsageErrorEvent,
|
ToolUsageErrorEvent,
|
||||||
ToolUsageFinishedEvent,
|
ToolUsageFinishedEvent,
|
||||||
ToolUsageStartedEvent,
|
|
||||||
ToolValidateInputErrorEvent,
|
ToolValidateInputErrorEvent,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -140,8 +139,6 @@ class ToolUsage:
|
|||||||
tool: Any,
|
tool: Any,
|
||||||
calling: Union[ToolCalling, InstructorToolCalling],
|
calling: Union[ToolCalling, InstructorToolCalling],
|
||||||
) -> str: # TODO: Fix this return type
|
) -> 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)
|
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:
|
try:
|
||||||
result = self._i18n.errors("task_repeated_usage").format(
|
result = self._i18n.errors("task_repeated_usage").format(
|
||||||
|
|||||||
Reference in New Issue
Block a user