bstraehle commited on
Commit
b1409bb
1 Parent(s): cee079a

Update agents.py

Browse files
Files changed (1) hide show
  1. agents.py +11 -8
agents.py CHANGED
@@ -1,6 +1,9 @@
1
  # Reference: https://github.com/openai/build-hours/blob/main/2-assistants/7_orchestration.py
2
 
3
  from openai import OpenAI
 
 
 
4
 
5
  MODEL = "gpt-4o-mini"
6
 
@@ -14,9 +17,9 @@ def create_triage_agent(client):
14
  "But make your questions subtle and natural."
15
  ),
16
  model=MODEL,
17
- tools=[{"type": "function", "function": transfer_to_sales_agent},
18
- {"type": "function", "function": transfer_to_issues_repairs_agent},
19
- {"type": "function", "function": escalate_to_human}],
20
  )
21
 
22
  def create_sales_agent(client):
@@ -35,8 +38,8 @@ def create_sales_agent(client):
35
  ""
36
  ),
37
  model=MODEL,
38
- tools=[{"type": "function", "function": execute_order},
39
- {"type": "function", "function": transfer_to_triage_agent}],
40
  )
41
 
42
  def create_issues_repairs_agent(client):
@@ -54,7 +57,7 @@ def create_issues_repairs_agent(client):
54
  ""
55
  ),
56
  model=MODEL,
57
- tools=[{"type": "function", "function": look_up_item},
58
- {"type": "function", "function": execute_refund},
59
- {"type": "function", "function": transfer_to_triage_agent}],
60
  )
 
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
+ from utils import function_to_schema
7
 
8
  MODEL = "gpt-4o-mini"
9
 
 
17
  "But make your questions subtle and natural."
18
  ),
19
  model=MODEL,
20
+ tools=[{"type": "function", "function": function_to_schema(transfer_to_sales_agent)},
21
+ {"type": "function", "function": function_to_schema(transfer_to_issues_repairs_agent)},
22
+ {"type": "function", "function": function_to_schema(escalate_to_human)}],
23
  )
24
 
25
  def create_sales_agent(client):
 
38
  ""
39
  ),
40
  model=MODEL,
41
+ tools=[{"type": "function", "function": function_to_schema(execute_order)},
42
+ {"type": "function", "function": function_to_schema(transfer_to_triage_agent)}],
43
  )
44
 
45
  def create_issues_repairs_agent(client):
 
57
  ""
58
  ),
59
  model=MODEL,
60
+ tools=[{"type": "function", "function": function_to_schema(look_up_item)},
61
+ {"type": "function", "function": function_to_schema(execute_refund)},
62
+ {"type": "function", "function": function_to_schema(transfer_to_triage_agent)}],
63
  )