Skip to main content

Parameters

ParameterTypeDefaultDescription
requires_confirmationboolFalseIf True, the agent will pause and require user confirmation before executing the tool
requires_user_inputboolFalseIf True, the agent will pause and prompt the user for input for specified fields
user_input_fieldsList[str][]Field names that the user should provide when requires_user_input is True
external_executionboolFalseIf True, the tool’s execution is handled by an external process
show_resultboolFalseIf True, the output is shown to the user and NOT sent back to the LLM
stop_after_tool_callboolFalseIf True, the agent’s run will terminate after this tool call
sequentialboolFalseIf True, this tool requires sequential execution (no parallelization)
cache_resultsboolFalseIf True, the result will be cached based on arguments
cache_dirOptional[str]NoneDirectory to store cache files
cache_ttlOptional[int]NoneTime-to-live for cache entries in seconds
tool_hooksOptional[ToolHooks]NoneCustom functions to run before/after tool execution
max_retriesOptional[int]5Maximum number of retries allowed for this tool
timeoutOptional[float]30.0Timeout for tool execution in seconds
strictOptional[bool]NoneWhether to enforce strict JSON schema validation on tool parameters
docstring_formatstr'auto'Format of the docstring: ‘google’, ‘numpy’, ‘sphinx’, or ‘auto’
require_parameter_descriptionsboolFalseIf True, raise error if required parameter descriptions are missing

Functions

No specific functions - Configuration class for tool behavior.

title: ToolHooks sidebarTitle: ToolHooks

Parameters

ParameterTypeDefaultDescription
beforeOptional[Callable]NoneFunction to run before tool execution
afterOptional[Callable]NoneFunction to run after tool execution

Functions

No specific functions - Configuration class for tool execution hooks.

title: _ToolDecorator sidebarTitle: _ToolDecorator

Parameters

ParameterTypeDefaultDescription
configToolConfig-Tool configuration object

Functions

__call__

Apply the decorator to a function. Parameters:
  • func (Callable): The function to decorate
Returns:
  • Callable: The decorated function


title: tool sidebarTitle: tool

Functions

tool

Decorator to configure tool behavior. Use @tool or @tool(…) for configuration. Parameters:
  • *args (Any): Positional arguments
  • **kwargs (Any): Keyword arguments for ToolConfig
Returns:
  • Union[Callable, _ToolDecorator]: Either a decorated function or a decorator instance
I