Skip to content

Commit

Permalink
Remove space from name -> teachableagent
Browse files Browse the repository at this point in the history
  • Loading branch information
rickyloynd-microsoft committed Oct 21, 2023
1 parent ff4a369 commit f962f45
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 29 deletions.
5 changes: 3 additions & 2 deletions autogen/agentchat/contrib/teachable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ def colored(x, *args, **kwargs):

class TeachableAgent(ConversableAgent):
"""Teachable Agent, a subclass of ConversableAgent using a vector database to remember user teachings.
In this class, the term 'user' refers to any caller (human or not) sending messages to this agent."""
In this class, the term 'user' refers to any caller (human or not) sending messages to this agent.
Not yet tested in the group-chat setting."""

def __init__(
self,
name="teachable agent",
name="teachableagent",
system_message: Optional[
str
] = "You are a helpful AI assistant that remembers user teachings from prior chats.",
Expand Down
50 changes: 25 additions & 25 deletions notebook/agentchat_teachability.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"autogen.ChatCompletion.start_logging()\n",
"\n",
"teachable_agent = TeachableAgent(\n",
" name=\"teachable agent\",\n",
" name=\"teachableagent\",\n",
" llm_config=llm_config,\n",
" teach_config=teach_config)\n",
"\n",
Expand Down Expand Up @@ -194,12 +194,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33muser\u001b[0m (to teachable agent):\n",
"\u001b[33muser\u001b[0m (to teachableagent):\n",
"\n",
"What is the Vicuna model?\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[33mteachable agent\u001b[0m (to user):\n",
"\u001b[33mteachableagent\u001b[0m (to user):\n",
"\n",
"I'm sorry, but I don't have information about the \"Vicuna model\" in my current database. Could you please provide some context, description, or details about this model so I can better assist you?\n",
"\n",
Expand All @@ -221,12 +221,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33muser\u001b[0m (to teachable agent):\n",
"\u001b[33muser\u001b[0m (to teachableagent):\n",
"\n",
"Vicuna is a 13B-parameter language model released by Meta.\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[33mteachable agent\u001b[0m (to user):\n",
"\u001b[33mteachableagent\u001b[0m (to user):\n",
"\n",
"Thank you for providing the information. The Vicuna model is a large-scale language model developed by Meta. It consists of 13 billion parameters, which is what makes it able to understand and generate human-like text across various topics. Parameters in a neural network are the weights and biases assigned to each connection between the neurons, and having more parameters enables the model to learn and capture more complex patterns and relationships in data. As an AI language model, Vicuna can be utilized in various language-related tasks, such as text completion, translation, summarization, and more.\n",
"\n",
Expand All @@ -248,12 +248,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33muser\u001b[0m (to teachable agent):\n",
"\u001b[33muser\u001b[0m (to teachableagent):\n",
"\n",
"What is the Orca model?\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[33mteachable agent\u001b[0m (to user):\n",
"\u001b[33mteachableagent\u001b[0m (to user):\n",
"\n",
"The Orca model is a yet-to-be-released language model by Meta, referring to the Research Preview API release of Meta's advanced language model. While I don't have specific details about the Orca model at this time, it is expected that the model would have an even larger number of parameters to further enhance its capabilities compared to its predecessor, Vicuna.\n",
"\n",
Expand All @@ -277,12 +277,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33muser\u001b[0m (to teachable agent):\n",
"\u001b[33muser\u001b[0m (to teachableagent):\n",
"\n",
"Orca is a 13B-parameter language model released by Microsoft. It outperforms Vicuna on most tasks.\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[33mteachable agent\u001b[0m (to user):\n",
"\u001b[33mteachableagent\u001b[0m (to user):\n",
"\n",
"Thank you for the clarification. Orca is a 13-billion-parameter language model developed by Microsoft. It is designed to outperform Vicuna, the language model released by Meta. With a large number of parameters, Orca is capable of understanding and generating human-like text across diverse subjects, making it highly useful in various applications.\n",
"\n",
Expand Down Expand Up @@ -338,12 +338,12 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33muser\u001b[0m (to teachable agent):\n",
"\u001b[33muser\u001b[0m (to teachableagent):\n",
"\n",
"How does the Vicuna model compare to the Orca model?\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[33mteachable agent\u001b[0m (to user):\n",
"\u001b[33mteachableagent\u001b[0m (to user):\n",
"\n",
"The Vicuna and Orca models are both 13B-parameter language models released by Meta and Microsoft, respectively. In terms of performance, Orca has been reported to outperform Vicuna on most tasks. However, without detailed information about specific tasks and benchmarks, it is difficult to provide a more comprehensive comparison. Generally speaking, both models are advanced language models that aim to provide high-quality natural language understanding and generation, but Orca appears to have an edge in terms of overall performance.\n",
"\n",
Expand Down Expand Up @@ -373,7 +373,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33muser\u001b[0m (to teachable agent):\n",
"\u001b[33muser\u001b[0m (to teachableagent):\n",
"\n",
"Please summarize this abstract.\n",
"\n",
Expand All @@ -383,7 +383,7 @@
"\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[33mteachable agent\u001b[0m (to user):\n",
"\u001b[33mteachableagent\u001b[0m (to user):\n",
"\n",
"AutoGen is an open-source framework designed to enable developers to create LLM applications with multiple customizable agents that can converse with each other to complete tasks. These agents can operate using different combinations of LLMs, human inputs, and tools, allowing developers to define agent interaction behaviors flexibly. AutoGen supports programming flexible conversation patterns using both natural language and code, making it suitable for building diverse applications with varying complexities and LLM capacities. Its effectiveness has been demonstrated through empirical studies across various domains including mathematics, coding, operations research, decision-making, and entertainment.\n",
"\n",
Expand Down Expand Up @@ -417,7 +417,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33muser\u001b[0m (to teachable agent):\n",
"\u001b[33muser\u001b[0m (to teachableagent):\n",
"\n",
"Please summarize this abstract. \n",
"When I'm summarizing an abstract, I try to make the summary contain just three short bullet points: the title, the innovation, and the key empirical results.\n",
Expand All @@ -428,7 +428,7 @@
"\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[33mteachable agent\u001b[0m (to user):\n",
"\u001b[33mteachableagent\u001b[0m (to user):\n",
"\n",
"- Title: AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation\n",
"- Innovation: Open-source framework for creating customizable LLM applications through agent conversations, supporting various modes and interaction behaviors.\n",
Expand Down Expand Up @@ -467,7 +467,7 @@
"text": [
"\u001b[93m\n",
"REVIEWING CHAT FOR USER TEACHINGS TO REMEMBER\u001b[0m\n",
"\u001b[33muser\u001b[0m (to teachable agent):\n",
"\u001b[33muser\u001b[0m (to teachableagent):\n",
"\n",
"Please summarize this abstract.\n",
"\n",
Expand All @@ -476,7 +476,7 @@
"Artificial intelligence (AI) researchers have been developing and refining large language models (LLMs) that exhibit remarkable capabilities across a variety of domains and tasks, challenging our understanding of learning and cognition. The latest model developed by OpenAI, GPT-4, was trained using an unprecedented scale of compute and data. In this paper, we report on our investigation of an early version of GPT-4, when it was still in active development by OpenAI. We contend that (this early version of) GPT-4 is part of a new cohort of LLMs (along with ChatGPT and Google's PaLM for example) that exhibit more general intelligence than previous AI models. We discuss the rising capabilities and implications of these models. We demonstrate that, beyond its mastery of language, GPT-4 can solve novel and difficult tasks that span mathematics, coding, vision, medicine, law, psychology and more, without needing any special prompting. Moreover, in all of these tasks, GPT-4's performance is strikingly close to human-level performance, and often vastly surpasses prior models such as ChatGPT. Given the breadth and depth of GPT-4's capabilities, we believe that it could reasonably be viewed as an early (yet still incomplete) version of an artificial general intelligence (AGI) system. In our exploration of GPT-4, we put special emphasis on discovering its limitations, and we discuss the challenges ahead for advancing towards deeper and more comprehensive versions of AGI, including the possible need for pursuing a new paradigm that moves beyond next-word prediction. We conclude with reflections on societal influences of the recent technological leap and future research directions.\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[33mteachable agent\u001b[0m (to user):\n",
"\u001b[33mteachableagent\u001b[0m (to user):\n",
"\n",
"- Title: Sparks of Artificial General Intelligence: Early experiments with GPT-4\n",
"- Innovation: GPT-4, an LLM with remarkable capabilities, demonstrates human-level performance across various domains, like math, coding, vision, medicine, law, and psychology.\n",
Expand Down Expand Up @@ -516,7 +516,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33muser\u001b[0m (to teachable agent):\n",
"\u001b[33muser\u001b[0m (to teachableagent):\n",
"\n",
"Consider the identity: \n",
"9 * 4 + 6 * 6 = 72\n",
Expand All @@ -525,7 +525,7 @@
"\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[33mteachable agent\u001b[0m (to user):\n",
"\u001b[33mteachableagent\u001b[0m (to user):\n",
"\n",
"Step 1: Identify the current equation and the target value on the right-hand side.\n",
"Current equation: 9 * 4 + 6 * 6 = 72\n",
Expand Down Expand Up @@ -572,7 +572,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33muser\u001b[0m (to teachable agent):\n",
"\u001b[33muser\u001b[0m (to teachableagent):\n",
"\n",
"Consider the identity: \n",
"9 * 4 + 6 * 6 = 72\n",
Expand All @@ -593,7 +593,7 @@
"\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[33mteachable agent\u001b[0m (to user):\n",
"\u001b[33mteachableagent\u001b[0m (to user):\n",
"\n",
"Step 1: Identify the original number (E) and the final number (F) on the right-hand side.\n",
"E = 72\n",
Expand Down Expand Up @@ -672,7 +672,7 @@
"text": [
"\u001b[93m\n",
"REVIEWING CHAT FOR USER TEACHINGS TO REMEMBER\u001b[0m\n",
"\u001b[33muser\u001b[0m (to teachable agent):\n",
"\u001b[33muser\u001b[0m (to teachableagent):\n",
"\n",
"Consider the identity: \n",
"9 * 4 + 6 * 6 = 72\n",
Expand All @@ -681,7 +681,7 @@
"\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[33mteachable agent\u001b[0m (to user):\n",
"\u001b[33mteachableagent\u001b[0m (to user):\n",
"\n",
"Let's follow the advice to modify one integer on the left hand side of the equation to make the right hand side become 99:\n",
"\n",
Expand Down Expand Up @@ -728,7 +728,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33muser\u001b[0m (to teachable agent):\n",
"\u001b[33muser\u001b[0m (to teachableagent):\n",
"\n",
"Consider the identity: \n",
"8 * 3 + 7 * 9 = 87\n",
Expand All @@ -737,7 +737,7 @@
"\n",
"\n",
"--------------------------------------------------------------------------------\n",
"\u001b[33mteachable agent\u001b[0m (to user):\n",
"\u001b[33mteachableagent\u001b[0m (to user):\n",
"\n",
"Let's follow the advice to modify one integer on the left hand side of the equation to make the right hand side become 59:\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion test/agentchat/chat_with_teachable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def create_teachable_agent(reset_db=False):
# and OAI_CONFIG_LIST_sample
config_list = config_list_from_json(env_or_file="OAI_CONFIG_LIST", filter_dict=filter_dict)
teachable_agent = TeachableAgent(
name="teachable agent",
name="teachableagent",
llm_config={"config_list": config_list, "request_timeout": 120, "use_cache": use_cache},
teach_config={
"verbosity": verbosity,
Expand Down
2 changes: 1 addition & 1 deletion test/agentchat/test_teachable_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def create_teachable_agent(reset_db=False, verbosity=0):
# and OAI_CONFIG_LIST_sample
config_list = config_list_from_json(env_or_file="OAI_CONFIG_LIST", filter_dict=filter_dict)
teachable_agent = TeachableAgent(
name="teachable agent",
name="teachableagent",
llm_config={"config_list": config_list, "request_timeout": 120, "use_cache": use_cache},
teach_config={
"verbosity": verbosity,
Expand Down

0 comments on commit f962f45

Please sign in to comment.