FLAML 2.0.2__tar.gz → 2.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {FLAML-2.0.2 → FLAML-2.1.0}/FLAML.egg-info/PKG-INFO +3 -1
- {FLAML-2.0.2 → FLAML-2.1.0}/FLAML.egg-info/SOURCES.txt +1 -1
- {FLAML-2.0.2 → FLAML-2.1.0}/PKG-INFO +3 -1
- {FLAML-2.0.2 → FLAML-2.1.0}/README.md +2 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/autogen/agentchat/__init__.py +2 -2
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/autogen/agentchat/assistant_agent.py +4 -4
- FLAML-2.0.2/flaml/autogen/agentchat/responsive_agent.py → FLAML-2.1.0/flaml/autogen/agentchat/conversable_agent.py +12 -12
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/autogen/agentchat/groupchat.py +30 -14
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/autogen/agentchat/user_proxy_agent.py +4 -4
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/autogen/oai/completion.py +2 -0
- FLAML-2.1.0/flaml/version.py +1 -0
- FLAML-2.0.2/flaml/version.py +0 -1
- {FLAML-2.0.2 → FLAML-2.1.0}/FLAML.egg-info/dependency_links.txt +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/FLAML.egg-info/requires.txt +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/FLAML.egg-info/top_level.txt +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/LICENSE +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/NOTICE.md +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/autogen/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/autogen/agentchat/agent.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/autogen/code_utils.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/autogen/extensions/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/autogen/math_utils.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/autogen/oai/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/autogen/oai/openai_utils.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/autogen/retrieve_utils.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/automl.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/data.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/logger.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/ml.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/model.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/nlp/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/nlp/huggingface/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/nlp/huggingface/data_collator.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/nlp/huggingface/trainer.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/nlp/huggingface/training_args.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/nlp/huggingface/utils.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/nlp/utils.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/spark/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/spark/configs.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/spark/metrics.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/spark/utils.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/state.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/task/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/task/factory.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/task/generic_task.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/task/task.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/task/time_series_task.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/time_series/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/time_series/feature.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/time_series/sklearn.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/time_series/tft.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/time_series/ts_data.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/time_series/ts_model.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/automl/training_log.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/config.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/data.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/all/binary.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/all/multiclass.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/all/regression.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/estimator.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/extra_tree/binary.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/extra_tree/multiclass.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/extra_tree/regression.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/greedy.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/lgbm/binary.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/lgbm/multiclass.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/lgbm/regression.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/portfolio.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/regret.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/rf/binary.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/rf/multiclass.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/rf/regression.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/suggest.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/xgb_limitdepth/binary.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/xgb_limitdepth/multiclass.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/xgb_limitdepth/regression.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/xgboost/binary.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/xgboost/multiclass.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/default/xgboost/regression.json +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/ml.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/model.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/onlineml/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/onlineml/autovw.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/onlineml/trial.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/onlineml/trial_runner.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/analysis.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/result.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/sample.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/scheduler/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/scheduler/online_scheduler.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/scheduler/trial_scheduler.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/searcher/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/searcher/blendsearch.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/searcher/cfo_cat.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/searcher/flow2.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/searcher/online_searcher.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/searcher/search_thread.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/searcher/suggestion.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/searcher/variant_generator.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/space.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/spark/__init__.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/spark/utils.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/trial.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/trial_runner.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/tune.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/flaml/tune/utils.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/pyproject.toml +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/setup.cfg +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/setup.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/test/test_autovw.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/test/test_conda_distribution.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/test/test_gpu.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/test/test_model.py +0 -0
- {FLAML-2.0.2 → FLAML-2.1.0}/test/test_version.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: FLAML
|
|
3
|
-
Version: 2.0
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: A fast library for automated machine learning and tuning
|
|
5
5
|
Home-page: https://github.com/microsoft/FLAML
|
|
6
6
|
Author: Microsoft Corporation
|
|
@@ -50,6 +50,8 @@ License-File: NOTICE.md
|
|
|
50
50
|
<br>
|
|
51
51
|
</p>
|
|
52
52
|
|
|
53
|
+
:fire: Heads-up: We're preparing to migrate [autogen](https://microsoft.github.io/FLAML/docs/Use-Cases/Autogen) into a dedicated github repository. Alongside this move, we'll also launch a dedicated Discord server and a website for comprehensive documentation.
|
|
54
|
+
|
|
53
55
|
:fire: The automated multi-agent chat framework in [autogen](https://microsoft.github.io/FLAML/docs/Use-Cases/Autogen) is in preview from v2.0.0.
|
|
54
56
|
|
|
55
57
|
:fire: FLAML is highlighted in OpenAI's [cookbook](https://github.com/openai/openai-cookbook#related-resources-from-around-the-web).
|
|
@@ -21,8 +21,8 @@ flaml/autogen/retrieve_utils.py
|
|
|
21
21
|
flaml/autogen/agentchat/__init__.py
|
|
22
22
|
flaml/autogen/agentchat/agent.py
|
|
23
23
|
flaml/autogen/agentchat/assistant_agent.py
|
|
24
|
+
flaml/autogen/agentchat/conversable_agent.py
|
|
24
25
|
flaml/autogen/agentchat/groupchat.py
|
|
25
|
-
flaml/autogen/agentchat/responsive_agent.py
|
|
26
26
|
flaml/autogen/agentchat/user_proxy_agent.py
|
|
27
27
|
flaml/autogen/extensions/__init__.py
|
|
28
28
|
flaml/autogen/oai/__init__.py
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: FLAML
|
|
3
|
-
Version: 2.0
|
|
3
|
+
Version: 2.1.0
|
|
4
4
|
Summary: A fast library for automated machine learning and tuning
|
|
5
5
|
Home-page: https://github.com/microsoft/FLAML
|
|
6
6
|
Author: Microsoft Corporation
|
|
@@ -50,6 +50,8 @@ License-File: NOTICE.md
|
|
|
50
50
|
<br>
|
|
51
51
|
</p>
|
|
52
52
|
|
|
53
|
+
:fire: Heads-up: We're preparing to migrate [autogen](https://microsoft.github.io/FLAML/docs/Use-Cases/Autogen) into a dedicated github repository. Alongside this move, we'll also launch a dedicated Discord server and a website for comprehensive documentation.
|
|
54
|
+
|
|
53
55
|
:fire: The automated multi-agent chat framework in [autogen](https://microsoft.github.io/FLAML/docs/Use-Cases/Autogen) is in preview from v2.0.0.
|
|
54
56
|
|
|
55
57
|
:fire: FLAML is highlighted in OpenAI's [cookbook](https://github.com/openai/openai-cookbook#related-resources-from-around-the-web).
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
<br>
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
|
+
:fire: Heads-up: We're preparing to migrate [autogen](https://microsoft.github.io/FLAML/docs/Use-Cases/Autogen) into a dedicated github repository. Alongside this move, we'll also launch a dedicated Discord server and a website for comprehensive documentation.
|
|
18
|
+
|
|
17
19
|
:fire: The automated multi-agent chat framework in [autogen](https://microsoft.github.io/FLAML/docs/Use-Cases/Autogen) is in preview from v2.0.0.
|
|
18
20
|
|
|
19
21
|
:fire: FLAML is highlighted in OpenAI's [cookbook](https://github.com/openai/openai-cookbook#related-resources-from-around-the-web).
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
from .agent import Agent
|
|
2
|
-
from .
|
|
2
|
+
from .conversable_agent import ConversableAgent
|
|
3
3
|
from .assistant_agent import AssistantAgent
|
|
4
4
|
from .user_proxy_agent import UserProxyAgent
|
|
5
5
|
from .groupchat import GroupChat, GroupChatManager
|
|
6
6
|
|
|
7
7
|
__all__ = [
|
|
8
8
|
"Agent",
|
|
9
|
-
"
|
|
9
|
+
"ConversableAgent",
|
|
10
10
|
"AssistantAgent",
|
|
11
11
|
"UserProxyAgent",
|
|
12
12
|
"GroupChat",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
from .
|
|
1
|
+
from .conversable_agent import ConversableAgent
|
|
2
2
|
from typing import Callable, Dict, Optional, Union
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
class AssistantAgent(
|
|
5
|
+
class AssistantAgent(ConversableAgent):
|
|
6
6
|
"""(In preview) Assistant agent, designed to solve a task with LLM.
|
|
7
7
|
|
|
8
|
-
AssistantAgent is a subclass of
|
|
8
|
+
AssistantAgent is a subclass of ConversableAgent configured with a default system message.
|
|
9
9
|
The default system message is designed to solve a task with LLM,
|
|
10
10
|
including suggesting python code blocks and debugging.
|
|
11
11
|
`human_input_mode` is default to "NEVER"
|
|
@@ -52,7 +52,7 @@ Reply "TERMINATE" in the end when everything is done.
|
|
|
52
52
|
default to None (no limit provided, class attribute MAX_CONSECUTIVE_AUTO_REPLY will be used as the limit in this case).
|
|
53
53
|
The limit only plays a role when human_input_mode is not "ALWAYS".
|
|
54
54
|
**kwargs (dict): Please refer to other kwargs in
|
|
55
|
-
[
|
|
55
|
+
[ConversableAgent](conversable_agent#__init__).
|
|
56
56
|
"""
|
|
57
57
|
super().__init__(
|
|
58
58
|
name,
|
|
@@ -21,11 +21,11 @@ except ImportError:
|
|
|
21
21
|
return x
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
class
|
|
25
|
-
"""(
|
|
24
|
+
class ConversableAgent(Agent):
|
|
25
|
+
"""(In preview) A class for generic conversable agents which can be configured as assistant or user proxy.
|
|
26
26
|
|
|
27
27
|
After receiving each message, the agent will send a reply to the sender unless the msg is a termination msg.
|
|
28
|
-
For example, AssistantAgent and UserProxyAgent are subclasses of
|
|
28
|
+
For example, AssistantAgent and UserProxyAgent are subclasses of this class,
|
|
29
29
|
configured with different default settings.
|
|
30
30
|
|
|
31
31
|
To modify auto reply, override `generate_reply` method.
|
|
@@ -119,12 +119,12 @@ class ResponsiveAgent(Agent):
|
|
|
119
119
|
self._default_auto_reply = default_auto_reply
|
|
120
120
|
self._reply_func_list = []
|
|
121
121
|
self.reply_at_receive = defaultdict(bool)
|
|
122
|
-
self.
|
|
123
|
-
self.
|
|
124
|
-
self.
|
|
125
|
-
self.
|
|
122
|
+
self.register_reply([Agent, None], ConversableAgent.generate_oai_reply)
|
|
123
|
+
self.register_reply([Agent, None], ConversableAgent.generate_code_execution_reply)
|
|
124
|
+
self.register_reply([Agent, None], ConversableAgent.generate_function_call_reply)
|
|
125
|
+
self.register_reply([Agent, None], ConversableAgent.check_termination_and_human_reply)
|
|
126
126
|
|
|
127
|
-
def
|
|
127
|
+
def register_reply(
|
|
128
128
|
self,
|
|
129
129
|
trigger: Union[Type[Agent], str, Agent, Callable[[Agent], bool], List],
|
|
130
130
|
reply_func: Callable,
|
|
@@ -151,7 +151,7 @@ class ResponsiveAgent(Agent):
|
|
|
151
151
|
The function takes a recipient agent, a list of messages, a sender agent and a config as input and returns a reply message.
|
|
152
152
|
```python
|
|
153
153
|
def reply_func(
|
|
154
|
-
recipient:
|
|
154
|
+
recipient: ConversableAgent,
|
|
155
155
|
messages: Optional[List[Dict]] = None,
|
|
156
156
|
sender: Optional[Agent] = None,
|
|
157
157
|
config: Optional[Any] = None,
|
|
@@ -499,7 +499,7 @@ class ResponsiveAgent(Agent):
|
|
|
499
499
|
|
|
500
500
|
def initiate_chat(
|
|
501
501
|
self,
|
|
502
|
-
recipient: "
|
|
502
|
+
recipient: "ConversableAgent",
|
|
503
503
|
clear_history: Optional[bool] = True,
|
|
504
504
|
silent: Optional[bool] = False,
|
|
505
505
|
**context,
|
|
@@ -522,7 +522,7 @@ class ResponsiveAgent(Agent):
|
|
|
522
522
|
|
|
523
523
|
async def a_initiate_chat(
|
|
524
524
|
self,
|
|
525
|
-
recipient: "
|
|
525
|
+
recipient: "ConversableAgent",
|
|
526
526
|
clear_history: Optional[bool] = True,
|
|
527
527
|
silent: Optional[bool] = False,
|
|
528
528
|
**context,
|
|
@@ -611,7 +611,7 @@ class ResponsiveAgent(Agent):
|
|
|
611
611
|
if messages is None:
|
|
612
612
|
messages = self._oai_messages[sender]
|
|
613
613
|
last_n_messages = code_execution_config.pop("last_n_messages", 1)
|
|
614
|
-
for i in range(last_n_messages):
|
|
614
|
+
for i in range(min(len(messages), last_n_messages)):
|
|
615
615
|
message = messages[-(i + 1)]
|
|
616
616
|
code_blocks = extract_code(message["content"])
|
|
617
617
|
if len(code_blocks) == 1 and code_blocks[0][0] == UNKNOWN:
|
|
@@ -2,7 +2,7 @@ from dataclasses import dataclass
|
|
|
2
2
|
import sys
|
|
3
3
|
from typing import Dict, List, Optional, Union
|
|
4
4
|
from .agent import Agent
|
|
5
|
-
from .
|
|
5
|
+
from .conversable_agent import ConversableAgent
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
@dataclass
|
|
@@ -12,6 +12,7 @@ class GroupChat:
|
|
|
12
12
|
agents: List[Agent]
|
|
13
13
|
messages: List[Dict]
|
|
14
14
|
max_round: int = 10
|
|
15
|
+
admin_name: str = "Admin" # the name of the admin agent
|
|
15
16
|
|
|
16
17
|
@property
|
|
17
18
|
def agent_names(self) -> List[str]:
|
|
@@ -38,7 +39,7 @@ class GroupChat:
|
|
|
38
39
|
Read the following conversation.
|
|
39
40
|
Then select the next role from {self.agent_names} to play. Only return the role."""
|
|
40
41
|
|
|
41
|
-
def select_speaker(self, last_speaker: Agent, selector:
|
|
42
|
+
def select_speaker(self, last_speaker: Agent, selector: ConversableAgent):
|
|
42
43
|
"""Select the next speaker."""
|
|
43
44
|
selector.update_system_message(self.select_speaker_msg())
|
|
44
45
|
final, name = selector.generate_oai_reply(
|
|
@@ -62,7 +63,7 @@ Then select the next role from {self.agent_names} to play. Only return the role.
|
|
|
62
63
|
return "\n".join([f"{agent.name}: {agent.system_message}" for agent in self.agents])
|
|
63
64
|
|
|
64
65
|
|
|
65
|
-
class GroupChatManager(
|
|
66
|
+
class GroupChatManager(ConversableAgent):
|
|
66
67
|
"""(In preview) A chat manager agent that can manage a group chat of multiple agents."""
|
|
67
68
|
|
|
68
69
|
def __init__(
|
|
@@ -83,7 +84,7 @@ class GroupChatManager(ResponsiveAgent):
|
|
|
83
84
|
system_message=system_message,
|
|
84
85
|
**kwargs,
|
|
85
86
|
)
|
|
86
|
-
self.
|
|
87
|
+
self.register_reply(Agent, GroupChatManager.run_chat, config=groupchat, reset_config=GroupChat.reset)
|
|
87
88
|
# self._random = random.Random(seed)
|
|
88
89
|
|
|
89
90
|
def run_chat(
|
|
@@ -97,21 +98,36 @@ class GroupChatManager(ResponsiveAgent):
|
|
|
97
98
|
messages = self._oai_messages[sender]
|
|
98
99
|
message = messages[-1]
|
|
99
100
|
speaker = sender
|
|
100
|
-
|
|
101
|
+
groupchat = config
|
|
102
|
+
for i in range(groupchat.max_round):
|
|
101
103
|
# set the name to speaker's name if the role is not function
|
|
102
104
|
if message["role"] != "function":
|
|
103
105
|
message["name"] = speaker.name
|
|
104
|
-
|
|
106
|
+
groupchat.messages.append(message)
|
|
105
107
|
# broadcast the message to all agents except the speaker
|
|
106
|
-
for agent in
|
|
108
|
+
for agent in groupchat.agents:
|
|
107
109
|
if agent != speaker:
|
|
108
110
|
self.send(message, agent, request_reply=False, silent=True)
|
|
109
|
-
if i
|
|
110
|
-
#
|
|
111
|
-
|
|
111
|
+
if i == groupchat.max_round - 1:
|
|
112
|
+
# the last round
|
|
113
|
+
break
|
|
114
|
+
try:
|
|
115
|
+
# select the next speaker
|
|
116
|
+
speaker = groupchat.select_speaker(speaker, self)
|
|
117
|
+
# let the speaker speak
|
|
112
118
|
reply = speaker.generate_reply(sender=self)
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
119
|
+
except KeyboardInterrupt:
|
|
120
|
+
# let the admin agent speak if interrupted
|
|
121
|
+
if groupchat.admin_name in groupchat.agent_names:
|
|
122
|
+
# admin agent is one of the participants
|
|
123
|
+
speaker = groupchat.agent_by_name(groupchat.admin_name)
|
|
124
|
+
reply = speaker.generate_reply(sender=self)
|
|
125
|
+
else:
|
|
126
|
+
# admin agent is not found in the participants
|
|
127
|
+
raise
|
|
128
|
+
if reply is None:
|
|
129
|
+
break
|
|
130
|
+
# The speaker sends the message without requesting a reply
|
|
131
|
+
speaker.send(reply, self, request_reply=False)
|
|
132
|
+
message = self.last_message(speaker)
|
|
117
133
|
return True, None
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
from .
|
|
1
|
+
from .conversable_agent import ConversableAgent
|
|
2
2
|
from typing import Callable, Dict, Optional, Union
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
class UserProxyAgent(
|
|
5
|
+
class UserProxyAgent(ConversableAgent):
|
|
6
6
|
"""(In preview) A proxy agent for the user, that can execute code and provide feedback to the other agents.
|
|
7
7
|
|
|
8
|
-
UserProxyAgent is a subclass of
|
|
8
|
+
UserProxyAgent is a subclass of ConversableAgent configured with `human_input_mode` to ALWAYS
|
|
9
9
|
and `llm_config` to False. By default, the agent will prompt for human input every time a message is received.
|
|
10
10
|
Code execution is enabled by default. LLM-based auto reply is disabled by default.
|
|
11
|
-
To modify auto reply, register a method with (`
|
|
11
|
+
To modify auto reply, register a method with (`register_reply`)[conversable_agent#register_reply].
|
|
12
12
|
To modify the way to get human input, override `get_human_input` method.
|
|
13
13
|
To modify the way to execute code blocks, single code block, or function call, override `execute_code_blocks`,
|
|
14
14
|
`run_code`, and `execute_function` methods respectively.
|
|
@@ -48,6 +48,7 @@ class Completion(openai_Completion):
|
|
|
48
48
|
"gpt-3.5-turbo-0301", # deprecate in Sep
|
|
49
49
|
"gpt-3.5-turbo-0613",
|
|
50
50
|
"gpt-3.5-turbo-16k",
|
|
51
|
+
"gpt-3.5-turbo-16k-0613",
|
|
51
52
|
"gpt-35-turbo",
|
|
52
53
|
"gpt-4",
|
|
53
54
|
"gpt-4-32k",
|
|
@@ -70,6 +71,7 @@ class Completion(openai_Completion):
|
|
|
70
71
|
"gpt-3.5-turbo-0301": (0.0015, 0.002), # deprecate in Sep
|
|
71
72
|
"gpt-3.5-turbo-0613": (0.0015, 0.002),
|
|
72
73
|
"gpt-3.5-turbo-16k": (0.003, 0.004),
|
|
74
|
+
"gpt-3.5-turbo-16k-0613": (0.003, 0.004),
|
|
73
75
|
"gpt-35-turbo": 0.002,
|
|
74
76
|
"gpt-4": (0.03, 0.06),
|
|
75
77
|
"gpt-4-32k": (0.06, 0.12),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.1.0"
|
FLAML-2.0.2/flaml/version.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.0.2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|