From eabe887a5d3a74a3dbec7ff82a4240e101bd90cf Mon Sep 17 00:00:00 2001 From: olgavrou Date: Thu, 2 Nov 2023 21:40:48 -0400 Subject: [PATCH 1/3] experiment with adding learn to pick agent --- .../agentchat/contrib/learn_to_pick_agent.py | 121 ++++++ .../agentchat_groupchat_w_ltp_agent.ipynb | 356 ++++++++++++++++++ notebook/learn_to_pick_agent.ipynb | 160 ++++++++ setup.py | 1 + 4 files changed, 638 insertions(+) create mode 100644 autogen/agentchat/contrib/learn_to_pick_agent.py create mode 100644 notebook/agentchat_groupchat_w_ltp_agent.ipynb create mode 100644 notebook/learn_to_pick_agent.ipynb diff --git a/autogen/agentchat/contrib/learn_to_pick_agent.py b/autogen/agentchat/contrib/learn_to_pick_agent.py new file mode 100644 index 000000000000..b837abc99bf3 --- /dev/null +++ b/autogen/agentchat/contrib/learn_to_pick_agent.py @@ -0,0 +1,121 @@ +from autogen.agentchat.agent import Agent +from autogen.agentchat.assistant_agent import ConversableAgent +from typing import Callable, Dict, Optional, Union, List, Tuple, Any +import learn_to_pick + + +try: + from termcolor import colored +except ImportError: + + def colored(x, *args, **kwargs): + return x + + +class LearnToPickAgent(ConversableAgent): + """An agent that learns to pick the best response from a set of candidates.""" + + ToSelectFrom = learn_to_pick.ToSelectFrom + ToSelectFromType = learn_to_pick.base._ToSelectFrom + BasedOn = learn_to_pick.BasedOn + BasedOnType = learn_to_pick.base._BasedOn + + def __init__( + self, + name="learntopickagent", + system_message: Optional[ + str + ] = "You are a helpful AI assistant that remembers user teachings from prior chats.", + human_input_mode: Optional[str] = "NEVER", + llm_config: Optional[Union[Dict, bool]] = None, + learn_to_pick_config: Optional[Dict] = None, + **kwargs, + ): + """ + Args: + name (str): name of the agent. + system_message (str): system message for the ChatCompletion inference. + human_input_mode (str): This agent should NEVER prompt the human for input. + llm_config (dict or False): llm inference configuration. + Please refer to [Completion.create](/docs/reference/oai/completion#create) + for available options. + To disable llm-based auto reply, set to False. + learn_to_pick_config (dict or None): Additional parameters used by LearnToPickAgent. + To use default config, set to None. Otherwise, set to a dictionary with any of the following keys: + - TBD + **kwargs (dict): other kwargs in [ConversableAgent](../conversable_agent#__init__). + """ + super().__init__( + name=name, + system_message=system_message, + human_input_mode=human_input_mode, + llm_config=llm_config, + **kwargs, + ) + # Register a custom reply function. + self.register_reply(Agent, LearnToPickAgent._generate_ltp_assistant_reply, 1) + + # Assemble the parameter settings. + self._learn_to_pick_config = {} if learn_to_pick_config is None else learn_to_pick_config + self.verbosity = self._learn_to_pick_config.get("verbosity", 0) + self.reset_model = self._learn_to_pick_config.get("reset_model", False) + self.path_to_model = self._learn_to_pick_config.get("path_to_model", "./tmp/learn_to_pick_agent_model") + + # Create the rl component + self._pick_best = learn_to_pick.PickBest.create(**self._learn_to_pick_config) + + def close(self): + """Save the model.""" + self._pick_best.save_progress() + + def _generate_ltp_assistant_reply( + self, + messages: Optional[List[Dict]] = None, + sender: Optional[Agent] = None, + config: Optional[Any] = None, # Persistent state. + ) -> Tuple[bool, Union[str, Dict, None]]: + """ + """ + if messages is None: + messages = self._oai_messages[sender] # In case of a direct call. + + # Get the last user turn. + def _handle_message(message): + import json + + # If last_message is a string, attempt to parse it as JSON + if isinstance(message, str): + message = json.loads(message) + + # Normalize the input to the format {name: option_list/criteria_list} + normalized_input = message.copy() + + if 'to_select_from' in message and 'based_on' in message: + # Handle the first format + if "name" in message['to_select_from'] and "name" in message['based_on']: + normalized_input[message['to_select_from']['name']] = LearnToPickAgent.ToSelectFrom(message['to_select_from']['options']) + normalized_input[message['based_on']['name']] = LearnToPickAgent.BasedOn(message['based_on']['options']) + else: + # Handle the second format + normalized_input['to_select_from'] = LearnToPickAgent.ToSelectFrom(message['to_select_from']) + normalized_input['based_on'] = LearnToPickAgent.BasedOn(message['based_on']) + # Handle the third format (with instantiated objects) + else: + for key, value in message.items(): + if isinstance(value, LearnToPickAgent.ToSelectFromType): + normalized_input[key] = value + elif isinstance(value, LearnToPickAgent.BasedOnType): + normalized_input[key] = value + + return normalized_input + + last_message = messages[-1]['content'] + input = _handle_message(last_message) + + picked = self._pick_best.run(**input) + + return True, {'content': picked} + + def learn_from_user_feedback(self, score: float, response: Dict[str, Any]): + """""" + self._pick_best.update_with_delayed_score(score, response) diff --git a/notebook/agentchat_groupchat_w_ltp_agent.ipynb b/notebook/agentchat_groupchat_w_ltp_agent.ipynb new file mode 100644 index 000000000000..779d5a108d3c --- /dev/null +++ b/notebook/agentchat_groupchat_w_ltp_agent.ipynb @@ -0,0 +1,356 @@ +{ + "cells": [ + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\"Open" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Auto Generated Agent Chat: Group Chat\n", + "\n", + "AutoGen offers conversable agents powered by LLM, tool or human, which can be used to perform tasks collectively via automated chat. This framework allows tool use and human participation through multi-agent conversation.\n", + "Please find documentation about this feature [here](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat).\n", + "\n", + "This notebook is modified based on https://github.com/microsoft/FLAML/blob/4ea686af5c3e8ff24d9076a7a626c8b28ab5b1d7/notebook/autogen_multiagent_roleplay_chat.ipynb\n", + "\n", + "## Requirements\n", + "\n", + "AutoGen requires `Python>=3.8`. To run this notebook example, please install:\n", + "```bash\n", + "pip install pyautogen\n", + "```" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%%capture --no-stderr\n", + "# %pip install pyautogen~=0.1.0" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# ! pip install learn-to-pick" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Set your API Endpoint\n", + "\n", + "The [`config_list_from_json`](https://microsoft.github.io/autogen/docs/reference/oai/openai_utils#config_list_from_json) function loads a list of configurations from an environment variable or a json file." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# To capture the new agent during dev\n", + "import sys\n", + "sys.path.append(\"../\")\n", + "import autogen\n", + "\n", + "config_list_gpt4 = autogen.config_list_from_json(\n", + " \"OAI_CONFIG_LIST\",\n", + " file_location=\"..\",\n", + " filter_dict={\n", + " \"model\": [\"gpt-4\", \"gpt-4-0314\", \"gpt4\", \"gpt-4-32k\", \"gpt-4-32k-0314\", \"gpt-4-32k-v0314\"],\n", + " },\n", + ")\n", + "# config_list_gpt35 = autogen.config_list_from_json(\n", + "# \"OAI_CONFIG_LIST\",\n", + "# filter_dict={\n", + "# \"model\": {\n", + "# \"gpt-3.5-turbo\",\n", + "# \"gpt-3.5-turbo-16k\",\n", + "# \"gpt-3.5-turbo-0301\",\n", + "# \"chatgpt-35-turbo-0301\",\n", + "# \"gpt-35-turbo-v0301\",\n", + "# },\n", + "# },\n", + "# )" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "It first looks for environment variable \"OAI_CONFIG_LIST\" which needs to be a valid json string. If that variable is not found, it then looks for a json file named \"OAI_CONFIG_LIST\". It filters the configs by models (you can filter by other keys as well). Only the gpt-4 models are kept in the list based on the filter condition.\n", + "\n", + "The config list looks like the following:\n", + "```python\n", + "config_list = [\n", + " {\n", + " 'model': 'gpt-4',\n", + " 'api_key': '',\n", + " },\n", + " {\n", + " 'model': 'gpt-4',\n", + " 'api_key': '',\n", + " 'api_base': '',\n", + " 'api_type': 'azure',\n", + " 'api_version': '2023-06-01-preview',\n", + " },\n", + " {\n", + " 'model': 'gpt-4-32k',\n", + " 'api_key': '',\n", + " 'api_base': '',\n", + " 'api_type': 'azure',\n", + " 'api_version': '2023-06-01-preview',\n", + " },\n", + "]\n", + "```\n", + "\n", + "If you open this notebook in colab, you can upload your files by clicking the file icon on the left panel and then choose \"upload file\" icon.\n", + "\n", + "You can set the value of config_list in other ways you prefer, e.g., loading from a YAML file." + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Construct Agents" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "llm_config = {\"config_list\": config_list_gpt4, \"seed\": 42}\n", + "user_proxy = autogen.UserProxyAgent(\n", + " name=\"User_proxy\",\n", + " system_message=\"A human admin.\",\n", + " code_execution_config={\"last_n_messages\": 2, \"work_dir\": \"groupchat\"},\n", + " human_input_mode=\"TERMINATE\"\n", + ")\n", + "coder = autogen.AssistantAgent(\n", + " name=\"Coder\",\n", + " llm_config=llm_config,\n", + ")\n", + "pm = autogen.AssistantAgent(\n", + " name=\"Product_manager\",\n", + " system_message=\"Creative in software product ideas.\",\n", + " llm_config=llm_config,\n", + ")\n", + "groupchat = autogen.GroupChat(agents=[user_proxy, coder, pm], messages=[], max_round=12)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from autogen import oai\n", + "\n", + "class autogen_llm_call:\n", + " def __init__(self, config_list):\n", + " self.config_list = config_list\n", + " def predict(self, message):\n", + " response = oai.ChatCompletion.create(\n", + " config_list=self.config_list,\n", + " prompt=message,\n", + " )\n", + " return oai.ChatCompletion.extract_text(response)[0]\n", + "\n", + "autogen_llm_call(config_list=config_list_gpt4).predict(\"Hello, how are you?\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import sys\n", + "sys.path.append(\"../\")\n", + "from autogen.agentchat.contrib.learn_to_pick_agent import LearnToPickAgent\n", + "import learn_to_pick\n", + "\n", + "# scoring_criteria_template = \"\"\"Given message history: \"{message_history}\", the previously selected agent: \"{last_speaker}\" and the agents that could answer this message: \"{agent}\" rank how good or bad this agent selection is: \"{picked}\" \"\"\"\n", + "\n", + "ltp_config = {\n", + " # \"selection_scorer\": learn_to_pick.AutoSelectionScorer(llm=autogen_llm_call(config_list=config_list_gpt4), scoring_criteria_template_str=scoring_criteria_template)\n", + " \"selection_scorer\": None,\n", + "}\n", + "\n", + "ltp_agent = LearnToPickAgent(\n", + " llm_config=llm_config,\n", + " learn_to_pick_config=ltp_config,)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# hacky way to set the agent\n", + "groupchat.ltp_agent = ltp_agent\n", + "groupchat.previous_select_speaker_func = groupchat.select_speaker" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def custom_select_speaker(self, last_speaker: autogen.Agent, selector: autogen.ConversableAgent):\n", + " \n", + " # NOTE: Use with custom selection scorer set to AutoSelectionScorer (in config above)\n", + "\n", + " # The goal here is to demonstrate the usage of ltp agent in the role of the\n", + " # deciding which agent needs to go next\n", + "\n", + " agent_desc = [{\"name\": agent.name, \"desc\": agent.system_message} for agent in self.agents]\n", + " \n", + " # TODO: Embed here should be exposed through LearnToPickAgent and not need to use\n", + " # learn_to_pick directly\n", + " msg = {\n", + " \"content\": {\n", + " \"agent\": learn_to_pick.Embed(LearnToPickAgent.ToSelectFrom(agent_desc)),\n", + " \"message\": learn_to_pick.Embed(LearnToPickAgent.BasedOn(self.messages[-1][\"content\"])),\n", + " \"last_speaker\": LearnToPickAgent.BasedOn(last_speaker.name),\n", + " \"message_history\": self.messages,\n", + " }\n", + " }\n", + " self.ltp_agent.receive(message=msg, sender=ltp_agent, request_reply=True, silent=True)\n", + " reply = list(ltp_agent.chat_messages.values())[-1][-1][\"content\"]\n", + " if \"picked\" in reply:\n", + " agent_name = reply[\"picked\"][\"agent\"][\"name\"]\n", + " print(f\"agent name picked: --{agent_name}--\")\n", + " try:\n", + " return self.agent_by_name(str(agent_name))\n", + " except ValueError as e:\n", + " print(f\"agent does not exist? got ValueError: {agent_name}, error: {e}\")\n", + " return self.next_agent(last_speaker, agents)\n", + " else:\n", + " print(f\"no agent picked, problem with calling ltp agent?\")\n", + " return self.next_agent(last_speaker, agents)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def custom_select_speaker_warm_start(self, last_speaker: autogen.Agent, selector: autogen.ConversableAgent):\n", + " \n", + " # NOTE: Use with selection_scorer set to None in the config\n", + " # The goal here is to demonstrate that the ltp agent is learning \"warm start\" from what\n", + " # AutoGen GroupChat manager is doing\n", + " # Can save progress and resume (not demonstrated below, not sure I exposed that in the agent yet)\n", + "\n", + " # What did the group manager pick?\n", + " group_chat_agent_selection = self.previous_select_speaker_func(last_speaker, selector)\n", + " \n", + " agent_desc = [{\"name\": agent.name, \"desc\": agent.system_message} for agent in self.agents]\n", + " msg = {\n", + " \"content\": {\n", + " \"agent\": learn_to_pick.Embed(LearnToPickAgent.ToSelectFrom(agent_desc)),\n", + " \"message\": learn_to_pick.Embed(LearnToPickAgent.BasedOn(self.messages[-1][\"content\"])),\n", + " \"last_speaker\": LearnToPickAgent.BasedOn(last_speaker.name),\n", + " \"message_history\": self.messages,\n", + " }\n", + " }\n", + " self.ltp_agent.receive(message=msg, sender=ltp_agent, request_reply=True, silent=True)\n", + " ltp_reply = list(ltp_agent.chat_messages.values())[-1][-1][\"content\"]\n", + " if \"picked\" in ltp_reply:\n", + " ltp_agent_name = ltp_reply[\"picked\"][\"agent\"][\"name\"]\n", + " print(f\"agent name picked by ltp agent: --{ltp_agent_name}--\")\n", + " \n", + " if group_chat_agent_selection.name == ltp_agent_name:\n", + " ltp_agent.learn_from_user_feedback(1.0, ltp_reply)\n", + " else:\n", + " # -1 or 0.0 here?\n", + " ltp_agent.learn_from_user_feedback(0.0, ltp_reply)\n", + " \n", + " return group_chat_agent_selection" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# groupchat.select_speaker = custom_select_speaker.__get__(groupchat)\n", + "groupchat.select_speaker = custom_select_speaker_warm_start.__get__(groupchat)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "manager = autogen.GroupChatManager(groupchat=groupchat, llm_config=llm_config)" + ] + }, + { + "attachments": {}, + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Start Chat" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "user_proxy.initiate_chat(manager, message=\"Find a latest paper about gpt-4 on arxiv and find its potential applications in software.\")\n", + "# type exit to terminate the chat" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "flaml", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.5" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/notebook/learn_to_pick_agent.ipynb b/notebook/learn_to_pick_agent.ipynb new file mode 100644 index 000000000000..5fad9b72d06a --- /dev/null +++ b/notebook/learn_to_pick_agent.ipynb @@ -0,0 +1,160 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [], + "source": [ + "# ! pip install learn-to-pick" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [], + "source": [ + "# To capture the new agent during dev\n", + "import sys\n", + "\n", + "sys.path.append(\"../\")\n", + "\n", + "from autogen import UserProxyAgent\n", + "from autogen import AssistantAgent, UserProxyAgent, config_list_from_json\n", + "import learn_to_pick\n", + "import autogen\n", + "\n", + "autogen.ChatCompletion.start_logging()\n", + "\n", + "config_list = config_list_from_json(env_or_file=\"OAI_CONFIG_LIST\", file_location=\"..\")\n", + "llm_config = {\n", + " \"request_timeout\": 60,\n", + " \"config_list\": config_list,\n", + " \"use_cache\": True, # Use False to explore LLM non-determinism.\n", + "}" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "2023-11-02 21:11:47,288 - learn_to_pick.base - WARNING - No selection scorer provided, which means that no reinforcement learning will be done in the RL chain unless update_with_delayed_score is called.\n" + ] + } + ], + "source": [ + "from autogen.agentchat.contrib.learn_to_pick_agent import LearnToPickAgent\n", + "\n", + "ltp_config = {\n", + " \"selection_scorer\": None,\n", + "}\n", + "\n", + "ltp_agent = LearnToPickAgent(\n", + " llm_config=llm_config,\n", + " learn_to_pick_config=ltp_config,)" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "user = UserProxyAgent(\n", + " name=\"user\",\n", + " human_input_mode=\"NEVER\",\n", + " is_termination_msg=lambda x: True if \"TERMINATE\" in x.get(\"content\") else False,\n", + " max_consecutive_auto_reply=0,\n", + ")" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[33muser\u001b[0m (to learntopickagent):\n", + "\n", + "{'meal': ['Beef', 'Chicken', 'Veggie'], 'user': ['Meat eater', 'loves beef']}\n", + "\n", + "--------------------------------------------------------------------------------\n", + "\u001b[33mlearntopickagent\u001b[0m (to user):\n", + "\n", + "{'picked': {'meal': 'Chicken'}, 'picked_metadata': }\n", + "\n", + "--------------------------------------------------------------------------------\n", + "{'meal': ['Beef', 'Chicken', 'Veggie'], 'user': ['Meat eater', 'loves beef']}\n", + "\n", + "--------------------------------------------------------------------------------\n", + "\u001b[33mlearntopickagent\u001b[0m (to user):\n", + "\n", + "{'picked': {'meal': 'Chicken'}, 'picked_metadata': }\n", + "\n", + "--------------------------------------------------------------------------------\n" + ] + } + ], + "source": [ + "# experimenting with different ways to shape the input\n", + "# all three below currently accepted\n", + "\n", + "msg = {'content': {\"to_select_from\": {\"name\": \"meal\", \"options\": [\"Beef\", \"Chicken\", \"Veggie\"]}, \"based_on\": {\"name\": \"user\", \"options\": [\"Meat eater\", \"loves beef\"]}}}\n", + "msg = {'content': {\"to_select_from\": [\"Beef\", \"Chicken\", \"Veggie\"], \"based_on\": [\"Meat eater\", \"loves beef\"]}}\n", + "msg = {'content': {\"meal\": LearnToPickAgent.ToSelectFrom([\"Beef\", \"Chicken\", \"Veggie\"]), \"user\": LearnToPickAgent.BasedOn([\"Meat eater\", \"loves beef\"])}}\n", + "\n", + "user.initiate_chat(ltp_agent, message=msg)" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [], + "source": [ + "ltp_response = list(user.chat_messages.values())[0][1][\"content\"]" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [], + "source": [ + "# eval ltp_response and define score\n", + "dummy_score = 1.0\n", + "ltp_agent.learn_from_user_feedback(dummy_score, ltp_response)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.5" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/setup.py b/setup.py index d3308bf1ccc6..55cda0591365 100644 --- a/setup.py +++ b/setup.py @@ -59,6 +59,7 @@ "mathchat": ["sympy", "pydantic==1.10.9", "wolframalpha"], "retrievechat": ["chromadb", "tiktoken", "sentence_transformers", "pypdf", "ipython"], "teachable": ["chromadb"], + "learn_to_pick": ["learn-to-pick"], }, classifiers=[ "Programming Language :: Python :: 3", From b917e95f719d0bba96e91bdbd7c6b9d533d324ba Mon Sep 17 00:00:00 2001 From: olgavrou Date: Thu, 2 Nov 2023 21:55:26 -0400 Subject: [PATCH 2/3] lock learn to pick version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 55cda0591365..97f69c8e9923 100644 --- a/setup.py +++ b/setup.py @@ -59,7 +59,7 @@ "mathchat": ["sympy", "pydantic==1.10.9", "wolframalpha"], "retrievechat": ["chromadb", "tiktoken", "sentence_transformers", "pypdf", "ipython"], "teachable": ["chromadb"], - "learn_to_pick": ["learn-to-pick"], + "learn_to_pick": ["learn-to-pick==0.0.3"], }, classifiers=[ "Programming Language :: Python :: 3", From c9e3b4d37f8d1332d22ef828092193143ccbd1aa Mon Sep 17 00:00:00 2001 From: olgavrou Date: Thu, 2 Nov 2023 22:03:51 -0400 Subject: [PATCH 3/3] fix system message --- autogen/agentchat/contrib/learn_to_pick_agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen/agentchat/contrib/learn_to_pick_agent.py b/autogen/agentchat/contrib/learn_to_pick_agent.py index b837abc99bf3..f8163a66840a 100644 --- a/autogen/agentchat/contrib/learn_to_pick_agent.py +++ b/autogen/agentchat/contrib/learn_to_pick_agent.py @@ -25,7 +25,7 @@ def __init__( name="learntopickagent", system_message: Optional[ str - ] = "You are a helpful AI assistant that remembers user teachings from prior chats.", + ] = "You are a helpful AI assistant.", human_input_mode: Optional[str] = "NEVER", llm_config: Optional[Union[Dict, bool]] = None, learn_to_pick_config: Optional[Dict] = None,