nemo_voice_agent.evaluation.tools.customer_service_tools

View as Markdown

Module Contents

Classes

NameDescription
CancelSubscriptionToolCancel an account’s subscription: set plan to ‘Canceled’ and monthly_rate to ‘$0.00’.
ChangePlanToolChange an account’s subscription plan. Plan-to-rate mapping is injected at construction.
CheckOrderStatusToolCheck the status of a customer order. Orders are nested under accounts in shared_state.
LookupAccountToolLook up a customer account. Account data (including nested orders) lives in shared_state[“accounts”].
ProcessRefundToolIssue a refund on a customer account: append a negative charge entry and decrement balance.
ResolveTicketToolResolve a customer service ticket. Sends resolution + latest account snapshot to evaluator.
StartItemReturnToolInitiate a return for a customer order. Sets the order status to ‘Return Started’.
UnlockAccountToolUnlock a locked account: set account_status to ‘Active’ and failed_login_attempts to ‘0’.

Functions

NameDescription
_format_moneyFormat a float as a money string, preserving sign: ‘1,234.56or1,234.56' or '-49.99’.
_parse_moneyParse a money string like ‘1,234.56or1,234.56' or '-49.99’ into a float.

Data

DEFAULT_RESOLUTION_TYPES

API

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

Bases: StandardSchemaTool

Cancel an account’s subscription: set plan to ‘Canceled’ and monthly_rate to ‘$0.00’.

properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.customer_service_tools.CancelSubscriptionTool._execute(
account_id: typing.Optional[str] = None,
kwargs: typing.Any = {}
) -> typing.Any
async

Set the plan to ‘Canceled’ with a $0.00 monthly rate, and return the updated account.

class nemo_voice_agent.evaluation.tools.customer_service_tools.ChangePlanTool(
shared_state: typing.Optional[dict] = None,
plans: str = '{}',
description: typing.Optional[str] = None
)

Bases: StandardSchemaTool

Change an account’s subscription plan. Plan-to-rate mapping is injected at construction.

plans
properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.customer_service_tools.ChangePlanTool._execute(
account_id: typing.Optional[str] = None,
new_plan: typing.Optional[str] = None,
kwargs: typing.Any = {}
) -> typing.Any
async

Update the account’s plan name and monthly rate, and return the updated account.

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

Bases: StandardSchemaTool

Check the status of a customer order. Orders are nested under accounts in shared_state.

properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.customer_service_tools.CheckOrderStatusTool._execute(
account_id: typing.Optional[str] = None,
order_id: typing.Optional[str] = None,
kwargs: typing.Any = {}
) -> typing.Any
async

Return the order record for account_id/order_id, or an error dict if unknown.

class nemo_voice_agent.evaluation.tools.customer_service_tools.LookupAccountTool(
shared_state: typing.Optional[dict] = None,
accounts: str = '{}',
description: typing.Optional[str] = None
)

Bases: StandardSchemaTool

Look up a customer account. Account data (including nested orders) lives in shared_state[“accounts”].

properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.customer_service_tools.LookupAccountTool._execute(
account_id: typing.Optional[str] = None,
kwargs: typing.Any = {}
) -> typing.Any
async

Return the account record for account_id, or an error dict if unknown.

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

Bases: StandardSchemaTool

Issue a refund on a customer account: append a negative charge entry and decrement balance.

properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.customer_service_tools.ProcessRefundTool._execute(
account_id: typing.Optional[str] = None,
amount: typing.Any = None,
description: typing.Optional[str] = None,
date: typing.Optional[str] = None,
kwargs: typing.Any = {}
) -> typing.Any
async

Append a negative charge entry, decrement the balance, and return the refund record.

class nemo_voice_agent.evaluation.tools.customer_service_tools.ResolveTicketTool(
rtvi: typing.Optional[pipecat.processors.frameworks.rtvi.RTVIProcessor] = None,
shared_state: typing.Optional[dict] = None,
resolution_types: typing.Optional[typing.List[str]] = None,
description: typing.Optional[str] = None
)

Bases: SendScenarioSummaryTool

Resolve a customer service ticket. Sends resolution + latest account snapshot to evaluator.

properties
Dict[str, Any]
required_properties
List[str]
resolution_types
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.customer_service_tools.ResolveTicketTool._execute(
account_id: typing.Optional[str] = None,
issue_summary: typing.Optional[str] = None,
resolution_type: typing.Optional[str] = None,
resolution_details: typing.Optional[str] = None,
kwargs: typing.Any = {}
) -> typing.Any
async

Emit the resolution + account snapshot as a scenario summary, then return the ack.

The RTVI summary is pushed from here rather than from _after_result because it has always been emitted before the tool result is delivered; _after_result would flip that ordering. (Contrast SendExitMessageTool, whose <exit> must trail result delivery.)

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

Bases: StandardSchemaTool

Initiate a return for a customer order. Sets the order status to ‘Return Started’.

properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.customer_service_tools.StartItemReturnTool._execute(
account_id: typing.Optional[str] = None,
order_id: typing.Optional[str] = None,
reason: typing.Optional[str] = None,
kwargs: typing.Any = {}
) -> typing.Any
async

Set the order status to ‘Return Started’, record the reason, and return the order.

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

Bases: StandardSchemaTool

Unlock a locked account: set account_status to ‘Active’ and failed_login_attempts to ‘0’.

properties
Dict[str, Any]
required_properties
List[str]
state
= shared_state if shared_state is not None else {}
nemo_voice_agent.evaluation.tools.customer_service_tools.UnlockAccountTool._execute(
account_id: typing.Optional[str] = None,
kwargs: typing.Any = {}
) -> typing.Any
async

Reset the account to ‘Active’ with zero failed logins, and return the updated account.

nemo_voice_agent.evaluation.tools.customer_service_tools._format_money(
value: float
) -> str

Format a float as a money string, preserving sign: ‘1,234.56or1,234.56' or '-49.99’.

nemo_voice_agent.evaluation.tools.customer_service_tools._parse_money(
value: str
) -> float

Parse a money string like ‘1,234.56or1,234.56' or '-49.99’ into a float.

nemo_voice_agent.evaluation.tools.customer_service_tools.DEFAULT_RESOLUTION_TYPES: List[str] = ['refund', 'replacement', 'information', 'escalation', 'account_change']