bstraehle commited on
Commit
5c2bca4
1 Parent(s): 1d1469b

Update agents.py

Browse files
Files changed (1) hide show
  1. agents.py +9 -15
agents.py CHANGED
@@ -5,7 +5,7 @@ from openai import OpenAI
5
  MODEL = "gpt-4o-mini"
6
 
7
  def create_triage_agent(client):
8
- assistant = client.beta.assistants.create(
9
  name="Triage Agent",
10
  instructions=(
11
  "You are a customer service bot for ACME Inc. "
@@ -18,11 +18,9 @@ def create_triage_agent(client):
18
  {"type": "transfer_to_issues_repairs_agent"},
19
  {"type": "escalate_to_human"}],
20
  )
21
- show_json("assistant", assistant)
22
- return assistant
23
 
24
  def create_sales_agent(client):
25
- assistant = client.beta.assistants.create(
26
  name="Sales Agent",
27
  instructions=(
28
  "You are a sales agent for ACME Inc."
@@ -37,14 +35,12 @@ def create_sales_agent(client):
37
  ""
38
  ),
39
  model=MODEL,
40
- tools=[{"type": "execute_order"},
41
- {"type": "transfer_to_triage_agent"}],
42
  )
43
- show_json("assistant", assistant)
44
- return assistant
45
 
46
  def create_issues_repairs_agent(client):
47
- assistant = client.beta.assistants.create(
48
  name="Issues and Repairs Agent",
49
  instructions=(
50
  "You are a customer support agent for ACME Inc."
@@ -58,9 +54,7 @@ def create_issues_repairs_agent(client):
58
  ""
59
  ),
60
  model=MODEL,
61
- tools=[{"type": "look_up_item"},
62
- {"type": "execute_refund"},
63
- {"type": "transfer_to_triage_agent"}],
64
- )
65
- show_json("assistant", assistant)
66
- return assistant
 
5
  MODEL = "gpt-4o-mini"
6
 
7
  def create_triage_agent(client):
8
+ return client.beta.assistants.create(
9
  name="Triage Agent",
10
  instructions=(
11
  "You are a customer service bot for ACME Inc. "
 
18
  {"type": "transfer_to_issues_repairs_agent"},
19
  {"type": "escalate_to_human"}],
20
  )
 
 
21
 
22
  def create_sales_agent(client):
23
+ return client.beta.assistants.create(
24
  name="Sales Agent",
25
  instructions=(
26
  "You are a sales agent for ACME Inc."
 
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):
43
+ return client.beta.assistants.create(
44
  name="Issues and Repairs Agent",
45
  instructions=(
46
  "You are a customer support agent for ACME Inc."
 
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
+ )