-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathautogen_modified_group_chat.py
91 lines (76 loc) · 2.5 KB
/
autogen_modified_group_chat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
"""
This is an example of a modified group chat using some of the agents in the agents/agents.py file. Compare these results to the results from autogen_standard_group_chat.py.
"""
import logging
import os
from autogen_mods.modified_group_chat import ModifiedGroupChat, ModifiedGroupChatManager
from agents.agents import (
user_proxy,
code_reviewer,
agent_awareness_expert,
python_expert,
function_calling_agent,
agi_gestalt_agent,
creative_solution_agent,
first_principles_thinker_agent,
out_of_the_box_thinker_agent,
strategic_planning_agent,
project_manager_agent,
efficiency_optimizer_agent,
emotional_intelligence_expert_agent,
task_history_review_agent,
task_comprehension_agent,
)
from dotenv import load_dotenv
load_dotenv()
logging.basicConfig(level=logging.INFO)
config_list3 = [
{
"model": "gpt-3.5-turbo",
"api_key": os.environ["OPENAI_API_KEY"],
}
]
config_list4 = [
{
"model": "gpt-4-1106-preview",
"api_key": os.environ["OPENAI_API_KEY"],
}
]
llm_config4 = {
"seed": 42,
"config_list": config_list4,
"temperature": 0.1,
}
AGENT_TEAM = [
user_proxy,
code_reviewer,
agent_awareness_expert,
python_expert,
function_calling_agent,
# agi_gestalt_agent,
creative_solution_agent,
first_principles_thinker_agent,
# out_of_the_box_thinker_agent,
# strategic_planning_agent,
project_manager_agent,
# efficiency_optimizer_agent,
# emotional_intelligence_expert_agent,
task_history_review_agent,
task_comprehension_agent
]
groupchat = ModifiedGroupChat(
agents=AGENT_TEAM,
messages=[],
max_round=100,
use_agent_council=True,
inject_agent_council=True,
continue_chat=False,
)
manager = ModifiedGroupChatManager(groupchat=groupchat, llm_config=llm_config4)
# NOTE: If the agents succussfully run their own autogen script, you will have to give it some time to process then press enter to exit the nested script.
message = """I'm interested in building autonomous agents using the autogen python library. Can you show me a complete example of how to do this? The example should show how to correctly configure and instantiate autogen automous agents. The request given to the agents will be: "Please write and then execute a python script that prints 10 dad jokes". I want the agents to run completely autonomously without any human intervention."""
user_proxy.initiate_chat(
manager,
clear_history=False,
message=message,
)