nemo_voice_agent.evaluation.tools.tau2_airline_params
nemo_voice_agent.evaluation.tools.tau2_airline_params
Pydantic parameter models and enums for tau2_airline tool functions.
This file holds two classes of models, both consumed by
nemo_voice_agent.evaluation.tools.tau2_airline_tools:
-
Domain data models —
FlightDB/User/Reservation/Flight/Passenger/ payment-method variants / etc. Mirror tau2’sdata_model.py1:1 so dicts loaded fromnemo_voice_agent/evaluation/data/tau2_airline/db.jsonround-trip throughModel.model_validate(...)cleanly. Used by tools that need to manipulate strongly-typed records (e.g., creating a new Reservation). -
Tool argument schemas — one
*Paramsmodel per LLM-exposed tool. Each tool’s body callsModel.model_validate(params)at the top and catchesValidationErrorto produce a standard{"status": "error", ...}response for bad LLM-supplied inputs. Field descriptions come verbatim from tau2’s tool docstringArgs:blocks so the LLM sees identical instructions.
Convention:
- Enums use
StrEnumso values JSON-serialize as plain strings and compare equal to their literal counterparts. - All param models use
extra="forbid"— required by plan §5.1 step 3 to match tau2’s strict validation semantics. - Data models do NOT use
extra="forbid"becausedb.jsonmay carry upstream-added fields we don’t model yet; dropping them silently is safer than crashing on load.
Module Contents
Classes
Functions
Data
API
Bases: BaseModel
Bases: BaseModel
Bases: _ToolParamsBase
Bases: enum.Enum
Bases: _ToolParamsBase
Bases: _ToolParamsBase
Bases: FlightBase
Bases: BaseModel
Bases: BaseModel
Top-level shape of nemo_voice_agent/evaluation/data/tau2_airline/db.json.
Bases: BaseModel
Bases: BaseModel
Bases: BaseModel
Bases: BaseModel
Bases: BaseModel
Bases: BaseModel
Bases: BaseModel
One element of the flights argument to book_reservation /
update_reservation_flights — just a flight-number + date pair.
Bases: enum.Enum
Bases: _ToolParamsBase
Bases: _ToolParamsBase
Bases: enum.Enum
Bases: _ToolParamsBase
No arguments — LLM still passes an empty dict {}.
Bases: enum.Enum
Bases: BaseModel
Bases: BaseModel
Bases: BaseModel
A payment record (line item) attached to a reservation.
Bases: BaseModel
Bases: BaseModel
Bases: _ToolParamsBase
Bases: BaseModel
Bases: BaseModel
Strict base: reject unknown args, freeze types after validation.
Translate a pydantic ValidationError into a standard tool-error dict.
Tools should call this in their except ValidationError block so the LLM
sees a structured error rather than a raw Python traceback. Format mirrors
eva_airline tools’ error shape so the runner’s downstream handling doesn’t
need a separate code path per domain.