A programming framework for agentic AI
doc and test update (#1053)
Chi Wangb90e9ee28390
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfileindex 040d7869d..3ebd9cba4 100644--- a/.devcontainer/Dockerfile+++ b/.devcontainer/Dockerfile@@ -17,7 +17,7 @@ RUN apt-get update \&& rm -rf /var/lib/apt/lists/*ENV DEBIAN_FRONTEND=dialog-RUN pip3 --disable-pip-version-check --no-cache-dir install flaml+# RUN pip3 --disable-pip-version-check --no-cache-dir install flaml# For docsRUN npm install --global yarnRUN pip install pydoc-markdown==4.5.0diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.jsonindex b01c3bbbe..cdef85c9d 100644--- a/.devcontainer/devcontainer.json+++ b/.devcontainer/devcontainer.json@@ -9,5 +9,5 @@},"terminal.integrated.defaultProfile.linux": "bash"},- "updateContentCommand": "pip install -e .[test,notebook] && pre-commit install"-}+ "updateContentCommand": "pip install -e .[test,notebook,openai] && pre-commit install"+}diff --git a/flaml/autogen/agent/chat_agent.py b/flaml/autogen/agent/chat_agent.pyindex a6d487a71..ec386f4c0 100644--- a/flaml/autogen/agent/chat_agent.py+++ b/flaml/autogen/agent/chat_agent.py@@ -4,8 +4,6 @@ from flaml import oaiclass ChatAgent(Agent):- """(Experimental) Chat."""-DEFAULT_SYSTEM_MESSAGE = """You are a chat agent."""@@ -13,16 +11,8 @@ class ChatAgent(Agent):"model": DEFAULT_MODEL,}- def __init__(self, name, system_message=DEFAULT_SYSTEM_MESSAGE, work_dir=None, **config):- """- Args:- name (str): agent name- system_message (str): system message to be sent to the agent- work_dir (str): working directory for the agent to execute code- config (dict): other configurations.- """+ def __init__(self, name, system_message=DEFAULT_SYSTEM_MESSAGE, **config):super().__init__(name, system_message)- self._work_dir = work_dirself._config = self.DEFAULT_CONFIG.copy()self._config.update(config)self._sender_dict = {}diff --git a/flaml/autogen/agent/user_proxy_agent.py b/flaml/autogen/agent/user_proxy_agent.pyindex 14e663ceb..b070484aa 100644--- a/flaml/autogen/agent/user_proxy_agent.py+++ b/flaml/autogen/agent/user_proxy_agent.py@@ -24,7 +24,7 @@ class UserProxyAgent(Agent):name (str): name of the agentsystem_message (str): system message to be sent to the agentwork_dir (str): working directory for the agent- human_input_mode (bool): whether to ask for human inputs every time a message is received.+ human_input_mode (str): whether to ask for human inputs every time a message is received.Possible values are "ALWAYS", "TERMINATE", "NEVER".(1) When "ALWAYS", the agent prompts for human input every time a message is received.Under this mode, the conversation stops when the human input is "exit",@@ -34,12 +34,12 @@ class UserProxyAgent(Agent):(3) When "NEVER", the agent will never prompt for human input. Under this mode, the conversation stopswhen the number of auto reply reaches the max_consecutive_auto_reply or or when is_termination_msg is True.max_consecutive_auto_reply (int): the maximum number of consecutive auto replies.- default: None (no limit provided, class attribute MAX_CONSECUTIVE_AUTO_REPLY will be used as the limit in this case).+ 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".is_termination_msg (function): a function that takes a message and returns a boolean value.This function is used to determine if a received message is a termination message.- config (dict): other configurations.-+ use_docker (bool): whether to use docker to execute the code.+ **config (dict): other configurations."""super().__init__(name, system_message)self._work_dir = work_dirdiff --git a/test/autogen/test_user_proxy_agent.py b/test/autogen/test_user_proxy_agent.pyindex d750bcf93..6a4c78a9c 100644--- a/test/autogen/test_user_proxy_agent.py+++ b/test/autogen/test_user_proxy_agent.py@@ -3,7 +3,7 @@ from flaml import oaiKEY_LOC = "test/autogen"-def test_human_agent():+def test_user_proxy_agent():try:import openaiexcept ImportError:@@ -29,4 +29,4 @@ def test_human_agent():if __name__ == "__main__":- test_human_agent()+ test_user_proxy_agent()