xr_ai_tools.tools#
Typed native tools with a Relay-managed execution boundary.
Classes#
A model-visible result from one local tool invocation. |
|
A Pydantic-validated tool shared by agents, voice, and background triggers. |
|
A native tool catalog with model-visible dispatch names. |
Module Contents#
- class xr_ai_tools.tools.ToolInvocationResult#
A model-visible result from one local tool invocation.
- content: str#
Model-visible serialized result or validation error.
- return_direct: bool#
Whether the agent should return the content without another model turn.
- class xr_ai_tools.tools.Tool(
- name: str,
- description: str,
- request_model: type[RequestT],
- result_model: type[pydantic.BaseModel] | None,
- handler: collections.abc.Callable[[RequestT], collections.abc.Awaitable[ResultT] | ResultT],
- *,
- return_direct: bool = False,
- render_result: collections.abc.Callable[[ResultT], str] | None = None,
A Pydantic-validated tool shared by agents, voice, and background triggers.
- async execute(request: RequestT) ResultT#
Run one validated request through the shared Relay tool lifecycle.
- async invoke(arguments: str) ToolInvocationResult#
Validate and run one model-supplied JSON argument payload.