nemo_relay.tools

View as Markdown

Generated from python/nemo_relay/tools.py.

Module nemo_relay.tools.

Tool lifecycle helpers.

Functions

call

1def call(name: str, args: Json, *, handle: ScopeHandle | None = None, attributes: ToolAttributes | None = None, data: Json | None = None, metadata: Json | None = None, tool_call_id: str | None = None, timestamp: datetime | None = None) -> ToolHandle

Start a manual tool span and return its ToolHandle.

call_end

1def call_end(handle: ToolHandle, result: ToolExecutionResult[Json], *, data: Json | None = None, metadata: Json | None = None, timestamp: datetime | None = None) -> None

Finish a manual tool span started by call().

execute

1def execute(name: str, args: Json, func: Callable[[Json], ToolExecutionResult[Json] | Awaitable[ToolExecutionResult[Json]]], *, handle: ScopeHandle | None = None, attributes: ToolAttributes | None = None, data: Json | None = None, metadata: Json | None = None, tool_call_id: str | None = None) -> Awaitable[ToolExecutionResult[Json]]

Run a tool through the managed middleware pipeline.

request_intercepts

1def request_intercepts(name: str, args: Json) -> Json | Awaitable[Json]

Apply global tool request intercepts to args.

conditional_execution

1def conditional_execution(name: str, args: Json) -> Awaitable[None] | None

Run tool conditional-execution guardrails for args.