bstraehle commited on
Commit
966c032
1 Parent(s): 7fdb488

Update agents.py

Browse files
Files changed (1) hide show
  1. agents.py +12 -10
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
- from tools import transfer_to_sales_agent, transfer_to_issues_repairs_agent, escalate_to_human
5
- from tools import execute_order, execute_refund, look_up_item, transfer_to_triage_agent
 
 
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": function_to_schema(transfer_to_sales_agent)},
20
- {"type": "function", "function": function_to_schema(transfer_to_issues_repairs_agent)},
21
- {"type": "function", "function": function_to_schema(escalate_to_human)}],
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": function_to_schema(execute_order)},
41
- {"type": "function", "function": function_to_schema(transfer_to_triage_agent)}],
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": function_to_schema(look_up_item)},
60
- {"type": "function", "function": function_to_schema(execute_refund)},
61
- {"type": "function", "function": function_to_schema(transfer_to_triage_agent)}],
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
  )