From f96963ed434fda60623330a0fcd9ad72251f5864 Mon Sep 17 00:00:00 2001 From: Ricky Loynd Date: Tue, 28 Nov 2023 16:38:56 -0800 Subject: [PATCH] Progress bar for learn_from_user_feedback (#776) * Use tqdm to report progress in learn_from_user_feedback() * Update contrib-openai.yml Append `pytest-asyncio` to `pip install coverage` for TeachableAgent. * Replace pytest-asyncio with pytest * Temporary usage of pull_request action. * Restore pull_request_target action. --- .github/workflows/contrib-openai.yml | 2 +- autogen/agentchat/contrib/teachable_agent.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/contrib-openai.yml b/.github/workflows/contrib-openai.yml index 63abe36b891f..f0d497b3cd6a 100644 --- a/.github/workflows/contrib-openai.yml +++ b/.github/workflows/contrib-openai.yml @@ -161,7 +161,7 @@ jobs: python -m pip install --upgrade pip wheel pip install -e .[teachable] python -c "import autogen" - pip install coverage + pip install coverage pytest - name: Coverage env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} diff --git a/autogen/agentchat/contrib/teachable_agent.py b/autogen/agentchat/contrib/teachable_agent.py index 29d7f197ffca..e746548862c0 100644 --- a/autogen/agentchat/contrib/teachable_agent.py +++ b/autogen/agentchat/contrib/teachable_agent.py @@ -1,5 +1,4 @@ import os -from autogen import oai from autogen.agentchat.agent import Agent from autogen.agentchat.assistant_agent import ConversableAgent from autogen.agentchat.contrib.text_analyzer_agent import TextAnalyzerAgent @@ -7,6 +6,7 @@ import chromadb from chromadb.config import Settings import pickle +from tqdm import tqdm try: @@ -133,7 +133,7 @@ def learn_from_user_feedback(self): print(colored("\nREVIEWING CHAT FOR USER TEACHINGS TO REMEMBER", "light_yellow")) # Look at each user turn. if len(self.user_comments) > 0: - for comment in self.user_comments: + for comment in tqdm(self.user_comments): # Consider whether to store something from this user turn in the DB. self.consider_memo_storage(comment) self.user_comments = []