| # Example for topic_agent.py | |
| import openai | |
| class TopicAgent: | |
| def generate_outline(self, topic, duration, difficulty): | |
| response = openai.ChatCompletion.create( | |
| model="gpt-4", | |
| messages=[ | |
| {"role": "system", "content": "You're an expert corporate trainer creating AI workshop outlines"}, | |
| {"role": "user", "content": f"Create a {duration}-hour {difficulty} workshop outline on {topic} with goals and modules"} | |
| ] | |
| ) | |
| return json.loads(response.choices[0].message.content) |