Skip to content

Commit 813b8f3

Browse files
committed
Language Persistnet through out the flow
1 parent c619b43 commit 813b8f3

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

app/agents/voice/breeze_buddy/workflows/order_confirmation/websocket_bot.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def _get_flow_config(self):
538538
),
539539
FlowsFunctionSchema(
540540
name="cancel_order",
541-
description="Call this function to cancel the user's order. If the user gives a reason for cancellation, pass it.",
541+
description="Call this function if the customer explicitly asks to cancel the order. If the user gives a reason for cancellation, pass it.",
542542
handler=self._deny_order_handler,
543543
properties={
544544
"reason": {
@@ -568,7 +568,7 @@ def _get_flow_config(self):
568568
),
569569
FlowsFunctionSchema(
570570
name="cancel_order",
571-
description="Call this function to cancel the user's order. If the user gives a reason for cancellation, pass it.",
571+
description="Call this function if the customer explicitly asks to cancel the order. If the user gives a reason for cancellation, pass it.",
572572
handler=self._deny_order_handler,
573573
properties={
574574
"reason": {
@@ -599,6 +599,13 @@ def _get_flow_config(self):
599599
properties={},
600600
required=[],
601601
),
602+
FlowsFunctionSchema(
603+
name="user_busy",
604+
description="Call this function if the user says they are busy or it's not a good time to talk.",
605+
handler=self._user_busy_handler,
606+
properties={},
607+
required=[],
608+
),
602609
]
603610

604611
# Address update functions
@@ -659,7 +666,7 @@ def _get_flow_config(self):
659666
"task_messages": [
660667
{
661668
"role": "system",
662-
"content": "The order is confirmed. Say: 'Thank you for confirming your order. Your order will be delivered soon. Have a good day'",
669+
"content": "Thank you for confirming your order. Your order will be delivered soon. Have a good day.",
663670
}
664671
],
665672
"post_actions": [
@@ -671,7 +678,7 @@ def _get_flow_config(self):
671678
"task_messages": [
672679
{
673680
"role": "system",
674-
"content": "The user confirmed the order but asked a question. Say: 'Thank you for confirming the order. I am here just to confirm your order, for any questions related to the order please refer to the website for more details. Have a good day.'",
681+
"content": "Thank you for confirming the order. I am here just to confirm your order, for any questions related to the order please refer to the website for more details. Have a good day.",
675682
}
676683
],
677684
"post_actions": [
@@ -683,7 +690,7 @@ def _get_flow_config(self):
683690
"task_messages": [
684691
{
685692
"role": "system",
686-
"content": "The order is cancelled. Say: 'I understand you don't want to proceed with this order. I am cancelling your order. Thank you for your time.'",
693+
"content": "I understand you don't want to proceed with this order. I am cancelling your order. Thank you for your time.",
687694
}
688695
],
689696
"post_actions": [
@@ -695,7 +702,7 @@ def _get_flow_config(self):
695702
"task_messages": [
696703
{
697704
"role": "system",
698-
"content": "The user is busy. Say: 'I understand. I will call you back later. Thank you for your time.'",
705+
"content": "I understand. I will call you back later. Thank you for your time.",
699706
}
700707
],
701708
"post_actions": [
@@ -707,7 +714,7 @@ def _get_flow_config(self):
707714
"task_messages": [
708715
{
709716
"role": "system",
710-
"content": f"The user asked an unrelated question. Say: 'I'm not able to help you with that right now, but you can find all the latest details on the {self.shop_name} website. Regarding your order, would you like to confirm it?'",
717+
"content": f"I'm not able to help you with that right now, but you can find all the latest details on the {self.shop_name} website. Regarding your order, would you like to confirm it?",
711718
}
712719
],
713720
"functions": order_functions,

0 commit comments

Comments
 (0)