Spaces:
Running
Running
Update agents.py
Browse files
agents.py
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
# Reference: https://github.com/openai/build-hours/blob/main/2-assistants/7_orchestration.py
|
2 |
|
3 |
from openai import OpenAI
|
4 |
-
|
5 |
-
from tools import
|
|
|
|
|
6 |
|
7 |
MODEL = "gpt-4o-mini"
|
8 |
|
@@ -16,9 +18,9 @@ def create_triage_agent(client):
|
|
16 |
"But make your questions subtle and natural."
|
17 |
),
|
18 |
model=MODEL,
|
19 |
-
tools=[{"type": "function", "function":
|
20 |
-
{"type": "function", "function":
|
21 |
-
{"type": "function", "function":
|
22 |
)
|
23 |
|
24 |
def create_sales_agent(client):
|
@@ -37,8 +39,8 @@ def create_sales_agent(client):
|
|
37 |
""
|
38 |
),
|
39 |
model=MODEL,
|
40 |
-
tools=[{"type": "function", "function":
|
41 |
-
{"type": "function", "function":
|
42 |
)
|
43 |
|
44 |
def create_issues_repairs_agent(client):
|
@@ -56,7 +58,7 @@ def create_issues_repairs_agent(client):
|
|
56 |
""
|
57 |
),
|
58 |
model=MODEL,
|
59 |
-
tools=[{"type": "function", "function":
|
60 |
-
{"type": "function", "function":
|
61 |
-
{"type": "function", "function":
|
62 |
)
|
|
|
1 |
# Reference: https://github.com/openai/build-hours/blob/main/2-assistants/7_orchestration.py
|
2 |
|
3 |
from openai import OpenAI
|
4 |
+
|
5 |
+
from tools import escalate_to_human_json
|
6 |
+
from tools import transfer_to_sales_agent_json, transfer_to_issues_repairs_agent_json, transfer_to_triage_agent_json
|
7 |
+
from tools import execute_order_json, execute_refund_json, look_up_item_json
|
8 |
|
9 |
MODEL = "gpt-4o-mini"
|
10 |
|
|
|
18 |
"But make your questions subtle and natural."
|
19 |
),
|
20 |
model=MODEL,
|
21 |
+
tools=[{"type": "function", "function": transfer_to_sales_agent_json},
|
22 |
+
{"type": "function", "function": transfer_to_issues_repairs_agent_json},
|
23 |
+
{"type": "function", "function": escalate_to_human_json}],
|
24 |
)
|
25 |
|
26 |
def create_sales_agent(client):
|
|
|
39 |
""
|
40 |
),
|
41 |
model=MODEL,
|
42 |
+
tools=[{"type": "function", "function": execute_order_json},
|
43 |
+
{"type": "function", "function": transfer_to_triage_agent_json}],
|
44 |
)
|
45 |
|
46 |
def create_issues_repairs_agent(client):
|
|
|
58 |
""
|
59 |
),
|
60 |
model=MODEL,
|
61 |
+
tools=[{"type": "function", "function": look_up_item_json},
|
62 |
+
{"type": "function", "function": execute_refund_json},
|
63 |
+
{"type": "function", "function": transfer_to_triage_agent_json}],
|
64 |
)
|