Spaces:
Running
Running
Update tools.py
Browse files
tools.py
CHANGED
@@ -1,16 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
def transfer_to_sales_agent():
|
2 |
"""Use for anything sales or buying related."""
|
3 |
-
|
4 |
|
5 |
def transfer_to_issues_repairs_agent():
|
6 |
"""Use for issues, repairs, or refunds."""
|
7 |
-
|
8 |
|
9 |
def transfer_to_triage_agent():
|
10 |
"""Call this if the user brings up a topic outside of your purview,
|
11 |
including escalating to human."""
|
12 |
-
|
13 |
-
|
|
|
|
|
14 |
def escalate_to_human(summary):
|
15 |
"""Only call this if explicitly asked to."""
|
16 |
print("Escalating to human agent...")
|
@@ -19,6 +39,8 @@ def escalate_to_human(summary):
|
|
19 |
print("=========================\n")
|
20 |
exit()
|
21 |
|
|
|
|
|
22 |
def execute_order(product, price: int):
|
23 |
"""Price should be in USD."""
|
24 |
print("\n\n=== Order Summary ===")
|
|
|
1 |
+
current_agent, current_thread = None, None
|
2 |
+
|
3 |
+
###
|
4 |
+
|
5 |
+
def set_current_agent(agent):
|
6 |
+
current_agent = agent
|
7 |
+
|
8 |
+
def set_current_thread(thread):
|
9 |
+
current_thread = thread
|
10 |
+
|
11 |
+
def get_current_agent():
|
12 |
+
return current_agent
|
13 |
+
|
14 |
+
def get_current_thread():
|
15 |
+
return current_thread
|
16 |
+
|
17 |
+
###
|
18 |
+
|
19 |
def transfer_to_sales_agent():
|
20 |
"""Use for anything sales or buying related."""
|
21 |
+
current_agent = sales_agent
|
22 |
|
23 |
def transfer_to_issues_repairs_agent():
|
24 |
"""Use for issues, repairs, or refunds."""
|
25 |
+
current_agent = issues_repairs_agent
|
26 |
|
27 |
def transfer_to_triage_agent():
|
28 |
"""Call this if the user brings up a topic outside of your purview,
|
29 |
including escalating to human."""
|
30 |
+
current_agent = triage_agent
|
31 |
+
|
32 |
+
###
|
33 |
+
|
34 |
def escalate_to_human(summary):
|
35 |
"""Only call this if explicitly asked to."""
|
36 |
print("Escalating to human agent...")
|
|
|
39 |
print("=========================\n")
|
40 |
exit()
|
41 |
|
42 |
+
###
|
43 |
+
|
44 |
def execute_order(product, price: int):
|
45 |
"""Price should be in USD."""
|
46 |
print("\n\n=== Order Summary ===")
|