yera.tools.decorated_tool
The callable wrapper produced by @tool.
Symbols
DecoratedTool
BaseToolCallable 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
DecoratedTool.__init__
__init__(
func: Callable,
creds_keys: list[str] | None = None,
insert_result: bool = True,
)Wrap func as a tool with optional credential groups.
Parameters
The function to wrap.
Credential group names to resolve before each
call, or None to skip credential resolution.
Whether the tool's return value is added to the conversation. Set False for side-effect-only tools whose output would be noise in the model's context. Failures are reported regardless — the model asked for the call and needs to know it didn't succeed.
DecoratedTool.__call__
__call__(
*args,
**kwargs,
) → objectInvoke the tool.
Resolves and binds the tool's credentials (if any), calls the wrapped function, and restores the previous credential context on completion.
Parameters
Positional arguments forwarded to the wrapped function.
Keyword arguments forwarded to the wrapped function.
Returns
The wrapped function's return value.
DecoratedTool.invoke
invoke(
instruction: str | None = None,
**kwargs,
) → objectFill the inputs to this tool using the active LLM and then call it.
Parameters
Optional guiding prompt for structured input generation.
additional values to pass down the the llm generation such as temperature.
Returns
The result of calling the tool.