yera 0.5.0

yera.tools.decorated_tool

The callable wrapper produced by @tool.

Symbols

class DecoratedTool — Callable wrapper around a tool function.

DecoratedTool

Inherits: BaseTool

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.
invoke — Fill the inputs to this tool using the active LLM and then call it.

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.

DecoratedTool.invoke

invoke(
    instruction: str | None = None,
    **kwargs,
) → object

Fill the inputs to this tool using the active LLM and then call it.

Parameters

instruction
type: str | None = None

Optional guiding prompt for structured input generation.

**kwargs
type: str | int | float | bool

additional values to pass down the the llm generation such as temperature.

Returns

type: object

The result of calling the tool.