mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 16:18:30 +00:00
24 lines
482 B
Python
24 lines
482 B
Python
from typing import Any, Dict
|
|
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
|
|
|
|
class ToolUsageEvent(BaseModel):
|
|
agent_key: str
|
|
agent_role: str
|
|
tool_name: str
|
|
tool_args: Dict[str, Any]
|
|
tool_class: str
|
|
run_attempts: int | None = None
|
|
delegations: int | None = None
|
|
|
|
|
|
class ToolUsageFinished(ToolUsageEvent):
|
|
started_at: datetime
|
|
finished_at: datetime
|
|
from_cache: bool = False
|
|
|
|
|
|
class ToolUsageError(ToolUsageEvent):
|
|
error: str
|