File tree Expand file tree Collapse file tree 5 files changed +1296
-56
lines changed Expand file tree Collapse file tree 5 files changed +1296
-56
lines changed Original file line number Diff line number Diff line change 1919
2020async def main ():
2121 """Run a simple multi-agent conversation"""
22-
22+
2323 # Get API key from environment variable
2424 api_key = os .getenv ("OPENAI_API_KEY" )
2525 if not api_key :
2626 print ("Warning: OPENAI_API_KEY not set. Some features may not work." )
27-
27+
2828 # Create chat server
2929 server = ChatServer (api_key = api_key )
30-
30+
3131 # Define agent configurations
3232 agent_configs = [
3333 {
3434 "name" : "Alice" ,
3535 "type" : "llm" ,
3636 "model" : "gpt-4o-mini" ,
37- "goal" : "Be friendly and helpful in the conversation"
37+ "goal" : "Be friendly and helpful in the conversation" ,
3838 },
3939 {
40- "name" : "Bob" ,
40+ "name" : "Bob" ,
4141 "type" : "llm" ,
4242 "model" : "gpt-4o-mini" ,
43- "goal" : "Ask thoughtful questions and share interesting ideas"
44- }
43+ "goal" : "Ask thoughtful questions and share interesting ideas" ,
44+ },
4545 ]
46-
46+
4747 # Create a simple background
4848 background = ChatBackground (
4949 scenario = "Two friends meeting at a coffee shop" ,
@@ -52,20 +52,20 @@ async def main():
5252 p1_goal = "Have a pleasant conversation about weekend plans" ,
5353 p2_goal = "Discuss recent books and outdoor activities" ,
5454 p1_name = "Alice" ,
55- p2_name = "Bob"
55+ p2_name = "Bob" ,
5656 )
57-
57+
5858 print ("Starting multi-agent conversation..." )
5959 print ("=" * 50 )
60-
60+
6161 # Run the conversation
6262 await server .run_conversation (
6363 agent_configs = agent_configs ,
6464 background = background ,
6565 max_turns = 10 ,
66- enable_evaluation = True
66+ enable_evaluation = True ,
6767 )
6868
6969
7070if __name__ == "__main__" :
71- asyncio .run (main ())
71+ asyncio .run (main ())
You can’t perform that action at this time.
0 commit comments