From fd0094ce51024bc45e871e50513415d3a1968dd0 Mon Sep 17 00:00:00 2001 From: Chi Wang Date: Sat, 27 Jan 2024 10:49:24 -0800 Subject: [PATCH] bump version to 0.2.9 (#1430) * Fixed rounding bug. * bump version to 0.2.9 * fix format error * simplify contrib tests --------- Co-authored-by: Adam Fourney --- .github/workflows/contrib-tests.yml | 51 ++++--------------- autogen/version.py | 2 +- notebook/agentchat_cost_token_tracking.ipynb | 1 - ...at_function_call_currency_calculator.ipynb | 2 +- .../agentchat_oai_assistant_retrieval.ipynb | 2 +- .../autogen-studio/notebooks/tutorial.ipynb | 1 - test/test_browser_utils.py | 3 +- 7 files changed, 15 insertions(+), 47 deletions(-) diff --git a/.github/workflows/contrib-tests.yml b/.github/workflows/contrib-tests.yml index ceb19ebbef..834d172345 100644 --- a/.github/workflows/contrib-tests.yml +++ b/.github/workflows/contrib-tests.yml @@ -27,7 +27,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-2019] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -38,12 +38,12 @@ jobs: run: | python -m pip install --upgrade pip wheel pip install pytest - - name: Install qdrant_client when python-version is 3.8 and 3.10 - if: matrix.python-version == '3.8' || matrix.python-version == '3.10' + - name: Install qdrant_client when python-version is 3.10 + if: matrix.python-version == '3.10' run: | pip install qdrant_client[fastembed] - - name: Install unstructured when python-version is 3.9 and 3.11 and not windows - if: (matrix.python-version == '3.9' || matrix.python-version == '3.11') && matrix.os != 'windows-2019' + - name: Install unstructured when python-version is 3.9 and not windows + if: matrix.python-version == '3.9' && matrix.os != 'windows-2019' run: | pip install unstructured[all-docs] - name: Install packages and dependencies for RetrieveChat @@ -59,13 +59,11 @@ jobs: run: | pytest test/test_retrieve_utils.py test/agentchat/contrib/test_retrievechat.py test/agentchat/contrib/test_qdrant_retrievechat.py --skip-openai - name: Coverage - if: matrix.python-version == '3.10' run: | pip install coverage>=5.3 coverage run -a -m pytest test/test_retrieve_utils.py test/agentchat/contrib/test_retrievechat.py test/agentchat/contrib/test_qdrant_retrievechat.py --skip-openai coverage xml - name: Upload coverage to Codecov - if: matrix.python-version == '3.10' uses: codecov/codecov-action@v3 with: file: ./coverage.xml @@ -77,7 +75,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-2019] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -97,18 +95,12 @@ jobs: if [[ ${{ matrix.os }} != ubuntu-latest ]]; then echo "AUTOGEN_USE_DOCKER=False" >> $GITHUB_ENV fi - - name: Test Compression - if: matrix.python-version != '3.10' # diversify the python versions - run: | - pytest test/agentchat/contrib/test_compressible_agent.py --skip-openai - name: Coverage - if: matrix.python-version == '3.10' run: | pip install coverage>=5.3 coverage run -a -m pytest test/agentchat/contrib/test_compressible_agent.py --skip-openai coverage xml - name: Upload coverage to Codecov - if: matrix.python-version == '3.10' uses: codecov/codecov-action@v3 with: file: ./coverage.xml @@ -120,7 +112,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-2019] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.10"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -140,18 +132,12 @@ jobs: if [[ ${{ matrix.os }} != ubuntu-latest ]]; then echo "AUTOGEN_USE_DOCKER=False" >> $GITHUB_ENV fi - - name: Test GPTAssistantAgent - if: matrix.python-version != '3.11' # diversify the python versions - run: | - pytest test/agentchat/contrib/test_gpt_assistant.py --skip-openai - name: Coverage - if: matrix.python-version == '3.11' run: | pip install coverage>=5.3 coverage run -a -m pytest test/agentchat/contrib/test_gpt_assistant.py --skip-openai coverage xml - name: Upload coverage to Codecov - if: matrix.python-version == '3.11' uses: codecov/codecov-action@v3 with: file: ./coverage.xml @@ -163,7 +149,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-2019] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.11"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -183,18 +169,12 @@ jobs: if [[ ${{ matrix.os }} != ubuntu-latest ]]; then echo "AUTOGEN_USE_DOCKER=False" >> $GITHUB_ENV fi - - name: Test TeachableAgent - if: matrix.python-version != '3.9' # diversify the python versions - run: | - pytest test/agentchat/contrib/test_teachable_agent.py --skip-openai - name: Coverage - if: matrix.python-version == '3.9' run: | pip install coverage>=5.3 coverage run -a -m pytest test/agentchat/contrib/test_teachable_agent.py --skip-openai coverage xml - name: Upload coverage to Codecov - if: matrix.python-version == '3.9' uses: codecov/codecov-action@v3 with: file: ./coverage.xml @@ -206,7 +186,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-2019] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.12"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -226,18 +206,12 @@ jobs: if [[ ${{ matrix.os }} != ubuntu-latest ]]; then echo "AUTOGEN_USE_DOCKER=False" >> $GITHUB_ENV fi - - name: Test WebSurfer - if: matrix.python-version != '3.10' # diversify the python versions - run: | - pytest test/test_browser_utils.py test/agentchat/contrib/test_web_surfer.py --skip-openai - name: Coverage - if: matrix.python-version == '3.10' run: | pip install coverage>=5.3 coverage run -a -m pytest test/test_browser_utils.py test/agentchat/contrib/test_web_surfer.py --skip-openai coverage xml - name: Upload coverage to Codecov - if: matrix.python-version == '3.10' uses: codecov/codecov-action@v3 with: file: ./coverage.xml @@ -249,7 +223,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-2019] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.12"] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -269,17 +243,12 @@ jobs: if [[ ${{ matrix.os }} != ubuntu-latest ]]; then echo "AUTOGEN_USE_DOCKER=False" >> $GITHUB_ENV fi - - name: Test LMM and LLaVA - run: | - pytest test/agentchat/contrib/test_img_utils.py test/agentchat/contrib/test_lmm.py test/agentchat/contrib/test_llava.py --skip-openai - name: Coverage - if: matrix.python-version == '3.10' run: | pip install coverage>=5.3 coverage run -a -m pytest test/agentchat/contrib/test_img_utils.py test/agentchat/contrib/test_lmm.py test/agentchat/contrib/test_llava.py --skip-openai coverage xml - name: Upload coverage to Codecov - if: matrix.python-version == '3.10' uses: codecov/codecov-action@v3 with: file: ./coverage.xml diff --git a/autogen/version.py b/autogen/version.py index c49a95c357..75cf7831c4 100644 --- a/autogen/version.py +++ b/autogen/version.py @@ -1 +1 @@ -__version__ = "0.2.8" +__version__ = "0.2.9" diff --git a/notebook/agentchat_cost_token_tracking.ipynb b/notebook/agentchat_cost_token_tracking.ipynb index b61121e791..7b3bab8666 100644 --- a/notebook/agentchat_cost_token_tracking.ipynb +++ b/notebook/agentchat_cost_token_tracking.ipynb @@ -356,7 +356,6 @@ } ], "source": [ - "\n", "assistant = AssistantAgent(\n", " \"assistant\",\n", " system_message=\"You are a helpful assistant.\",\n", diff --git a/notebook/agentchat_function_call_currency_calculator.ipynb b/notebook/agentchat_function_call_currency_calculator.ipynb index e3fb14b2ab..e42f91c1a6 100644 --- a/notebook/agentchat_function_call_currency_calculator.ipynb +++ b/notebook/agentchat_function_call_currency_calculator.ipynb @@ -167,7 +167,7 @@ " quote_currency: Annotated[CurrencySymbol, \"Quote currency\"] = \"EUR\",\n", ") -> str:\n", " quote_amount = exchange_rate(base_currency, quote_currency) * base_amount\n", - " return f\"{quote_amount} {quote_currency}\"\n" + " return f\"{quote_amount} {quote_currency}\"" ] }, { diff --git a/notebook/agentchat_oai_assistant_retrieval.ipynb b/notebook/agentchat_oai_assistant_retrieval.ipynb index ba73e9f042..96692a8cb7 100644 --- a/notebook/agentchat_oai_assistant_retrieval.ipynb +++ b/notebook/agentchat_oai_assistant_retrieval.ipynb @@ -101,7 +101,7 @@ " \"config_list\": config_list,\n", " \"assistant_id\": assistant_id,\n", " \"tools\": [{\"type\": \"retrieval\"}],\n", - " \"file_ids\": [\"file-CmlT0YKLB3ZCdHmslF9FOv69\"]\n", + " \"file_ids\": [\"file-CmlT0YKLB3ZCdHmslF9FOv69\"],\n", " # add id of an existing file in your openai account\n", " # in this case I added the implementation of conversable_agent.py\n", "}\n", diff --git a/samples/apps/autogen-studio/notebooks/tutorial.ipynb b/samples/apps/autogen-studio/notebooks/tutorial.ipynb index fddaa4d243..262a13b88b 100644 --- a/samples/apps/autogen-studio/notebooks/tutorial.ipynb +++ b/samples/apps/autogen-studio/notebooks/tutorial.ipynb @@ -49,7 +49,6 @@ } ], "source": [ - "\n", "# load an agent specification in JSON\n", "agent_spec = json.load(open(\"agent_spec.json\"))\n", "\n", diff --git a/test/test_browser_utils.py b/test/test_browser_utils.py index c650c6b9ba..8b8759708b 100644 --- a/test/test_browser_utils.py +++ b/test/test_browser_utils.py @@ -4,6 +4,7 @@ import sys import requests import hashlib import re +import math from agentchat.test_assistant_agent import KEY_LOC # noqa: E402 @@ -78,7 +79,7 @@ def test_simple_text_browser(): assert BLOG_POST_STRING in browser.page_content # Check if page splitting works - approx_pages = int(len(browser.page_content) / viewport_size + 0.5) # May be fewer, since it aligns to word breaks + approx_pages = math.ceil(len(browser.page_content) / viewport_size) # May be fewer, since it aligns to word breaks assert len(browser.viewport_pages) <= approx_pages assert abs(len(browser.viewport_pages) - approx_pages) <= 1 # allow only a small deviation assert browser.viewport_pages[0][0] == 0