nemo_voice_agent.evaluation.tools.tau2_telecom_init_functions
nemo_voice_agent.evaluation.tools.tau2_telecom_init_functions
Telecom initialization-function ports for the initialization_actions framework.
Twenty init functions total — sixteen user-side and four agent-side. Each
is registered under domain="tau2_telecom" in the flat
ALL_INITIALIZATION_FUNCTIONS registry; the bot-side dispatcher invokes
them by func_name only (functions are side-agnostic, the bot picks
the DB based on which bot it is).
User-side init functions (mutate the user bot’s
shared_state["db"] = TelecomUserDB):
set_user_info(name, phone_number)— name + phone in surroundings.set_user_location(abroad)— toggles is_abroad flag.set_network_mode_preference(mode)— preferred cellular tech; triggers a network search.turn_airplane_mode_on()/turn_data_off()/turn_data_saver_mode_on()/turn_roaming_on()/turn_roaming_off()— direct field setters with a follow-up_simulate_network_searchwhere upstream does the same.simulate_network_search()— recomputes derived connection status. Used as both an init action and a helper.unseat_sim_card()/lock_sim_card(mode)— SIM state.remove_app_permission(app_name, permission)— clears a single permission flag.break_apn_settings()/break_apn_mms_setting()— deliberately bad APN config (test setup for issue scenarios).break_vpn()— connect VPN with POOR performance.set_wifi_calling(enabled, mms_over_wifi=None)— wifi calling + optional MMS-over-wifi flag.
Agent-side init functions (mutate the agent bot’s
shared_state["db"] = TelecomDB):
enable_roaming(customer_id, line_id)/disable_roaming(...)— flips a line’sroaming_enabledflag.set_data_usage(customer_id, line_id, amount_gb)— overwritesdata_used_gbon a line.suspend_line_for_overdue_bill(customer_id, line_id, bill_id, ...)— flips a line to SUSPENDED and ties an overdue bill.
Each function takes (db: dict, **arguments) -> None and mutates the
passed DB dict in place. Errors propagate; the dispatcher catches them
and returns a structured failure verdict.
Module Contents
Functions
Data
API
Mirror of upstream’s TelecomUserTools._check_sim_status.
Mirror of upstream’s _connect_vpn: set default VPN details if not already connected.
Mirror of upstream’s _disconnect_vpn: clear connection + details.
Recompute derived connection state from SIM + airplane + preference.
Mirrors upstream’s TelecomUserTools.simulate_network_search. Called
after init functions that affect SIM state, airplane mode, network
preference, APN settings, or roaming. Updates three fields:
network_connection_status, network_technology_connected,
network_signal_strength.
Clear the MMSC URL (forces MMS-send to fail).
Mark APN settings as broken (sets apn_name = BROKEN), then re-derive network state — broken APN forces NO_SERVICE.
Connect the VPN (if not already) and set its server_performance to POOR. Causes the speed-test simulator to multiply speed by 0.1.
Set roaming_enabled = False on the named customer’s line.
Set roaming_enabled = True on the named customer’s line.
Raises ValueError if the customer or line can’t be located —
init-time data errors should fail loud (the dispatcher catches them
and aborts the scenario).
Lock the SIM card. mode must be "pin" or "puk".
Clear a specific permission flag on an app.
permission is case-insensitive (‘sms’, ‘storage’, ‘phone’, ‘network’).
No-op if the app isn’t tracked or the permission name isn’t valid for
that app — matches upstream’s tolerant behavior (upstream returns a
(success, message) tuple; we discard the message at init time).
Overwrite data_used_gb on the named line.
Parameter name matches upstream TelecomTools.set_data_usage so
task initialization_actions payloads (e.g.
{"data_used_gb": 15.1}) dispatch cleanly without renaming.
Set preferred cellular network mode; triggers a network search.
mode is the string value of a NetworkModePreference enum
(e.g. "4g_5g_preferred", "2g_only").
Set the user’s name and phone number on surroundings.
Toggle the user’s abroad-or-home flag on surroundings.
Set the Wi-Fi Calling toggle and optionally the MMS-over-Wi-Fi flag.
When both Wi-Fi Calling and MMS-over-Wi-Fi are on, MMS-send is blocked (carrier limitation in the upstream simulation).
Recompute network_connection_status / technology / signal_strength from current SIM + airplane + preference + APN state.
Exposed as a public init action because some upstream tasks use it standalone (e.g. after manual surroundings tweaks) without bundling it into another mutation.
Suspend a line and create a new OVERDUE bill (mirrors upstream).
Faithful port of upstream’s TelecomTools.suspend_line_for_overdue_bill.
Used by service_issue scenarios that need to test the agent’s
bill-payment + line-resume flow:
- Verify line is ACTIVE (raise if not).
- Create a new OVERDUE bill with id
new_bill_idlinked to the customer, charging one month’s plan price. - Set the line’s status to SUSPENDED with today’s
suspension_start_date. - If
contract_ended=True, also setline.contract_end_dateto the last day of the previous month — the agent then can NOT lift the suspension by paying, per policy.
Parameter names match upstream’s set_data_usage /
suspend_line_for_overdue_bill signatures so task
initialization_actions payloads dispatch without renaming.
Enable Airplane Mode. Disconnects wifi, VPN, and clears wifi SSID; triggers a network search.
Turn the master Mobile Data switch OFF and re-derive network state.
Enable Data Saver mode (reduces simulated speed by 80%).
Disable Data Roaming on the device; triggers a network search.
Enable Data Roaming on the device; triggers a network search.
Mark the SIM as physically missing; triggers a network search.
The network-search rebuild sees sim_card_missing=True and forces
NO_SERVICE / NONE / NONE on connection_status / tech / signal.