mirror of
https://github.com/microsoft/autogen.git
synced 2025-11-01 18:29:49 +00:00
Support for Python 3.12 (#1317)
* support for Python 3.12 * add python 3.12 to workflows * version string fix * retrieval chat * teachability * workflow * redistribute notebook tests * fix incorrect notebook introduction * update banner; remove unused imports; update openai workflow --------- Co-authored-by: Chi Wang <wang.chi@microsoft.com>
This commit is contained in:
parent
0f59322bc3
commit
22e36cbb10
15
.github/workflows/build.yml
vendored
15
.github/workflows/build.yml
vendored
@ -5,14 +5,14 @@ name: Build
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['main']
|
branches: ["main"]
|
||||||
paths:
|
paths:
|
||||||
- 'autogen/**'
|
- "autogen/**"
|
||||||
- 'test/**'
|
- "test/**"
|
||||||
- '.github/workflows/build.yml'
|
- ".github/workflows/build.yml"
|
||||||
- 'setup.py'
|
- "setup.py"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: ['main']
|
branches: ["main"]
|
||||||
merge_group:
|
merge_group:
|
||||||
types: [checks_requested]
|
types: [checks_requested]
|
||||||
|
|
||||||
@ -22,13 +22,12 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest, windows-2019]
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
||||||
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
|||||||
22
.github/workflows/contrib-tests.yml
vendored
22
.github/workflows/contrib-tests.yml
vendored
@ -5,12 +5,12 @@ name: ContribTests
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: ['main', 'dev/v0.2']
|
branches: ["main"]
|
||||||
paths:
|
paths:
|
||||||
- 'autogen/**'
|
- "autogen/**"
|
||||||
- 'test/agentchat/contrib/**'
|
- "test/agentchat/contrib/**"
|
||||||
- '.github/workflows/contrib-tests.yml'
|
- ".github/workflows/contrib-tests.yml"
|
||||||
- 'setup.py'
|
- "setup.py"
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
|
||||||
@ -67,7 +67,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest, windows-2019]
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
||||||
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
@ -82,7 +82,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pip install -e .
|
pip install -e .
|
||||||
- name: Test Compression
|
- name: Test Compression
|
||||||
if: matrix.python-version != '3.10' # diversify the python versions
|
if: matrix.python-version != '3.10' # diversify the python versions
|
||||||
run: |
|
run: |
|
||||||
pytest test/agentchat/contrib/test_compressible_agent.py --skip-openai
|
pytest test/agentchat/contrib/test_compressible_agent.py --skip-openai
|
||||||
- name: Coverage
|
- name: Coverage
|
||||||
@ -104,7 +104,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest, windows-2019]
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
||||||
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
@ -119,7 +119,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pip install -e .
|
pip install -e .
|
||||||
- name: Test GPTAssistantAgent
|
- name: Test GPTAssistantAgent
|
||||||
if: matrix.python-version != '3.11' # diversify the python versions
|
if: matrix.python-version != '3.11' # diversify the python versions
|
||||||
run: |
|
run: |
|
||||||
pytest test/agentchat/contrib/test_gpt_assistant.py --skip-openai
|
pytest test/agentchat/contrib/test_gpt_assistant.py --skip-openai
|
||||||
- name: Coverage
|
- name: Coverage
|
||||||
@ -156,7 +156,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pip install -e .[teachable]
|
pip install -e .[teachable]
|
||||||
- name: Test TeachableAgent
|
- name: Test TeachableAgent
|
||||||
if: matrix.python-version != '3.9' # diversify the python versions
|
if: matrix.python-version != '3.9' # diversify the python versions
|
||||||
run: |
|
run: |
|
||||||
pytest test/agentchat/contrib/test_teachable_agent.py --skip-openai
|
pytest test/agentchat/contrib/test_teachable_agent.py --skip-openai
|
||||||
- name: Coverage
|
- name: Coverage
|
||||||
@ -178,7 +178,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest, windows-2019]
|
os: [ubuntu-latest, macos-latest, windows-2019]
|
||||||
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
|||||||
14
.github/workflows/openai.yml
vendored
14
.github/workflows/openai.yml
vendored
@ -5,20 +5,20 @@ name: OpenAI
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
branches: ['main']
|
branches: ["main"]
|
||||||
paths:
|
paths:
|
||||||
- 'autogen/**'
|
- "autogen/**"
|
||||||
- 'test/**'
|
- "test/**"
|
||||||
- 'notebook/agentchat_auto_feedback_from_code_execution.ipynb'
|
- "notebook/agentchat_auto_feedback_from_code_execution.ipynb"
|
||||||
- 'notebook/agentchat_function_call.ipynb'
|
- "notebook/agentchat_function_call.ipynb"
|
||||||
- '.github/workflows/openai.yml'
|
- ".github/workflows/openai.yml"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
python-version: ["3.9", "3.10", "3.11"]
|
python-version: ["3.9", "3.10", "3.11", "3.12"]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
environment: openai1
|
environment: openai1
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[](https://badge.fury.io/py/pyautogen)
|
[](https://badge.fury.io/py/pyautogen)
|
||||||
[](https://github.com/microsoft/autogen/actions/workflows/python-package.yml)
|
[](https://github.com/microsoft/autogen/actions/workflows/python-package.yml)
|
||||||

|

|
||||||
[](https://pepy.tech/project/pyautogen)
|
[](https://pepy.tech/project/pyautogen)
|
||||||
[](https://discord.gg/pAbnFJrkgZ)
|
[](https://discord.gg/pAbnFJrkgZ)
|
||||||
[](https://twitter.com/pyautogen)
|
[](https://twitter.com/pyautogen)
|
||||||
@ -69,7 +69,7 @@ Find detailed instructions for users [here](https://microsoft.github.io/autogen/
|
|||||||
|
|
||||||
### Option 2. Install AutoGen Locally
|
### Option 2. Install AutoGen Locally
|
||||||
|
|
||||||
AutoGen requires **Python version >= 3.8, < 3.12**. It can be installed from pip:
|
AutoGen requires **Python version >= 3.8, < 3.13**. It can be installed from pip:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install pyautogen
|
pip install pyautogen
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
"id": "9a71fa36",
|
"id": "9a71fa36",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"# Auto Generated Agent Chat: Task Solving with Provided Tools as Functions\n",
|
"# Auto Generated Agent Chat: Task Solving with Provided Tools as Functions (Asynchronous Function Calls)\n",
|
||||||
"\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. Please find documentation about this feature [here](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat).\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. Please find documentation about this feature [here](https://microsoft.github.io/autogen/docs/Use-Cases/agent_chat).\n",
|
||||||
"\n",
|
"\n",
|
||||||
@ -23,9 +23,9 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"## Requirements\n",
|
"## Requirements\n",
|
||||||
"\n",
|
"\n",
|
||||||
"AutoGen requires `Python>=3.8`. To run this notebook example, please install the [mathchat] option since we will import functions from `MathUserProxyAgent`:\n",
|
"AutoGen requires `Python>=3.8`. To run this notebook example, please install `pyautogen`:\n",
|
||||||
"```bash\n",
|
"```bash\n",
|
||||||
"pip install \"pyautogen[mathchat]\"\n",
|
"pip install pyautogen\n",
|
||||||
"```"
|
"```"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -36,7 +36,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"# %pip install \"pyautogen[mathchat]~=0.1.0\""
|
"# %pip install \"pyautogen>=0.2.6\""
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -390,7 +390,7 @@
|
|||||||
"name": "python",
|
"name": "python",
|
||||||
"nbconvert_exporter": "python",
|
"nbconvert_exporter": "python",
|
||||||
"pygments_lexer": "ipython3",
|
"pygments_lexer": "ipython3",
|
||||||
"version": "3.10.13"
|
"version": "3.11.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nbformat": 4,
|
"nbformat": 4,
|
||||||
|
|||||||
2
setup.py
2
setup.py
@ -61,5 +61,5 @@ setuptools.setup(
|
|||||||
"License :: OSI Approved :: MIT License",
|
"License :: OSI Approved :: MIT License",
|
||||||
"Operating System :: OS Independent",
|
"Operating System :: OS Independent",
|
||||||
],
|
],
|
||||||
python_requires=">=3.8, <3.12",
|
python_requires=">=3.8,<3.13",
|
||||||
)
|
)
|
||||||
|
|||||||
@ -46,24 +46,24 @@ def run_notebook(input_nb, output_nb="executed_openai_notebook.ipynb", save=Fals
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(
|
@pytest.mark.skipif(
|
||||||
skip or not sys.version.startswith("3.11"),
|
skip or not sys.version.startswith("3.10"),
|
||||||
reason="do not run if openai is not installed or py!=3.11",
|
reason="do not run if openai is not installed or py!=3.10",
|
||||||
)
|
)
|
||||||
def test_agentchat_auto_feedback_from_code(save=False):
|
def test_agentchat_auto_feedback_from_code(save=False):
|
||||||
run_notebook("agentchat_auto_feedback_from_code_execution.ipynb", save=save)
|
run_notebook("agentchat_auto_feedback_from_code_execution.ipynb", save=save)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(
|
@pytest.mark.skipif(
|
||||||
skip or not sys.version.startswith("3.10"),
|
skip or not sys.version.startswith("3.11"),
|
||||||
reason="do not run if openai is not installed or py!=3.10",
|
reason="do not run if openai is not installed or py!=3.11",
|
||||||
)
|
)
|
||||||
def _test_oai_completion(save=False):
|
def _test_oai_completion(save=False):
|
||||||
run_notebook("oai_completion.ipynb", save=save)
|
run_notebook("oai_completion.ipynb", save=save)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(
|
@pytest.mark.skipif(
|
||||||
skip or not sys.version.startswith("3.10"),
|
skip or not sys.version.startswith("3.12"),
|
||||||
reason="do not run if openai is not installed or py!=3.10",
|
reason="do not run if openai is not installed or py!=3.12",
|
||||||
)
|
)
|
||||||
def test_agentchat_function_call(save=False):
|
def test_agentchat_function_call(save=False):
|
||||||
run_notebook("agentchat_function_call.ipynb", save=save)
|
run_notebook("agentchat_function_call.ipynb", save=save)
|
||||||
@ -78,32 +78,32 @@ def test_agentchat_function_call_currency_calculator(save=False):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(
|
@pytest.mark.skipif(
|
||||||
skip or not sys.version.startswith("3.10"),
|
skip or not sys.version.startswith("3.11"),
|
||||||
reason="do not run if openai is not installed or py!=3.10",
|
reason="do not run if openai is not installed or py!=3.11",
|
||||||
)
|
)
|
||||||
def test_agentchat_function_call_async(save=False):
|
def test_agentchat_function_call_async(save=False):
|
||||||
run_notebook("agentchat_function_call_async.ipynb", save=save)
|
run_notebook("agentchat_function_call_async.ipynb", save=save)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(
|
@pytest.mark.skipif(
|
||||||
skip or not sys.version.startswith("3.10"),
|
skip or not sys.version.startswith("3.12"),
|
||||||
reason="do not run if openai is not installed or py!=3.10",
|
reason="do not run if openai is not installed or py!=3.12",
|
||||||
)
|
)
|
||||||
def _test_agentchat_MathChat(save=False):
|
def _test_agentchat_MathChat(save=False):
|
||||||
run_notebook("agentchat_MathChat.ipynb", save=save)
|
run_notebook("agentchat_MathChat.ipynb", save=save)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(
|
@pytest.mark.skipif(
|
||||||
skip or not sys.version.startswith("3.11"),
|
skip or not sys.version.startswith("3.10"),
|
||||||
reason="do not run if openai is not installed or py!=3.11",
|
reason="do not run if openai is not installed or py!=3.10",
|
||||||
)
|
)
|
||||||
def _test_oai_chatgpt_gpt4(save=False):
|
def _test_oai_chatgpt_gpt4(save=False):
|
||||||
run_notebook("oai_chatgpt_gpt4.ipynb", save=save)
|
run_notebook("oai_chatgpt_gpt4.ipynb", save=save)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(
|
@pytest.mark.skipif(
|
||||||
skip or not sys.version.startswith("3.10"),
|
skip or not sys.version.startswith("3.11"),
|
||||||
reason="do not run if openai is not installed or py!=3.10",
|
reason="do not run if openai is not installed or py!=3.11",
|
||||||
)
|
)
|
||||||
def _test_hierarchy_flow_using_select_speaker(save=False):
|
def _test_hierarchy_flow_using_select_speaker(save=False):
|
||||||
# TODO: recover this test after rewriting after the new group chat api
|
# TODO: recover this test after rewriting after the new group chat api
|
||||||
@ -111,8 +111,8 @@ def _test_hierarchy_flow_using_select_speaker(save=False):
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(
|
@pytest.mark.skipif(
|
||||||
skip or not sys.version.startswith("3.10"),
|
skip or not sys.version.startswith("3.12"),
|
||||||
reason="do not run if openai is not installed or py!=3.10",
|
reason="do not run if openai is not installed or py!=3.12",
|
||||||
)
|
)
|
||||||
def test_graph_modelling_language_using_select_speaker(save=False):
|
def test_graph_modelling_language_using_select_speaker(save=False):
|
||||||
run_notebook("agentchat_graph_modelling_language_using_select_speaker.ipynb", save=save)
|
run_notebook("agentchat_graph_modelling_language_using_select_speaker.ipynb", save=save)
|
||||||
|
|||||||
@ -151,7 +151,7 @@ Now, you're ready to install AutoGen in the virtual environment you've just crea
|
|||||||
|
|
||||||
## Python
|
## Python
|
||||||
|
|
||||||
AutoGen requires **Python version >= 3.8, < 3.12**. It can be installed from pip:
|
AutoGen requires **Python version >= 3.8, < 3.13**. It can be installed from pip:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install pyautogen
|
pip install pyautogen
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user