Skip to content

Commit

Permalink
doc and test update (microsoft#1053)
Browse files Browse the repository at this point in the history
* doc and test update

* docker update
  • Loading branch information
sonichi authored May 26, 2023
1 parent 122d218 commit 62c8a3e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 docs
RUN npm install --global yarn
RUN pip install pydoc-markdown==4.5.0
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
12 changes: 1 addition & 11 deletions flaml/autogen/agent/chat_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,15 @@


class ChatAgent(Agent):
"""(Experimental) Chat."""

DEFAULT_SYSTEM_MESSAGE = """You are a chat agent.
"""

DEFAULT_CONFIG = {
"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_dir
self._config = self.DEFAULT_CONFIG.copy()
self._config.update(config)
self._sender_dict = {}
Expand Down
8 changes: 4 additions & 4 deletions flaml/autogen/agent/user_proxy_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(
name (str): name of the agent
system_message (str): system message to be sent to the agent
work_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",
Expand All @@ -34,12 +34,12 @@ def __init__(
(3) When "NEVER", the agent will never prompt for human input. Under this mode, the conversation stops
when 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_dir
Expand Down
4 changes: 2 additions & 2 deletions test/autogen/test_user_proxy_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
KEY_LOC = "test/autogen"


def test_human_agent():
def test_user_proxy_agent():
try:
import openai
except ImportError:
Expand All @@ -29,4 +29,4 @@ def test_human_agent():


if __name__ == "__main__":
test_human_agent()
test_user_proxy_agent()

0 comments on commit 62c8a3e

Please sign in to comment.