Spaces:
Running
Running
Delete tools.py
Browse files
tools.py
DELETED
@@ -1,71 +0,0 @@
|
|
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...")
|
37 |
-
print("\n=== Escalation Report ===")
|
38 |
-
print(f"Summary: {summary}")
|
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 ===")
|
47 |
-
print(f"Product: {product}")
|
48 |
-
print(f"Price: ${price}")
|
49 |
-
print("=================\n")
|
50 |
-
confirm = input("Confirm order? y/n: ").strip().lower()
|
51 |
-
if confirm == "y":
|
52 |
-
print("Order execution successful!")
|
53 |
-
return "Success"
|
54 |
-
else:
|
55 |
-
print(color("Order cancelled!", "red"))
|
56 |
-
return "User cancelled order."
|
57 |
-
|
58 |
-
def look_up_item(search_query):
|
59 |
-
"""Use to find item ID.
|
60 |
-
Search query can be a description or keywords."""
|
61 |
-
item_id = "item_132612938"
|
62 |
-
print("Found item:", item_id)
|
63 |
-
return item_id
|
64 |
-
|
65 |
-
def execute_refund(item_id, reason="not provided"):
|
66 |
-
print("\n\n=== Refund Summary ===")
|
67 |
-
print(f"Item ID: {item_id}")
|
68 |
-
print(f"Reason: {reason}")
|
69 |
-
print("=================\n")
|
70 |
-
print("Refund execution successful!")
|
71 |
-
return "Success"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|