nemo_voice_agent.evaluation.tools.eva_airline_tools

View as Markdown

Module Contents

Classes

NameDescription
AddBaggageAllowanceToolAdd checked baggage (0-5 bags) to a flight segment.
AddMealRequestToolAdd or update a special meal request for a passenger on a flight segment.
AddToStandbyToolAdd passenger(s) to standby list for a flight.
AssignSeatToolAssign a seat (window/aisle/middle/no_preference) on a specific flight segment.
CancelReservationToolCancel a flight booking (single journey within a reservation).
GetDisruptionInfoToolGet IRROPS disruption details (cause, fee waiver, refund eligibility).
GetFlightStatusToolGet current status of a specific flight (delays, cancellations, gate).
GetReservationToolRetrieve flight reservation using confirmation number and passenger last name.
IssueHotelVoucherToolIssue a hotel voucher (1-3 nights) for IRROPS overnight situations.
IssueMealVoucherToolIssue a meal voucher for delays/cancellations that qualify per policy.
IssueTravelCreditToolIssue a travel credit (future-flight voucher) to a passenger.
ProcessRefundToolProcess a refund. Call once per refund type (fare and ancillary fees are separate).
RebookFlightToolRebook passenger(s) to a new flight (voluntary, IRROPS, partial).
SearchRebookingOptionsToolSearch available flights (origin/destination/date) filtered by seat availability.
TransferToAgentToolTransfer the call to a live human agent (recordable terminal action).
WriteAirlineToolEva-airline subclass that binds ACTION_TYPES to AIRLINE_ACTION_TYPES.

Functions

NameDescription
_carried_ancillariesReturn the ancillaries a rebooked segment inherits from the booking it replaces.
_db_not_initializedReturned when shared_state[‘db’] is missing — fixture didn’t load.
_find_booking_journeyFind a booking journey entry within a reservation.
_find_booking_segmentFind flight segment(s) within a booking journey.
_get_booking_total_fareReturn total fare for a booking journey.
_get_journey_available_seatsCompute effective available seats for a journey.
_get_journey_faresReturn journey-level fares dict.
_journey_not_found-
_lookup_reservationFind a reservation by confirmation number.
_reservation_not_found-

Data

AIRLINE_ACTION_TYPES

API

class nemo_voice_agent.evaluation.tools.eva_airline_tools.AddBaggageAllowanceTool(
shared_state: typing.Optional[dict] = None,
description: typing.Optional[str] = None
)

Bases: WriteAirlineTool

Add checked baggage (0-5 bags) to a flight segment.

DESCRIPTION
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.eva_airline_tools.AddBaggageAllowanceTool._execute(
kwargs: typing.Any = {}
) -> typing.Dict[str, typing.Any]
async
class nemo_voice_agent.evaluation.tools.eva_airline_tools.AddMealRequestTool(
shared_state: typing.Optional[dict] = None,
description: typing.Optional[str] = None
)

Bases: WriteAirlineTool

Add or update a special meal request for a passenger on a flight segment.

DESCRIPTION
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.eva_airline_tools.AddMealRequestTool._execute(
kwargs: typing.Any = {}
) -> typing.Dict[str, typing.Any]
async
class nemo_voice_agent.evaluation.tools.eva_airline_tools.AddToStandbyTool(
shared_state: typing.Optional[dict] = None,
description: typing.Optional[str] = None
)

Bases: WriteAirlineTool

Add passenger(s) to standby list for a flight.

DESCRIPTION
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.eva_airline_tools.AddToStandbyTool._execute(
kwargs: typing.Any = {}
) -> typing.Dict[str, typing.Any]
async
class nemo_voice_agent.evaluation.tools.eva_airline_tools.AssignSeatTool(
shared_state: typing.Optional[dict] = None,
description: typing.Optional[str] = None
)

Bases: WriteAirlineTool

Assign a seat (window/aisle/middle/no_preference) on a specific flight segment.

