nemo_voice_agent.evaluation.tools

View as Markdown

Submodules

Package Contents

Functions

NameDescription
_do_register_toolInternal: validate + register a tool class into ALL_SCHEMA_TOOLS_FOR_EVAL[domain].
get_schema_tool_for_evalInstantiate a registered tool by (domain, name), falling back to "default".
list_schema_tools_for_evalList registered tool names.
normalize_tool_resultDeprecated alias for the guard now applied by StandardSchemaTool.__call__.
register_schema_tool_for_evalClass-decorator factory that registers a tool class into a per-domain bucket.

Data

ALL_SCHEMA_TOOLS_FOR_EVAL

API

nemo_voice_agent.evaluation.tools._do_register_tool(
cls,
domain: str
)

Internal: validate + register a tool class into ALL_SCHEMA_TOOLS_FOR_EVAL[domain].

nemo_voice_agent.evaluation.tools.get_schema_tool_for_eval(
name: str,
domain: str = 'default',
rtvi: typing.Optional[pipecat.processors.frameworks.rtvi.RTVIProcessor] = None,
shared_state: typing.Optional[dict] = None,
kwargs = {}
) -> nemo_voice_agent.utils.tool_calling.base.StandardSchemaTool

Instantiate a registered tool by (domain, name), falling back to "default".

Raises KeyError if neither the specified domain nor "default" has a tool by that name. Catches typos (domain="tau2_arline") and missing- tool issues at the tool-instantiation step rather than silently down the line.

Parameters:

name
str

Tool class name (e.g., "GetUserDetailsTool").

domain
str" default="'default'

Registry namespace to look in first (e.g., "tau2_airline"). Defaults to "default" (which makes the fallback path a no-op).

rtvi
Optional[RTVIProcessor]" default="None

RTVI processor passed to the tool if its constructor accepts it.

shared_state
Optional[dict]" default="None

Per-scenario mutable state dict passed to the tool if its constructor accepts it.

**kwargs
Defaults to {}

Additional keyword arguments forwarded to the tool constructor.

Raises:

  • KeyError: if name isn’t registered in domain or "default".
nemo_voice_agent.evaluation.tools.list_schema_tools_for_eval(
domain: typing.Optional[str] = None
) -> typing.List[str]

List registered tool names.

Parameters:

domain
Optional[str]" default="None

If provided, list tools in that domain only. If None, returns "domain.name" strings across all domains for debugging.

nemo_voice_agent.evaluation.tools.normalize_tool_result(
result: typing.Any
) -> typing.Any

Deprecated alias for the guard now applied by StandardSchemaTool.__call__.

Kept so external callers keep working. Tools no longer need to call this: delivery (and this normalization) happens once, in __call__.

nemo_voice_agent.evaluation.tools.register_schema_tool_for_eval(
arg = None,
domain: str = 'default'
)

Class-decorator factory that registers a tool class into a per-domain bucket.

Usage::

@register_schema_tool_for_eval(domain=“tau2_airline”) class GetUserDetailsTool(_Tau2ReadTool): …

Or with the positional shortcut:

@register_schema_tool_for_eval(“tau2_airline”) class CancelReservationTool(_Tau2WriteTool): …

Legacy: bare @register_schema_tool_for_eval (no parens) still

registers under "default" — used by tool modules that haven’t

been migrated yet.

@register_schema_tool_for_eval class EndConversationTool(SendExitMessageTool): …

Why per-domain registries: with a single global {name → class} dict, tools with the same short name in different domains (e.g., CancelReservationTool in both eva and tau2) silently overwrote each other at import time. The alternative — long unique class names like Tau2AirlineCancelReservationTool — crowded the LLM’s tool surface. Namespacing by domain lets tools keep natural short names while remaining unambiguous.

Parameters:

arg
Defaults to None

Either the class being decorated (bare @register_schema_tool_for_eval) or a positional domain string (@register_schema_tool_for_eval("tau2_airline")).

domain
str" default="'default'

Registry namespace. Defaults to "default" for tools not tied to a specific evaluation domain (harness tools in basic_tools.py / rtvi_control.py plus customer_service / restaurant / qa / waitlist tools).

Raises:

  • ValueError: if the class isn’t a StandardSchemaTool subclass, or if a tool with the same name is already registered in this domain.
nemo_voice_agent.evaluation.tools.ALL_SCHEMA_TOOLS_FOR_EVAL: Dict[str, Dict[str, Type[StandardSchemaTool]]] = {}