nemo_voice_agent.evaluation.tools.eva_airline_tools
nemo_voice_agent.evaluation.tools.eva_airline_tools
Module Contents
Classes
Functions
Data
API
Bases: WriteAirlineTool
Add checked baggage (0-5 bags) to a flight segment.
Bases: WriteAirlineTool
Add or update a special meal request for a passenger on a flight segment.
Bases: WriteAirlineTool
Add passenger(s) to standby list for a flight.
Bases: WriteAirlineTool
Assign a seat (window/aisle/middle/no_preference) on a specific flight segment.
Bases: WriteAirlineTool
Cancel a flight booking (single journey within a reservation).
Bases: StandardSchemaTool
Get IRROPS disruption details (cause, fee waiver, refund eligibility).
Bases: StandardSchemaTool
Get current status of a specific flight (delays, cancellations, gate).
Bases: StandardSchemaTool
Retrieve flight reservation using confirmation number and passenger last name.
Authentication entry point — typically the first tool called per scenario.
Bases: WriteAirlineTool
Issue a hotel voucher (1-3 nights) for IRROPS overnight situations.
Bases: WriteAirlineTool
Issue a meal voucher for delays/cancellations that qualify per policy.
Bases: WriteAirlineTool
Issue a travel credit (future-flight voucher) to a passenger.
Bases: WriteAirlineTool
Process a refund. Call once per refund type (fare and ancillary fees are separate).
Bases: WriteAirlineTool
Rebook passenger(s) to a new flight (voluntary, IRROPS, partial).
Bases: StandardSchemaTool
Search available flights (origin/destination/date) filtered by seat availability.
Bases: WriteAirlineTool
Transfer the call to a live human agent (recordable terminal action).
Emit <exit> once the successful transfer result has been delivered.
Ordering matters: pipecat must commit the tool-call record before the
bridge tears the session down, which is exactly what this post-delivery
hook guarantees. Only fires when _execute reached its success path —
an error response leaves the conversation running.
Bases: WriteScenarioTool
Eva-airline subclass that binds ACTION_TYPES to AIRLINE_ACTION_TYPES.
Inherits _record_action (validates action_type against ACTION_TYPES,
appends to shared_state["actions"]) and _next_call_index (per-scenario
monotonic counter for tools that mint unique IDs) from the shared base.
Read-only tools subclass StandardSchemaTool directly — only writes record.
Return the ancillaries a rebooked segment inherits from the booking it replaces.
Rule of thumb for which fields carry: carry what the dataset gives no availability
model for, re-select what it does. seat is re-selected — segments carry
available_seat_types and AssignSeatTool can fail with no_seats_available, so a
seat is meaningful only against a specific aircraft. bags_checked and meal_request
have no such model: they are passenger-level entitlements that survive a change of flight
number, so they carry.
bags_checked — this is what eva’s expected_scenario_db encodes for all 25 rebooking
scenarios in the packaged dataset, including 7.2.1 where the rebook downgrades
main_cabin → basic_economy and the gold still keeps bags_checked: 1. The agent policy
says nothing about baggage at all, so with the previous hard-coded 0 the gold for 17 of
the 50 scenarios was reachable only by also calling AddBaggageAllowanceTool with the
original count — a write nothing in those scenarios asks for, and which no model made in
150 recorded runs.
meal_request — every eva fixture leaves this None (and every passenger’s
meal_preference is "none"), so carrying it is a no-op against the packaged data and
changes no hash. It is here so that a dietary request is not silently dropped across a
rebook if a future fixture ever sets one — the same defect class as the baggage one, caught
before it can bite.
Both are defaults, not locks: AddBaggageAllowanceTool and AddMealRequestTool still
override afterwards, which is how a caller who actually wants a change gets one.
Deliberate divergence from upstream: ServiceNow/eva’s rebook_flight hard-codes
"bags_checked": 0 and "meal_request": None at 0.1.3 (the version ported here)
and still does at 2.1.0, while its gold expects the carried-over bag count. Revisit if
upstream fixes it.
Source segment, in order of preference:
replaced_segment— set only for a partial (single-segment) rebook, where every new segment descends from that one leg.old_segments[index]— positional match for a whole-journey rebook.old_segments[0]— fallback when the new journey has more legs than the old one (e.g. a nonstop replaced by a one-stop); these ancillaries are per-booking in this dataset, so all segments of a booking always carry the same values.
Returned when shared_state[‘db’] is missing — fixture didn’t load.
Find a booking journey entry within a reservation.
When multiple bookings share the same journey_id (e.g. after a partial rebook creates a ‘kept’ booking alongside the cancelled original), the first non-cancelled booking is returned in preference to a cancelled one.
Find flight segment(s) within a booking journey.
If flight_number is provided, returns only that segment. If omitted and booking has one segment, returns that segment. If omitted and booking has multiple segments, returns an error dict.
Returns: List[dict]
(targets, error) — targets is a list of matching segments,
Return total fare for a booking journey.
Uses journey-level fare_paid if present, otherwise sums segment-level fare_paid.
Compute effective available seats for a journey.
For multi-segment journeys, the constraining factor is the segment with the fewest seats in each fare class (min across segments).
Return journey-level fares dict.
Fares are stored at the journey level as the total price for all segments combined.
Find a reservation by confirmation number.