Skip to content

Commit

Permalink
Update configs.
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoLjl committed Nov 21, 2024
1 parent daeb0c5 commit 34ab863
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion autogen/agentchat/contrib/captainagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def __init__(
human_input_mode: Optional[str] = "NEVER",
code_execution_config: Optional[Union[Dict, Literal[False]]] = False,
nested_config: Optional[Dict] = None,
agent_config_save_path: Optional[str] = None,
description: Optional[str] = DEFAULT_DESCRIPTION,
**kwargs,
):
Expand All @@ -154,6 +155,9 @@ def __init__(
max_consecutive_auto_reply (int): the maximum number of consecutive auto replies.
default to None (no limit provided, class attribute MAX_CONSECUTIVE_AUTO_REPLY will be used as the limit in this case).
The limit only plays a role when human_input_mode is not "ALWAYS".
nested_config (dict): the configuration for the nested chat instantiated by CaptainAgent.
A full list of keys and their functionalities can be found in [docs](https://ag2ai.github.io/ag2/docs/topics/captainagent/configurations).
agent_config_save_path (str): the path to save the generated or retrieved agent configuration.
**kwargs (dict): Please refer to other kwargs in
[ConversableAgent](https://github.com/ag2ai/ag2/blob/main/autogen/agentchat/conversable_agent.py#L74).
"""
Expand All @@ -178,13 +182,15 @@ def __init__(
name="CaptainAgent",
system_message=system_message,
llm_config=llm_config,
agent_config_save_path=agent_config_save_path,
)
self.assistant.update_tool_signature(self.AUTOBUILD_TOOL, is_remove=False)

self.executor = CaptainUserProxyAgent(
name="Expert_summoner",
code_execution_config=code_execution_config,
nested_config=nested_config,
is_termination_msg=lambda x: x.get("content", "") and "terminate" in x.get("content", "").lower(),
human_input_mode="NEVER",
)

Expand All @@ -201,7 +207,6 @@ def __init__(
}
],
trigger=UserProxyAgent,
# reply_func_from_nested_chats=None,
position=0,
)

Expand Down

0 comments on commit 34ab863

Please sign in to comment.