nemo_voice_agent.evaluation.tools.tau2_retail_params

View as Markdown

Pydantic parameter models for tau2_retail tool functions.

Same pattern as tau2_airline_params.py: two classes of models, one mirroring data_model.py for DB round-tripping and one *Params per LLM-exposed tool for strict (extra="forbid") argument validation.

Module Contents

Classes

NameDescription
CalculateParams-
CancelPendingOrderParams-
CancelReason-
CreditCard-
ExchangeDeliveredOrderItemsParams-
FindUserIdByEmailParams-
FindUserIdByNameZipParams-
GetItemDetailsParams-
GetOrderDetailsParams-
GetProductDetailsParams-
GetUserDetailsParams-
GiftCard-
ListAllProductTypesParamsNo arguments — LLM still passes an empty dict {}.
ModifyPendingOrderAddressParams-
ModifyPendingOrderItemsParams-
ModifyPendingOrderPaymentParams-
ModifyUserAddressParams-
OrderAn order with its items, status, fulfillment and payment details.
OrderFullfilmentRepresents the fulfillment details for items in an order.
OrderItem-
OrderPayment-
OrderStatus-
PaymentMethodBase-
Paypal-
ProductRepresents a product with its variants.
RetailDBTop-level shape of nemo_voice_agent/evaluation/data/tau2_retail/db.json.
ReturnDeliveredOrderItemsParams-
TransferToHumanAgentsParams-
UserA user with their personal info, payment methods and order history.
UserAddress-
UserName-
VariantRepresents a specific variant of a product with its options, availability and price.
_ToolParamsBaseStrict base: reject unknown args.

Functions

NameDescription
validation_error_responseTranslate a pydantic ValidationError into a standard tool-error dict.

Data

OrderPaymentType

PaymentMethod

API

class nemo_voice_agent.evaluation.tools.tau2_retail_params.CalculateParams()

Bases: _ToolParamsBase

expression
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.CancelPendingOrderParams()

Bases: _ToolParamsBase

order_id
str
reason
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.CancelReason

Bases: enum.Enum

no_longer_needed
= 'no longer needed'
ordered_by_mistake
= 'ordered by mistake'
class nemo_voice_agent.evaluation.tools.tau2_retail_params.CreditCard()

Bases: PaymentMethodBase

brand
str
last_four
str
source
Literal['credit_card']
class nemo_voice_agent.evaluation.tools.tau2_retail_params.ExchangeDeliveredOrderItemsParams()

Bases: _ToolParamsBase

item_ids
List[str]
new_item_ids
List[str]
order_id
str
payment_method_id
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.FindUserIdByEmailParams()

Bases: _ToolParamsBase

email
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.FindUserIdByNameZipParams()

Bases: _ToolParamsBase

first_name
str
last_name
str
zip
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.GetItemDetailsParams()

Bases: _ToolParamsBase

item_id
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.GetOrderDetailsParams()

Bases: _ToolParamsBase

order_id
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.GetProductDetailsParams()

Bases: _ToolParamsBase

product_id
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.GetUserDetailsParams()

Bases: _ToolParamsBase

user_id
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.GiftCard()

Bases: PaymentMethodBase

balance
float = Field(description='Gift card value amount')
id
str
source
Literal['gift_card']
class nemo_voice_agent.evaluation.tools.tau2_retail_params.ListAllProductTypesParams()

Bases: _ToolParamsBase

No arguments — LLM still passes an empty dict {}.

class nemo_voice_agent.evaluation.tools.tau2_retail_params.ModifyPendingOrderAddressParams()

Bases: _ToolParamsBase

address1
str
address2
str
city
str
country
str = Field(description="The country, such as 'USA'.")
order_id
str
state
str = Field(description="The state, such as 'CA'.")
zip
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.ModifyPendingOrderItemsParams()

Bases: _ToolParamsBase

item_ids
List[str]
new_item_ids
List[str]
order_id
str
payment_method_id
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.ModifyPendingOrderPaymentParams()

Bases: _ToolParamsBase

order_id
str
payment_method_id
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.ModifyUserAddressParams()

Bases: _ToolParamsBase

address1
str
address2
str
city
str
country
str = Field(description="The country, such as 'USA'.")
state
str = Field(description="The state, such as 'CA'.")
user_id
str
zip
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.Order()

Bases: BaseModel

An order with its items, status, fulfillment and payment details.

