Spaces:
Running
Running
Update tiq_agent.py
Browse files148 unmodified lines14915015115215315415515629 unmodified lines186187188189190191192193194195148 unmodified lines- If no order is found, ask the customer to double-check the email or order number, without claiming that an order was fulfilled or shipped.- If Shopify returns an error or permission issue, escalate.- If Shopify returns "SHOPIFY HISTORICAL ORDER ACCESS REQUIRED", do not say theorder is missing. Escalate for manual lookup because the app cannot read ordersolder than Shopify's default 60-day window.Escalate after Shopify if:- order is not found after customer gave correct info29 unmodified lines- customer emailIf missing, ask naturally for the missing detail.Do not escalate until both are collected unless the user refuses or the issue is urgent.- While collecting required contact details, ask only for the missing name or email.Do not promise a callback, say the request was escalated, or return[NEEDS_HUMAN_REPLY] yet.When calling escalate_to_admin_tool, pass:- user_name148 unmodified lines14915015115215315415515615715815916016116229 unmodified lines192193194195196197198199200201202203204148 unmodified lines- If no order is found, ask the customer to double-check the email or order number, without claiming that an order was fulfilled or shipped.- If Shopify returns an error or permission issue, escalate.- If Shopify returns "SHOPIFY HISTORICAL ORDER ACCESS REQUIRED", do not say theorder is missing, do not mention lookup limits, tools, system access, a human,escalation, or a team, and do not make any callback promise.- For that outcome, enter contact-collection mode before escalation. Ask only:"Please send your full name and email address so we can review this."- If one contact detail is already known, ask only for the other missing detail.- For a non-urgent case, if the customer refuses to provide the required name oremail, return exactly [NEEDS_HUMAN_REPLY]. Do not escalate and do not send anyother text.Escalate after Shopify if:- order is not found after customer gave correct info29 unmodified lines- customer emailIf missing, ask naturally for the missing detail.Do not escalate until both are collected unless the issue is urgent.- While collecting required contact details, ask only for the missing name or email.Do not promise a callback, say the request was escalated, or return[NEEDS_HUMAN_REPLY] yet.- For a non-urgent case, if the customer refuses to provide a required name oremail, return exactly [NEEDS_HUMAN_REPLY]. Do not callescalate_to_admin_tool and do not add any customer-facing text.When calling escalate_to_admin_tool, pass:- user_name
tiq_agent.py+12-3