mgbam commited on
Commit
dec18f5
·
verified ·
1 Parent(s): 49cc9a0

Create topic_agent.py

Browse files
Files changed (1) hide show
  1. topic_agent.py +13 -0
topic_agent.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Example for topic_agent.py
2
+ import openai
3
+
4
+ class TopicAgent:
5
+ def generate_outline(self, topic, duration, difficulty):
6
+ response = openai.ChatCompletion.create(
7
+ model="gpt-4",
8
+ messages=[
9
+ {"role": "system", "content": "You're an expert corporate trainer creating AI workshop outlines"},
10
+ {"role": "user", "content": f"Create a {duration}-hour {difficulty} workshop outline on {topic} with goals and modules"}
11
+ ]
12
+ )
13
+ return json.loads(response.choices[0].message.content)