address
UserAddress = Field(description='Address of the user')
cancel_reason
Optional[CancelReason]
exchange_items
Optional[List[str]]
exchange_new_items
Optional[List[str]]
exchange_payment_method_id
Optional[str]
exchange_price_difference
Optional[float]
fulfillments
List[OrderFullfilment] = Field(description='Fulfillments of the order')
items
List[OrderItem] = Field(description='Items in the order')
order_id
str
payment_history
List[OrderPayment] = Field(description='Payments of the order')
return_items
Optional[List[str]]
return_payment_method_id
Optional[str]
status
OrderStatus = Field(description='Status of the order')
user_id
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.OrderFullfilment()

Bases: BaseModel

Represents the fulfillment details for items in an order.

item_ids
List[str]
tracking_id
List[str]
class nemo_voice_agent.evaluation.tools.tau2_retail_params.OrderItem()

Bases: BaseModel

item_id
str = Field(description='ID of the specific variant')
name
str = Field(description='Name of the product')
options
Dict[str, str]
price
float
product_id
str = Field(description='ID of the product')
class nemo_voice_agent.evaluation.tools.tau2_retail_params.OrderPayment()

Bases: BaseModel

amount
float = Field(description='Amount of the transaction')
payment_method_id
str = Field(description='ID of the payment method used')
transaction_type
OrderPaymentType
class nemo_voice_agent.evaluation.tools.tau2_retail_params.OrderStatus

Bases: enum.Enum

cancelled
= 'cancelled'
delivered
= 'delivered'
exchange_requested
= 'exchange requested'
pending
= 'pending'
pending_item_modified
= 'pending (item modified)'
processed
= 'processed'
return_requested
= 'return requested'
class nemo_voice_agent.evaluation.tools.tau2_retail_params.PaymentMethodBase()

Bases: BaseModel

id
str
source
str = Field(description='Type of payment method')
class nemo_voice_agent.evaluation.tools.tau2_retail_params.Paypal()

Bases: PaymentMethodBase

source
Literal['paypal']
class nemo_voice_agent.evaluation.tools.tau2_retail_params.Product()

Bases: BaseModel

Represents a product with its variants.

name
str = Field(description='Name of the product')
product_id
str
variants
Dict[str, Variant]
class nemo_voice_agent.evaluation.tools.tau2_retail_params.RetailDB()

Bases: BaseModel

Top-level shape of nemo_voice_agent/evaluation/data/tau2_retail/db.json.

orders
Dict[str, Order]
products
Dict[str, Product]
users
Dict[str, User]
class nemo_voice_agent.evaluation.tools.tau2_retail_params.ReturnDeliveredOrderItemsParams()

Bases: _ToolParamsBase

item_ids
List[str]
order_id
str
payment_method_id
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.TransferToHumanAgentsParams()

Bases: _ToolParamsBase

summary
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.User()

Bases: BaseModel

A user with their personal info, payment methods and order history.

address
UserAddress = Field(description="User's primary address")
email
str = Field(description="User's email address")
name
UserName = Field(description="User's full name")
orders
List[str]
payment_methods
Dict[str, PaymentMethod]
user_id
str
class nemo_voice_agent.evaluation.tools.tau2_retail_params.UserAddress()

Bases: BaseModel

address1
str = Field(description='Primary address line')
address2
str = Field(description='Secondary address line')
city
str = Field(description='City name')
country
str = Field(description='Country name')
state
str = Field(description='State or province name')
zip
str = Field(description='Postal code')
class nemo_voice_agent.evaluation.tools.tau2_retail_params.UserName()

Bases: BaseModel

first_name
str = Field(description="User's first name")
last_name
str = Field(description="User's last name")
class nemo_voice_agent.evaluation.tools.tau2_retail_params.Variant()

Bases: BaseModel

Represents a specific variant of a product with its options, availability and price.

available
bool
item_id
str
options
Dict[str, str]
price
float = Field(description='Price of this variant')
class nemo_voice_agent.evaluation.tools.tau2_retail_params._ToolParamsBase()

Bases: BaseModel

Strict base: reject unknown args.

model_config
= ConfigDict(extra='forbid')
nemo_voice_agent.evaluation.tools.tau2_retail_params.validation_error_response(
error: pydantic.ValidationError
) -> typing.Dict[str, typing.Any]

Translate a pydantic ValidationError into a standard tool-error dict.

Mirrors tau2_airline_params.validation_error_response so the runner’s downstream handling is uniform across domains.

nemo_voice_agent.evaluation.tools.tau2_retail_params.OrderPaymentType = Literal['payment', 'refund']
nemo_voice_agent.evaluation.tools.tau2_retail_params.PaymentMethod = Union[CreditCard, GiftCard, Paypal]