View module source on GitHub

current_tool_call

def current_tool_call() -> Optional[ToolCall]
Get the current tool call from the context variable.

tool_call

def tool_call(logger: Optional[Logger] = None,
              id: Optional[Union[str, Callable]] = None,
              name: Optional[str] = None,
              description: Optional[str] = None,
              arguments: Optional[str] = None,
              tags: Optional[Dict[str, str]] = None,
              evaluators: Optional[List[str]] = None,
              evaluator_variables: Optional[Dict[str, str]] = None)
Decorator for tracking tool calls. This decorator wraps functions to automatically create and manage ToolCall objects for tracking tool calls, including inputs, outputs, and metadata. The decorated function must be called within a @trace or @span decorated context.