DESCRIPTION
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.eva_airline_tools.AssignSeatTool._execute(
kwargs: typing.Any = {}
) -> typing.Dict[str, typing.Any]
async
class nemo_voice_agent.evaluation.tools.eva_airline_tools.CancelReservationTool(
shared_state: typing.Optional[dict] = None,
description: typing.Optional[str] = None
)

Bases: WriteAirlineTool

Cancel a flight booking (single journey within a reservation).

DESCRIPTION
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.eva_airline_tools.CancelReservationTool._execute(
kwargs: typing.Any = {}
) -> typing.Dict[str, typing.Any]
async
class nemo_voice_agent.evaluation.tools.eva_airline_tools.GetDisruptionInfoTool(
shared_state: typing.Optional[dict] = None,
description: typing.Optional[str] = None
)

Bases: StandardSchemaTool

Get IRROPS disruption details (cause, fee waiver, refund eligibility).

DESCRIPTION
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.eva_airline_tools.GetDisruptionInfoTool._execute(
kwargs: typing.Any = {}
) -> typing.Dict[str, typing.Any]
async
class nemo_voice_agent.evaluation.tools.eva_airline_tools.GetFlightStatusTool(
shared_state: typing.Optional[dict] = None,
description: typing.Optional[str] = None
)

Bases: StandardSchemaTool

Get current status of a specific flight (delays, cancellations, gate).

DESCRIPTION
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.eva_airline_tools.GetFlightStatusTool._execute(
kwargs: typing.Any = {}
) -> typing.Dict[str, typing.Any]
async
class nemo_voice_agent.evaluation.tools.eva_airline_tools.GetReservationTool(
shared_state: typing.Optional[dict] = None,
description: typing.Optional[str] = None
)

Bases: StandardSchemaTool

Retrieve flight reservation using confirmation number and passenger last name.

Authentication entry point — typically the first tool called per scenario.

DESCRIPTION
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.eva_airline_tools.GetReservationTool._execute(
kwargs: typing.Any = {}
) -> typing.Dict[str, typing.Any]
async
class nemo_voice_agent.evaluation.tools.eva_airline_tools.IssueHotelVoucherTool(
shared_state: typing.Optional[dict] = None,
description: typing.Optional[str] = None
)

Bases: WriteAirlineTool

Issue a hotel voucher (1-3 nights) for IRROPS overnight situations.

DESCRIPTION
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.eva_airline_tools.IssueHotelVoucherTool._execute(
kwargs: typing.Any = {}
) -> typing.Dict[str, typing.Any]
async
class nemo_voice_agent.evaluation.tools.eva_airline_tools.IssueMealVoucherTool(
shared_state: typing.Optional[dict] = None,
description: typing.Optional[str] = None
)

Bases: WriteAirlineTool

Issue a meal voucher for delays/cancellations that qualify per policy.

DESCRIPTION
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.eva_airline_tools.IssueMealVoucherTool._execute(
kwargs: typing.Any = {}
) -> typing.Dict[str, typing.Any]
async
class nemo_voice_agent.evaluation.tools.eva_airline_tools.IssueTravelCreditTool(
shared_state: typing.Optional[dict] = None,
description: typing.Optional[str] = None
)

Bases: WriteAirlineTool

Issue a travel credit (future-flight voucher) to a passenger.

DESCRIPTION
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.eva_airline_tools.IssueTravelCreditTool._execute(
kwargs: typing.Any = {}
) -> typing.Dict[str, typing.Any]
async
class nemo_voice_agent.evaluation.tools.eva_airline_tools.ProcessRefundTool(
shared_state: typing.Optional[dict] = None,
description: typing.Optional[str] = None
)

Bases: WriteAirlineTool

Process a refund. Call once per refund type (fare and ancillary fees are separate).

