yera.tools.decorated_tool

The callable wrapper produced by @tool.

Symbols

class DecoratedTool — Callable wrapper around a tool function.

DecoratedTool

Inherits: OpaqueCallable

Callable wrapper around a tool function.

Produced by the @tool decorator. When called, resolves the tool's declared credential groups, binds them to the tool credential context, runs the wrapped function, and tears the context down on completion (even on failure).

Instances are normally produced by the decorator rather than constructed directly.

Methods

__call__ — Invoke the tool.

DecoratedTool.__call__

__call__(
    *args,
    **kwargs,
) → object

Invoke the tool.

Resolves and binds the tool's credentials (if any), calls the wrapped function, and restores the previous credential context on completion.

Parameters

*args
type: object = ()

Positional arguments forwarded to the wrapped function.

**kwargs
type: object

Keyword arguments forwarded to the wrapped function.

Returns

type: object

The wrapped function's return value.