Skip to main content

Parameters

ParameterTypeDefaultDescription
depsAgentDepsT-Dependencies for the agent
agent_idOptional[str]NoneID of the agent executing the tool
task_idOptional[str]NoneID of the current task
tool_callOptional[ToolCall]NoneThe current tool call being executed
messageslist[Any][]Messages exchanged in the conversation so far
retriesDict[str, int]{}Number of retries for each tool so far
retryint0Number of retries of current tool so far
max_retriesint0Maximum number of retries allowed
tool_call_countint0Total number of tool calls made
tool_call_limitOptional[int]NoneMaximum number of tool calls allowed
metadataDict[str, Any]{}Additional metadata for the context

Functions

last_attempt

Whether this is the last attempt at running this tool. Returns:
  • bool: True if retry equals max_retries

can_call_tool

Check if another tool call is allowed. Returns:
  • bool: True if tool call limit is not reached

increment_tool_count

Increment the tool call count.

get_retry_count

Get the retry count for a specific tool. Parameters:
  • tool_name (str): Name of the tool
Returns:
  • int: Number of retries for the tool

increment_retry

Increment the retry count for a tool. Parameters:
  • tool_name (str): Name of the tool
I