DESCRIPTION
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.eva_airline_tools.ProcessRefundTool._execute(
kwargs: typing.Any = {}
) -> typing.Dict[str, typing.Any]
async
class nemo_voice_agent.evaluation.tools.eva_airline_tools.RebookFlightTool(
shared_state: typing.Optional[dict] = None,
description: typing.Optional[str] = None
)

Bases: WriteAirlineTool

Rebook passenger(s) to a new flight (voluntary, IRROPS, partial).

DESCRIPTION
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.eva_airline_tools.RebookFlightTool._execute(
kwargs: typing.Any = {}
) -> typing.Dict[str, typing.Any]
async
class nemo_voice_agent.evaluation.tools.eva_airline_tools.SearchRebookingOptionsTool(
shared_state: typing.Optional[dict] = None,
description: typing.Optional[str] = None
)

Bases: StandardSchemaTool

Search available flights (origin/destination/date) filtered by seat availability.

DESCRIPTION
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.eva_airline_tools.SearchRebookingOptionsTool._execute(
kwargs: typing.Any = {}
) -> typing.Dict[str, typing.Any]
async
class nemo_voice_agent.evaluation.tools.eva_airline_tools.TransferToAgentTool(
shared_state: typing.Optional[dict] = None,
description: typing.Optional[str] = None
)

Bases: WriteAirlineTool

Transfer the call to a live human agent (recordable terminal action).

DESCRIPTION
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.eva_airline_tools.TransferToAgentTool._after_result(
params: pipecat.services.llm_service.FunctionCallParams
) -> None
async

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.

nemo_voice_agent.evaluation.tools.eva_airline_tools.TransferToAgentTool._execute(
kwargs: typing.Any = {}
) -> typing.Dict[str, typing.Any]
async
class nemo_voice_agent.evaluation.tools.eva_airline_tools.WriteAirlineTool()

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.

nemo_voice_agent.evaluation.tools.eva_airline_tools._carried_ancillaries(
old_segments: typing.List[dict],
replaced_segment: typing.Optional[dict],
index: int
) -> dict

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:

  1. replaced_segment — set only for a partial (single-segment) rebook, where every new segment descends from that one leg.
  2. old_segments[index] — positional match for a whole-journey rebook.
  3. 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.
nemo_voice_agent.evaluation.tools.eva_airline_tools._db_not_initialized() -> dict

Returned when shared_state[‘db’] is missing — fixture didn’t load.

nemo_voice_agent.evaluation.tools.eva_airline_tools._find_booking_journey(
reservation: dict,
journey_id: str
) -> typing.Optional[dict]

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.

nemo_voice_agent.evaluation.tools.eva_airline_tools._find_booking_segment(
booking: dict,
journey_id: str,
flight_number: str = ''
) -> tuple[typing.List[dict], typing.Optional[dict]]

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,

nemo_voice_agent.evaluation.tools.eva_airline_tools._get_booking_total_fare(
booking: dict
) -> float

Return total fare for a booking journey.

Uses journey-level fare_paid if present, otherwise sums segment-level fare_paid.

nemo_voice_agent.evaluation.tools.eva_airline_tools._get_journey_available_seats(
journey: dict
) -> dict

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).

nemo_voice_agent.evaluation.tools.eva_airline_tools._get_journey_fares(
journey: dict
) -> dict

Return journey-level fares dict.

Fares are stored at the journey level as the total price for all segments combined.

nemo_voice_agent.evaluation.tools.eva_airline_tools._journey_not_found(
journey_id: str
) -> dict
nemo_voice_agent.evaluation.tools.eva_airline_tools._lookup_reservation(
db: dict,
confirmation_number: str
) -> typing.Optional[dict]

Find a reservation by confirmation number.

nemo_voice_agent.evaluation.tools.eva_airline_tools._reservation_not_found(
confirmation_number: str
) -> dict
nemo_voice_agent.evaluation.tools.eva_airline_tools.AIRLINE_ACTION_TYPES: List[str] = ['rebook_flight', 'cancel_reservation', 'process_refund', 'issue_meal_voucher', ...