From 8d51462973975066230e0a3da19dda49366a3093 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Thu, 14 Nov 2024 12:56:04 +0000 Subject: [PATCH 01/19] devcontainer stuff renamed to ag2 --- .devcontainer/devcontainer.json | 2 +- .devcontainer/python-3.11/devcontainer.json | 2 +- .devcontainer/python-3.12/devcontainer.json | 2 +- .devcontainer/python-3.9/devcontainer.json | 2 +- .devcontainer/{setup.sh => setup-ag2.sh} | 2 +- pyproject.toml | 21 +++++++++++++++++---- 6 files changed, 22 insertions(+), 9 deletions(-) rename .devcontainer/{setup.sh => setup-ag2.sh} (82%) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 062010c2c..db3a4807e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -65,7 +65,7 @@ "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} }, - "updateContentCommand": "bash .devcontainer/setup.sh", + "updateContentCommand": "bash .devcontainer/setup-ag2.sh", "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", "customizations": { "vscode": { diff --git a/.devcontainer/python-3.11/devcontainer.json b/.devcontainer/python-3.11/devcontainer.json index ef764fd7a..c4c76d4e8 100644 --- a/.devcontainer/python-3.11/devcontainer.json +++ b/.devcontainer/python-3.11/devcontainer.json @@ -64,7 +64,7 @@ "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} }, - "updateContentCommand": "bash .devcontainer/setup.sh", + "updateContentCommand": "bash .devcontainer/setup-ag2.sh", "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", "customizations": { "vscode": { diff --git a/.devcontainer/python-3.12/devcontainer.json b/.devcontainer/python-3.12/devcontainer.json index edfa1d1f4..5fa634c02 100644 --- a/.devcontainer/python-3.12/devcontainer.json +++ b/.devcontainer/python-3.12/devcontainer.json @@ -64,7 +64,7 @@ "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} }, - "updateContentCommand": "bash .devcontainer/setup.sh", + "updateContentCommand": "bash .devcontainer/setup-ag2.sh", "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", "customizations": { "vscode": { diff --git a/.devcontainer/python-3.9/devcontainer.json b/.devcontainer/python-3.9/devcontainer.json index e0f900437..c18be6ccb 100644 --- a/.devcontainer/python-3.9/devcontainer.json +++ b/.devcontainer/python-3.9/devcontainer.json @@ -65,7 +65,7 @@ "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} }, - "updateContentCommand": "bash .devcontainer/setup.sh", + "updateContentCommand": "bash .devcontainer/setup-ag2.sh", "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", "customizations": { "vscode": { diff --git a/.devcontainer/setup.sh b/.devcontainer/setup-ag2.sh similarity index 82% rename from .devcontainer/setup.sh rename to .devcontainer/setup-ag2.sh index f4f165e48..fc02fd3ea 100644 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup-ag2.sh @@ -2,7 +2,7 @@ pip install --upgrade pip # install dev packages -pip install -e ".[dev]" +pip install -e ".[dev-ag2]" # install pre-commit hook if not installed already pre-commit install diff --git a/pyproject.toml b/pyproject.toml index 2b198818e..ce4fb6992 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,13 @@ mesop = [ ] autogen = [ - "autogen[anthropic,together]>=0.3.0,<0.4", + "autogen-agentchat[anthropic,together]>=0.2.0,<0.3", + "together>=1.2.11,<1.3", # ToDo: together 1.3.0 has issues with our dev dependencies + "markdownify==0.13.1", # Needed by autogen.WebSurferAgent but not included +] + +ag2 = [ + "ag2[anthropic,together]>=0.3.0,<0.4", "together>=1.2.11,<1.3", # ToDo: together 1.3.0 has issues with our dev dependencies "markdownify==0.13.1", # Needed by autogen.WebSurferAgent but not included ] @@ -94,7 +100,7 @@ firebase = [ ] submodules = [ - "fastagency[mesop,autogen,openapi,fastapi,nats,server,firebase,basic_auth]" + "fastagency[mesop,openapi,fastapi,nats,server,firebase,basic_auth]" ] # dev dependencies @@ -153,8 +159,15 @@ testing = [ "passlib[bcrypt]==1.7.4", ] -dev = [ - "fastagency[submodules,lint,testing,devdocs]", + +dev-autogen = [ + "fastagency[autogen,submodules,lint,testing,devdocs]", + "pre-commit==4.0.1", + "detect-secrets==1.5.0", +] + +dev-ag2 = [ + "fastagency[ag2,submodules,lint,testing,devdocs]", "pre-commit==4.0.1", "detect-secrets==1.5.0", ] From baec467a980e6ad022be68bbf3fb072f13f432da Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Wed, 20 Nov 2024 09:08:54 +0000 Subject: [PATCH 02/19] pre commit fixes --- .../{ => ag2-python-3.10}/devcontainer.json | 4 +- .../{ => ag2-python-3.10}/docker-compose.yml | 12 +- .../devcontainer.json | 5 +- .../docker-compose.yml | 4 +- .../devcontainer.json | 5 +- .../docker-compose.yml | 4 +- .../devcontainer.json | 4 +- .../docker-compose.yml | 4 +- .devcontainer/build_devcontainers.py | 156 ++++++++++++++++++ .../runtime-python-3.10/devcontainer.json | 98 +++++++++++ .../runtime-python-3.10/docker-compose.yml | 32 ++++ .../runtime-python-3.11/devcontainer.json | 98 +++++++++++ .../runtime-python-3.11/docker-compose.yml | 32 ++++ .../runtime-python-3.12/devcontainer.json | 98 +++++++++++ .../runtime-python-3.12/docker-compose.yml | 32 ++++ .../runtime-python-3.9/devcontainer.json | 98 +++++++++++ .../runtime-python-3.9/docker-compose.yml | 32 ++++ .pre-commit-config.yaml | 11 ++ scripts/devcontainer-build-pre-commit.sh | 32 ++++ 19 files changed, 741 insertions(+), 20 deletions(-) rename .devcontainer/{ => ag2-python-3.10}/devcontainer.json (98%) rename .devcontainer/{ => ag2-python-3.10}/docker-compose.yml (70%) rename .devcontainer/{python-3.11 => ag2-python-3.11}/devcontainer.json (97%) rename .devcontainer/{python-3.11 => ag2-python-3.11}/docker-compose.yml (87%) rename .devcontainer/{python-3.12 => ag2-python-3.12}/devcontainer.json (97%) rename .devcontainer/{python-3.12 => ag2-python-3.12}/docker-compose.yml (87%) rename .devcontainer/{python-3.9 => ag2-python-3.9}/devcontainer.json (98%) rename .devcontainer/{python-3.9 => ag2-python-3.9}/docker-compose.yml (87%) create mode 100755 .devcontainer/build_devcontainers.py create mode 100644 .devcontainer/runtime-python-3.10/devcontainer.json create mode 100644 .devcontainer/runtime-python-3.10/docker-compose.yml create mode 100644 .devcontainer/runtime-python-3.11/devcontainer.json create mode 100644 .devcontainer/runtime-python-3.11/docker-compose.yml create mode 100644 .devcontainer/runtime-python-3.12/devcontainer.json create mode 100644 .devcontainer/runtime-python-3.12/docker-compose.yml create mode 100644 .devcontainer/runtime-python-3.9/devcontainer.json create mode 100644 .devcontainer/runtime-python-3.9/docker-compose.yml create mode 100755 scripts/devcontainer-build-pre-commit.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/ag2-python-3.10/devcontainer.json similarity index 98% rename from .devcontainer/devcontainer.json rename to .devcontainer/ag2-python-3.10/devcontainer.json index db3a4807e..ea6521fa1 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/ag2-python-3.10/devcontainer.json @@ -1,12 +1,12 @@ { - "name": "python-3.10", + "name": "ag2-python-3.10", // "image": "mcr.microsoft.com/devcontainers/python:3.10", "dockerComposeFile": [ "./docker-compose.yml" ], "service": "python-3.10-fastagency", "forwardPorts": [ - "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py310:9222" + "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.10:9222" ], "secrets": { "OPENAI_API_KEY": { diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/ag2-python-3.10/docker-compose.yml similarity index 70% rename from .devcontainer/docker-compose.yml rename to .devcontainer/ag2-python-3.10/docker-compose.yml index dae496aa6..762d7cac1 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/ag2-python-3.10/docker-compose.yml @@ -5,25 +5,25 @@ services: image: mcr.microsoft.com/devcontainers/python:3.10 container_name: fastagency-${USER}-python-3.10 volumes: - - ../:/workspaces/fastagency:cached + - ../../:/workspaces/fastagency:cached command: sleep infinity environment: - - NATS_URL=nats://fastagency-${USER}-nats-py310:4222 + - NATS_URL=nats://fastagency-${USER}-nats-py3.10:4222 env_file: - - ./devcontainer.env + - ../devcontainer.env networks: - fastagency-network nats-fastagency: # nosemgrep image: nats:latest - container_name: fastagency-${USER}-nats-py310 + container_name: fastagency-${USER}-nats-py3.10 # ports: # - "${PORT_PREFIX}4222:4222" # - "${PORT_PREFIX}9222:9222" volumes: - - ./nats_server.conf:/etc/nats/server.conf + - ../nats_server.conf:/etc/nats/server.conf command: [ "--config", "/etc/nats/server.conf" ] env_file: - - ./devcontainer.env + - ../devcontainer.env networks: - fastagency-network diff --git a/.devcontainer/python-3.11/devcontainer.json b/.devcontainer/ag2-python-3.11/devcontainer.json similarity index 97% rename from .devcontainer/python-3.11/devcontainer.json rename to .devcontainer/ag2-python-3.11/devcontainer.json index c4c76d4e8..4f2b3221f 100644 --- a/.devcontainer/python-3.11/devcontainer.json +++ b/.devcontainer/ag2-python-3.11/devcontainer.json @@ -1,11 +1,12 @@ { - "name": "python-3.11", + "name": "ag2-python-3.11", + // "image": "mcr.microsoft.com/devcontainers/python:3.11", "dockerComposeFile": [ "./docker-compose.yml" ], "service": "python-3.11-fastagency", "forwardPorts": [ - "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py311:9222" + "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.11:9222" ], "secrets": { "OPENAI_API_KEY": { diff --git a/.devcontainer/python-3.11/docker-compose.yml b/.devcontainer/ag2-python-3.11/docker-compose.yml similarity index 87% rename from .devcontainer/python-3.11/docker-compose.yml rename to .devcontainer/ag2-python-3.11/docker-compose.yml index a3a60dbec..2e08b9619 100644 --- a/.devcontainer/python-3.11/docker-compose.yml +++ b/.devcontainer/ag2-python-3.11/docker-compose.yml @@ -8,14 +8,14 @@ services: - ../../:/workspaces/fastagency:cached command: sleep infinity environment: - - NATS_URL=nats://fastagency-${USER}-nats-py311:4222 + - NATS_URL=nats://fastagency-${USER}-nats-py3.11:4222 env_file: - ../devcontainer.env networks: - fastagency-network nats-fastagency: # nosemgrep image: nats:latest - container_name: fastagency-${USER}-nats-py311 + container_name: fastagency-${USER}-nats-py3.11 # ports: # - "${PORT_PREFIX}4222:4222" # - "${PORT_PREFIX}9222:9222" diff --git a/.devcontainer/python-3.12/devcontainer.json b/.devcontainer/ag2-python-3.12/devcontainer.json similarity index 97% rename from .devcontainer/python-3.12/devcontainer.json rename to .devcontainer/ag2-python-3.12/devcontainer.json index 5fa634c02..662616faf 100644 --- a/.devcontainer/python-3.12/devcontainer.json +++ b/.devcontainer/ag2-python-3.12/devcontainer.json @@ -1,11 +1,12 @@ { - "name": "python-3.12", + "name": "ag2-python-3.12", + // "image": "mcr.microsoft.com/devcontainers/python:3.12", "dockerComposeFile": [ "./docker-compose.yml" ], "service": "python-3.12-fastagency", "forwardPorts": [ - "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py312:9222" + "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.12:9222" ], "secrets": { "OPENAI_API_KEY": { diff --git a/.devcontainer/python-3.12/docker-compose.yml b/.devcontainer/ag2-python-3.12/docker-compose.yml similarity index 87% rename from .devcontainer/python-3.12/docker-compose.yml rename to .devcontainer/ag2-python-3.12/docker-compose.yml index 84fb7d4c3..f52afd429 100644 --- a/.devcontainer/python-3.12/docker-compose.yml +++ b/.devcontainer/ag2-python-3.12/docker-compose.yml @@ -8,14 +8,14 @@ services: - ../../:/workspaces/fastagency:cached command: sleep infinity environment: - - NATS_URL=nats://fastagency-${USER}-nats-py312:4222 + - NATS_URL=nats://fastagency-${USER}-nats-py3.12:4222 env_file: - ../devcontainer.env networks: - fastagency-network nats-fastagency: # nosemgrep image: nats:latest - container_name: fastagency-${USER}-nats-py312 + container_name: fastagency-${USER}-nats-py3.12 # ports: # - "${PORT_PREFIX}4222:4222" # - "${PORT_PREFIX}9222:9222" diff --git a/.devcontainer/python-3.9/devcontainer.json b/.devcontainer/ag2-python-3.9/devcontainer.json similarity index 98% rename from .devcontainer/python-3.9/devcontainer.json rename to .devcontainer/ag2-python-3.9/devcontainer.json index c18be6ccb..a6d630f13 100644 --- a/.devcontainer/python-3.9/devcontainer.json +++ b/.devcontainer/ag2-python-3.9/devcontainer.json @@ -1,12 +1,12 @@ { - "name": "python-3.9", + "name": "ag2-python-3.9", // "image": "mcr.microsoft.com/devcontainers/python:3.9", "dockerComposeFile": [ "./docker-compose.yml" ], "service": "python-3.9-fastagency", "forwardPorts": [ - "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py39:9222" + "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.9:9222" ], "secrets": { "OPENAI_API_KEY": { diff --git a/.devcontainer/python-3.9/docker-compose.yml b/.devcontainer/ag2-python-3.9/docker-compose.yml similarity index 87% rename from .devcontainer/python-3.9/docker-compose.yml rename to .devcontainer/ag2-python-3.9/docker-compose.yml index a69247c38..281aef70f 100644 --- a/.devcontainer/python-3.9/docker-compose.yml +++ b/.devcontainer/ag2-python-3.9/docker-compose.yml @@ -8,14 +8,14 @@ services: - ../../:/workspaces/fastagency:cached command: sleep infinity environment: - - NATS_URL=nats://fastagency-${USER}-nats-py39:4222 + - NATS_URL=nats://fastagency-${USER}-nats-py3.9:4222 env_file: - ../devcontainer.env networks: - fastagency-network nats-fastagency: # nosemgrep image: nats:latest - container_name: fastagency-${USER}-nats-py39 + container_name: fastagency-${USER}-nats-py3.9 # ports: # - "${PORT_PREFIX}4222:4222" # - "${PORT_PREFIX}9222:9222" diff --git a/.devcontainer/build_devcontainers.py b/.devcontainer/build_devcontainers.py new file mode 100755 index 000000000..653f8c88c --- /dev/null +++ b/.devcontainer/build_devcontainers.py @@ -0,0 +1,156 @@ + +#! /usr/bin/env python3 + +from pathlib import Path + + +docker_compose = """version: '3' + +services: + python-{python}-fastagency: # nosemgrep + image: mcr.microsoft.com/devcontainers/python:{python} + container_name: fastagency-${{USER}}-python-{python} + volumes: + - ../../:/workspaces/fastagency:cached + command: sleep infinity + environment: + - NATS_URL=nats://fastagency-${{USER}}-nats-py{python}:4222 + env_file: + - ../devcontainer.env + networks: + - fastagency-network + nats-fastagency: # nosemgrep + image: nats:latest + container_name: fastagency-${{USER}}-nats-py{python} + # ports: + # - "${{PORT_PREFIX}}4222:4222" + # - "${{PORT_PREFIX}}9222:9222" + volumes: + - ../nats_server.conf:/etc/nats/server.conf + command: [ "--config", "/etc/nats/server.conf" ] + env_file: + - ../devcontainer.env + networks: + - fastagency-network + +networks: + fastagency-network: + name: fastagency-${{USER}}-network +""" + +devcontainer = """{{ + "name": "ag2-python-{python}", + // "image": "mcr.microsoft.com/devcontainers/python:{python}", + "dockerComposeFile": [ + "./docker-compose.yml" + ], + "service": "python-{python}-fastagency", + "forwardPorts": [ + "fastagency-${{containerEnv:CONTAINER_PREFIX}}-nats-py{python}:9222" + ], + "secrets": {{ + "OPENAI_API_KEY": {{ + "description": "This key is optional and only needed if you are working on OpenAI-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }}, + "TOGETHER_API_KEY": {{ + "description": "This key is optional and only needed if you are working with Together API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }}, + "ANTHROPIC_API_KEY": {{ + "description": "This key is optional and only needed if you are working with Anthropic API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }}, + "AZURE_OPENAI_API_KEY": {{ + "description": "This key is optional and only needed if you are using Azure's OpenAI services. For it to work, you must also set the related environment variables: AZURE_API_ENDPOINT, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL. Leave it blank if not required. You can always set these variables later in the codespace terminal." + }}, + "AZURE_API_ENDPOINT": {{ + "description": "This key is required if you are using Azure's OpenAI services. It must be used in conjunction with AZURE_OPENAI_API_KEY, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL to ensure proper configuration. You can always set these variables later as environment variables in the codespace terminal." + }}, + "AZURE_API_VERSION": {{ + "description": "This key is required to specify the version of the Azure API you are using. Set this along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL for Azure OpenAI services. These variables can be configured later as environment variables in the codespace terminal." + }}, + "AZURE_GPT35_MODEL": {{ + "description": "This key is required if you are using Azure's GPT-3.5 model. Ensure you also set AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT4_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION for full compatibility with Azure OpenAI services. These can be configured later in the codespace terminal as environment variables." + }}, + "AZURE_GPT4_MODEL": {{ + "description": "This key is required if you are using Azure's GPT-4 model. It must be set along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION to properly integrate with Azure's OpenAI services. All keys can be added later as environment variables in the codespace terminal." + }}, + "AZURE_GPT4o_MODEL": {{ + "description": "This key is required if you are using Azure's GPT-4o model. Ensure that AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, and AZURE_API_VERSION are also set. You can always add these later as environment variables in the codespace terminal." + }}, + "BING_API_KEY": {{ + "description": "This key is optional. The WebSurfer agent can work without it, but when added, it uses Bing's search and data services to improve information retrieval. You can always set it later as an environment variable in the codespace terminal." + }} + }}, + "shutdownAction": "stopCompose", + "workspaceFolder": "/workspaces/fastagency", + // "runArgs": [], + "remoteEnv": {{}}, + "features": {{ + "ghcr.io/devcontainers/features/common-utils:2": {{ + "installZsh": true, + "installOhMyZsh": true, + "configureZshAsDefaultShell": true, + "username": "vscode", + "userUid": "1000", + "userGid": "1000" + // "upgradePackages": "true" + }}, + // "ghcr.io/devcontainers/features/python:1": {{}}, + "ghcr.io/devcontainers/features/node:1": {{}}, + // The below configuration with "version" set to "latest" fails in codespace + // "ghcr.io/devcontainers/features/git:1": {{ + // "version": "latest", + // "ppa": true + // }}, + "ghcr.io/devcontainers/features/git:1": {{}}, + "ghcr.io/devcontainers/features/git-lfs:1": {{}}, + "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {{}} + }}, + "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", + "customizations": {{ + "vscode": {{ + "settings": {{ + "python.linting.enabled": true, + "python.testing.pytestEnabled": true, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": {{ + "source.organizeImports": "always" + }}, + "[python]": {{ + "editor.defaultFormatter": "ms-python.vscode-pylance" + }}, + "editor.rulers": [ + 80 + ] + }}, + "extensions": [ + "ms-python.python", + "ms-toolsai.jupyter", + "ms-toolsai.vscode-jupyter-cell-tags", + "ms-toolsai.jupyter-keymap", + "ms-toolsai.jupyter-renderers", + "ms-toolsai.vscode-jupyter-slideshow", + "ms-python.vscode-pylance", + "ms-playwright.playwright" + ] + }} + }} +}} +""" + +root_path = Path(__file__).parent + +def write_files(): + for python in ["3.9", "3.10", "3.11", "3.12"]: + for runtime in ["ag2", "runtime"]: + dir_path = root_path / f"{runtime}-python-{python}" + dir_path.mkdir(exist_ok=True, parents=True) + + with open(dir_path / "docker-compose.yml", "w") as f: + f.write(docker_compose.format(python=python, runtime=runtime)) + + with open(dir_path / "devcontainer.json", "w") as f: + f.write(devcontainer.format(python=python, runtime=runtime)) + +if __name__ == "__main__": + write_files() diff --git a/.devcontainer/runtime-python-3.10/devcontainer.json b/.devcontainer/runtime-python-3.10/devcontainer.json new file mode 100644 index 000000000..ea6521fa1 --- /dev/null +++ b/.devcontainer/runtime-python-3.10/devcontainer.json @@ -0,0 +1,98 @@ +{ + "name": "ag2-python-3.10", + // "image": "mcr.microsoft.com/devcontainers/python:3.10", + "dockerComposeFile": [ + "./docker-compose.yml" + ], + "service": "python-3.10-fastagency", + "forwardPorts": [ + "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.10:9222" + ], + "secrets": { + "OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are working on OpenAI-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "TOGETHER_API_KEY": { + "description": "This key is optional and only needed if you are working with Together API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "ANTHROPIC_API_KEY": { + "description": "This key is optional and only needed if you are working with Anthropic API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "AZURE_OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are using Azure's OpenAI services. For it to work, you must also set the related environment variables: AZURE_API_ENDPOINT, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL. Leave it blank if not required. You can always set these variables later in the codespace terminal." + }, + "AZURE_API_ENDPOINT": { + "description": "This key is required if you are using Azure's OpenAI services. It must be used in conjunction with AZURE_OPENAI_API_KEY, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL to ensure proper configuration. You can always set these variables later as environment variables in the codespace terminal." + }, + "AZURE_API_VERSION": { + "description": "This key is required to specify the version of the Azure API you are using. Set this along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL for Azure OpenAI services. These variables can be configured later as environment variables in the codespace terminal." + }, + "AZURE_GPT35_MODEL": { + "description": "This key is required if you are using Azure's GPT-3.5 model. Ensure you also set AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT4_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION for full compatibility with Azure OpenAI services. These can be configured later in the codespace terminal as environment variables." + }, + "AZURE_GPT4_MODEL": { + "description": "This key is required if you are using Azure's GPT-4 model. It must be set along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION to properly integrate with Azure's OpenAI services. All keys can be added later as environment variables in the codespace terminal." + }, + "AZURE_GPT4o_MODEL": { + "description": "This key is required if you are using Azure's GPT-4o model. Ensure that AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, and AZURE_API_VERSION are also set. You can always add these later as environment variables in the codespace terminal." + }, + "BING_API_KEY": { + "description": "This key is optional. The WebSurfer agent can work without it, but when added, it uses Bing's search and data services to improve information retrieval. You can always set it later as an environment variable in the codespace terminal." + } + }, + "shutdownAction": "stopCompose", + "workspaceFolder": "/workspaces/fastagency", + // "runArgs": [], + "remoteEnv": {}, + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": true, + "installOhMyZsh": true, + "configureZshAsDefaultShell": true, + "username": "vscode", + "userUid": "1000", + "userGid": "1000" + // "upgradePackages": "true" + }, + // "ghcr.io/devcontainers/features/python:1": {}, + "ghcr.io/devcontainers/features/node:1": {}, + // The below configuration with "version" set to "latest" fails in codespace + // "ghcr.io/devcontainers/features/git:1": { + // "version": "latest", + // "ppa": true + // }, + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/git-lfs:1": {}, + "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} + }, + "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", + "customizations": { + "vscode": { + "settings": { + "python.linting.enabled": true, + "python.testing.pytestEnabled": true, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": "always" + }, + "[python]": { + "editor.defaultFormatter": "ms-python.vscode-pylance" + }, + "editor.rulers": [ + 80 + ] + }, + "extensions": [ + "ms-python.python", + "ms-toolsai.jupyter", + "ms-toolsai.vscode-jupyter-cell-tags", + "ms-toolsai.jupyter-keymap", + "ms-toolsai.jupyter-renderers", + "ms-toolsai.vscode-jupyter-slideshow", + "ms-python.vscode-pylance", + "ms-playwright.playwright" + ] + } + } +} diff --git a/.devcontainer/runtime-python-3.10/docker-compose.yml b/.devcontainer/runtime-python-3.10/docker-compose.yml new file mode 100644 index 000000000..762d7cac1 --- /dev/null +++ b/.devcontainer/runtime-python-3.10/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3' + +services: + python-3.10-fastagency: # nosemgrep + image: mcr.microsoft.com/devcontainers/python:3.10 + container_name: fastagency-${USER}-python-3.10 + volumes: + - ../../:/workspaces/fastagency:cached + command: sleep infinity + environment: + - NATS_URL=nats://fastagency-${USER}-nats-py3.10:4222 + env_file: + - ../devcontainer.env + networks: + - fastagency-network + nats-fastagency: # nosemgrep + image: nats:latest + container_name: fastagency-${USER}-nats-py3.10 + # ports: + # - "${PORT_PREFIX}4222:4222" + # - "${PORT_PREFIX}9222:9222" + volumes: + - ../nats_server.conf:/etc/nats/server.conf + command: [ "--config", "/etc/nats/server.conf" ] + env_file: + - ../devcontainer.env + networks: + - fastagency-network + +networks: + fastagency-network: + name: fastagency-${USER}-network diff --git a/.devcontainer/runtime-python-3.11/devcontainer.json b/.devcontainer/runtime-python-3.11/devcontainer.json new file mode 100644 index 000000000..4f2b3221f --- /dev/null +++ b/.devcontainer/runtime-python-3.11/devcontainer.json @@ -0,0 +1,98 @@ +{ + "name": "ag2-python-3.11", + // "image": "mcr.microsoft.com/devcontainers/python:3.11", + "dockerComposeFile": [ + "./docker-compose.yml" + ], + "service": "python-3.11-fastagency", + "forwardPorts": [ + "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.11:9222" + ], + "secrets": { + "OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are working on OpenAI-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "TOGETHER_API_KEY": { + "description": "This key is optional and only needed if you are working with Together API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "ANTHROPIC_API_KEY": { + "description": "This key is optional and only needed if you are working with Anthropic API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "AZURE_OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are using Azure's OpenAI services. For it to work, you must also set the related environment variables: AZURE_API_ENDPOINT, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL. Leave it blank if not required. You can always set these variables later in the codespace terminal." + }, + "AZURE_API_ENDPOINT": { + "description": "This key is required if you are using Azure's OpenAI services. It must be used in conjunction with AZURE_OPENAI_API_KEY, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL to ensure proper configuration. You can always set these variables later as environment variables in the codespace terminal." + }, + "AZURE_API_VERSION": { + "description": "This key is required to specify the version of the Azure API you are using. Set this along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL for Azure OpenAI services. These variables can be configured later as environment variables in the codespace terminal." + }, + "AZURE_GPT35_MODEL": { + "description": "This key is required if you are using Azure's GPT-3.5 model. Ensure you also set AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT4_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION for full compatibility with Azure OpenAI services. These can be configured later in the codespace terminal as environment variables." + }, + "AZURE_GPT4_MODEL": { + "description": "This key is required if you are using Azure's GPT-4 model. It must be set along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION to properly integrate with Azure's OpenAI services. All keys can be added later as environment variables in the codespace terminal." + }, + "AZURE_GPT4o_MODEL": { + "description": "This key is required if you are using Azure's GPT-4o model. Ensure that AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, and AZURE_API_VERSION are also set. You can always add these later as environment variables in the codespace terminal." + }, + "BING_API_KEY": { + "description": "This key is optional. The WebSurfer agent can work without it, but when added, it uses Bing's search and data services to improve information retrieval. You can always set it later as an environment variable in the codespace terminal." + } + }, + "shutdownAction": "stopCompose", + "workspaceFolder": "/workspaces/fastagency", + // "runArgs": [], + "remoteEnv": {}, + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": true, + "installOhMyZsh": true, + "configureZshAsDefaultShell": true, + "username": "vscode", + "userUid": "1000", + "userGid": "1000" + // "upgradePackages": "true" + }, + // "ghcr.io/devcontainers/features/python:1": {}, + "ghcr.io/devcontainers/features/node:1": {}, + // The below configuration with "version" set to "latest" fails in codespace + // "ghcr.io/devcontainers/features/git:1": { + // "version": "latest", + // "ppa": true + // }, + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/git-lfs:1": {}, + "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} + }, + "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", + "customizations": { + "vscode": { + "settings": { + "python.linting.enabled": true, + "python.testing.pytestEnabled": true, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": "always" + }, + "[python]": { + "editor.defaultFormatter": "ms-python.vscode-pylance" + }, + "editor.rulers": [ + 80 + ] + }, + "extensions": [ + "ms-python.python", + "ms-toolsai.jupyter", + "ms-toolsai.vscode-jupyter-cell-tags", + "ms-toolsai.jupyter-keymap", + "ms-toolsai.jupyter-renderers", + "ms-toolsai.vscode-jupyter-slideshow", + "ms-python.vscode-pylance", + "ms-playwright.playwright" + ] + } + } +} diff --git a/.devcontainer/runtime-python-3.11/docker-compose.yml b/.devcontainer/runtime-python-3.11/docker-compose.yml new file mode 100644 index 000000000..2e08b9619 --- /dev/null +++ b/.devcontainer/runtime-python-3.11/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3' + +services: + python-3.11-fastagency: # nosemgrep + image: mcr.microsoft.com/devcontainers/python:3.11 + container_name: fastagency-${USER}-python-3.11 + volumes: + - ../../:/workspaces/fastagency:cached + command: sleep infinity + environment: + - NATS_URL=nats://fastagency-${USER}-nats-py3.11:4222 + env_file: + - ../devcontainer.env + networks: + - fastagency-network + nats-fastagency: # nosemgrep + image: nats:latest + container_name: fastagency-${USER}-nats-py3.11 + # ports: + # - "${PORT_PREFIX}4222:4222" + # - "${PORT_PREFIX}9222:9222" + volumes: + - ../nats_server.conf:/etc/nats/server.conf + command: [ "--config", "/etc/nats/server.conf" ] + env_file: + - ../devcontainer.env + networks: + - fastagency-network + +networks: + fastagency-network: + name: fastagency-${USER}-network diff --git a/.devcontainer/runtime-python-3.12/devcontainer.json b/.devcontainer/runtime-python-3.12/devcontainer.json new file mode 100644 index 000000000..662616faf --- /dev/null +++ b/.devcontainer/runtime-python-3.12/devcontainer.json @@ -0,0 +1,98 @@ +{ + "name": "ag2-python-3.12", + // "image": "mcr.microsoft.com/devcontainers/python:3.12", + "dockerComposeFile": [ + "./docker-compose.yml" + ], + "service": "python-3.12-fastagency", + "forwardPorts": [ + "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.12:9222" + ], + "secrets": { + "OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are working on OpenAI-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "TOGETHER_API_KEY": { + "description": "This key is optional and only needed if you are working with Together API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "ANTHROPIC_API_KEY": { + "description": "This key is optional and only needed if you are working with Anthropic API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "AZURE_OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are using Azure's OpenAI services. For it to work, you must also set the related environment variables: AZURE_API_ENDPOINT, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL. Leave it blank if not required. You can always set these variables later in the codespace terminal." + }, + "AZURE_API_ENDPOINT": { + "description": "This key is required if you are using Azure's OpenAI services. It must be used in conjunction with AZURE_OPENAI_API_KEY, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL to ensure proper configuration. You can always set these variables later as environment variables in the codespace terminal." + }, + "AZURE_API_VERSION": { + "description": "This key is required to specify the version of the Azure API you are using. Set this along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL for Azure OpenAI services. These variables can be configured later as environment variables in the codespace terminal." + }, + "AZURE_GPT35_MODEL": { + "description": "This key is required if you are using Azure's GPT-3.5 model. Ensure you also set AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT4_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION for full compatibility with Azure OpenAI services. These can be configured later in the codespace terminal as environment variables." + }, + "AZURE_GPT4_MODEL": { + "description": "This key is required if you are using Azure's GPT-4 model. It must be set along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION to properly integrate with Azure's OpenAI services. All keys can be added later as environment variables in the codespace terminal." + }, + "AZURE_GPT4o_MODEL": { + "description": "This key is required if you are using Azure's GPT-4o model. Ensure that AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, and AZURE_API_VERSION are also set. You can always add these later as environment variables in the codespace terminal." + }, + "BING_API_KEY": { + "description": "This key is optional. The WebSurfer agent can work without it, but when added, it uses Bing's search and data services to improve information retrieval. You can always set it later as an environment variable in the codespace terminal." + } + }, + "shutdownAction": "stopCompose", + "workspaceFolder": "/workspaces/fastagency", + // "runArgs": [], + "remoteEnv": {}, + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": true, + "installOhMyZsh": true, + "configureZshAsDefaultShell": true, + "username": "vscode", + "userUid": "1000", + "userGid": "1000" + // "upgradePackages": "true" + }, + // "ghcr.io/devcontainers/features/python:1": {}, + "ghcr.io/devcontainers/features/node:1": {}, + // The below configuration with "version" set to "latest" fails in codespace + // "ghcr.io/devcontainers/features/git:1": { + // "version": "latest", + // "ppa": true + // }, + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/git-lfs:1": {}, + "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} + }, + "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", + "customizations": { + "vscode": { + "settings": { + "python.linting.enabled": true, + "python.testing.pytestEnabled": true, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": "always" + }, + "[python]": { + "editor.defaultFormatter": "ms-python.vscode-pylance" + }, + "editor.rulers": [ + 80 + ] + }, + "extensions": [ + "ms-python.python", + "ms-toolsai.jupyter", + "ms-toolsai.vscode-jupyter-cell-tags", + "ms-toolsai.jupyter-keymap", + "ms-toolsai.jupyter-renderers", + "ms-toolsai.vscode-jupyter-slideshow", + "ms-python.vscode-pylance", + "ms-playwright.playwright" + ] + } + } +} diff --git a/.devcontainer/runtime-python-3.12/docker-compose.yml b/.devcontainer/runtime-python-3.12/docker-compose.yml new file mode 100644 index 000000000..f52afd429 --- /dev/null +++ b/.devcontainer/runtime-python-3.12/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3' + +services: + python-3.12-fastagency: # nosemgrep + image: mcr.microsoft.com/devcontainers/python:3.12 + container_name: fastagency-${USER}-python-3.12 + volumes: + - ../../:/workspaces/fastagency:cached + command: sleep infinity + environment: + - NATS_URL=nats://fastagency-${USER}-nats-py3.12:4222 + env_file: + - ../devcontainer.env + networks: + - fastagency-network + nats-fastagency: # nosemgrep + image: nats:latest + container_name: fastagency-${USER}-nats-py3.12 + # ports: + # - "${PORT_PREFIX}4222:4222" + # - "${PORT_PREFIX}9222:9222" + volumes: + - ../nats_server.conf:/etc/nats/server.conf + command: [ "--config", "/etc/nats/server.conf" ] + env_file: + - ../devcontainer.env + networks: + - fastagency-network + +networks: + fastagency-network: + name: fastagency-${USER}-network diff --git a/.devcontainer/runtime-python-3.9/devcontainer.json b/.devcontainer/runtime-python-3.9/devcontainer.json new file mode 100644 index 000000000..a6d630f13 --- /dev/null +++ b/.devcontainer/runtime-python-3.9/devcontainer.json @@ -0,0 +1,98 @@ +{ + "name": "ag2-python-3.9", + // "image": "mcr.microsoft.com/devcontainers/python:3.9", + "dockerComposeFile": [ + "./docker-compose.yml" + ], + "service": "python-3.9-fastagency", + "forwardPorts": [ + "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.9:9222" + ], + "secrets": { + "OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are working on OpenAI-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "TOGETHER_API_KEY": { + "description": "This key is optional and only needed if you are working with Together API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "ANTHROPIC_API_KEY": { + "description": "This key is optional and only needed if you are working with Anthropic API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "AZURE_OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are using Azure's OpenAI services. For it to work, you must also set the related environment variables: AZURE_API_ENDPOINT, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL. Leave it blank if not required. You can always set these variables later in the codespace terminal." + }, + "AZURE_API_ENDPOINT": { + "description": "This key is required if you are using Azure's OpenAI services. It must be used in conjunction with AZURE_OPENAI_API_KEY, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL to ensure proper configuration. You can always set these variables later as environment variables in the codespace terminal." + }, + "AZURE_API_VERSION": { + "description": "This key is required to specify the version of the Azure API you are using. Set this along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL for Azure OpenAI services. These variables can be configured later as environment variables in the codespace terminal." + }, + "AZURE_GPT35_MODEL": { + "description": "This key is required if you are using Azure's GPT-3.5 model. Ensure you also set AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT4_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION for full compatibility with Azure OpenAI services. These can be configured later in the codespace terminal as environment variables." + }, + "AZURE_GPT4_MODEL": { + "description": "This key is required if you are using Azure's GPT-4 model. It must be set along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION to properly integrate with Azure's OpenAI services. All keys can be added later as environment variables in the codespace terminal." + }, + "AZURE_GPT4o_MODEL": { + "description": "This key is required if you are using Azure's GPT-4o model. Ensure that AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, and AZURE_API_VERSION are also set. You can always add these later as environment variables in the codespace terminal." + }, + "BING_API_KEY": { + "description": "This key is optional. The WebSurfer agent can work without it, but when added, it uses Bing's search and data services to improve information retrieval. You can always set it later as an environment variable in the codespace terminal." + } + }, + "shutdownAction": "stopCompose", + "workspaceFolder": "/workspaces/fastagency", + // "runArgs": [], + "remoteEnv": {}, + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": true, + "installOhMyZsh": true, + "configureZshAsDefaultShell": true, + "username": "vscode", + "userUid": "1000", + "userGid": "1000" + // "upgradePackages": "true" + }, + // "ghcr.io/devcontainers/features/python:1": {}, + "ghcr.io/devcontainers/features/node:1": {}, + // The below configuration with "version" set to "latest" fails in codespace + // "ghcr.io/devcontainers/features/git:1": { + // "version": "latest", + // "ppa": true + // }, + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/git-lfs:1": {}, + "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} + }, + "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", + "customizations": { + "vscode": { + "settings": { + "python.linting.enabled": true, + "python.testing.pytestEnabled": true, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": "always" + }, + "[python]": { + "editor.defaultFormatter": "ms-python.vscode-pylance" + }, + "editor.rulers": [ + 80 + ] + }, + "extensions": [ + "ms-python.python", + "ms-toolsai.jupyter", + "ms-toolsai.vscode-jupyter-cell-tags", + "ms-toolsai.jupyter-keymap", + "ms-toolsai.jupyter-renderers", + "ms-toolsai.vscode-jupyter-slideshow", + "ms-python.vscode-pylance", + "ms-playwright.playwright" + ] + } + } +} diff --git a/.devcontainer/runtime-python-3.9/docker-compose.yml b/.devcontainer/runtime-python-3.9/docker-compose.yml new file mode 100644 index 000000000..281aef70f --- /dev/null +++ b/.devcontainer/runtime-python-3.9/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3' + +services: + python-3.9-fastagency: # nosemgrep + image: mcr.microsoft.com/devcontainers/python:3.9 + container_name: fastagency-${USER}-python-3.9 + volumes: + - ../../:/workspaces/fastagency:cached + command: sleep infinity + environment: + - NATS_URL=nats://fastagency-${USER}-nats-py3.9:4222 + env_file: + - ../devcontainer.env + networks: + - fastagency-network + nats-fastagency: # nosemgrep + image: nats:latest + container_name: fastagency-${USER}-nats-py3.9 + # ports: + # - "${PORT_PREFIX}4222:4222" + # - "${PORT_PREFIX}9222:9222" + volumes: + - ../nats_server.conf:/etc/nats/server.conf + command: [ "--config", "/etc/nats/server.conf" ] + env_file: + - ../devcontainer.env + networks: + - fastagency-network + +networks: + fastagency-network: + name: fastagency-${USER}-network diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ce5c0c4e6..5aceba1bd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -69,6 +69,17 @@ repos: require_serial: true verbose: true + - repo: local + hooks: + - id: devcontainer + name: Build devcontainers + entry: "scripts/devcontainer-build-pre-commit.sh" + language: python + #language_version: python3.10 + files: ^.devcontainer/build_devcontainers.py + require_serial: true + verbose: true + - repo: https://github.com/Yelp/detect-secrets rev: v1.5.0 hooks: diff --git a/scripts/devcontainer-build-pre-commit.sh b/scripts/devcontainer-build-pre-commit.sh new file mode 100755 index 000000000..729fd5bbd --- /dev/null +++ b/scripts/devcontainer-build-pre-commit.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +# from: https://jaredkhan.com/blog/mypy-pre-commit + +# A script for running mypy, +# with all its dependencies installed. + +set -o errexit + +# Change directory to the project root directory. +cd "$(dirname "$0")"/.. + +# Install the dependencies into the mypy env. +# Note that this can take seconds to run. +# In my case, I need to use a custom index URL. +# Avoid pip spending time quietly retrying since +# likely cause of failure is lack of VPN connection. +pip install --editable ".[dev]" \ + --retries 1 \ + --no-input \ + --quiet + +# Run on all files, +# ignoring the paths passed to this script, +# so as not to miss type errors. +# My repo makes use of namespace packages. +# Use the namespace-packages flag +# and specify the package to run on explicitly. +# Note that we do not use --ignore-missing-imports, +# as this can give us false confidence in our results. +# mypy fastagency +python .devcontainer/build_devcontainers.py From d2dd33b1f9d8c5842fdd0ac90f220024351a06ec Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Wed, 20 Nov 2024 09:18:57 +0000 Subject: [PATCH 03/19] autogen-04dev added --- .../devcontainer.json | 0 .../docker-compose.yml | 0 .../devcontainer.json | 0 .../docker-compose.yml | 0 .../devcontainer.json | 0 .../docker-compose.yml | 0 .../devcontainer.json | 0 .../docker-compose.yml | 0 .../autogen-python-3.10/devcontainer.json | 98 +++++++++++++++++++ .../autogen-python-3.10/docker-compose.yml | 32 ++++++ .../autogen-python-3.11/devcontainer.json | 98 +++++++++++++++++++ .../autogen-python-3.11/docker-compose.yml | 32 ++++++ .../autogen-python-3.12/devcontainer.json | 98 +++++++++++++++++++ .../autogen-python-3.12/docker-compose.yml | 32 ++++++ .../autogen-python-3.9/devcontainer.json | 98 +++++++++++++++++++ .../autogen-python-3.9/docker-compose.yml | 32 ++++++ .devcontainer/build_devcontainers.py | 2 +- pyproject.toml | 4 + 18 files changed, 525 insertions(+), 1 deletion(-) rename .devcontainer/{runtime-python-3.10 => autogen-04dev-python-3.10}/devcontainer.json (100%) rename .devcontainer/{runtime-python-3.10 => autogen-04dev-python-3.10}/docker-compose.yml (100%) rename .devcontainer/{runtime-python-3.11 => autogen-04dev-python-3.11}/devcontainer.json (100%) rename .devcontainer/{runtime-python-3.11 => autogen-04dev-python-3.11}/docker-compose.yml (100%) rename .devcontainer/{runtime-python-3.12 => autogen-04dev-python-3.12}/devcontainer.json (100%) rename .devcontainer/{runtime-python-3.12 => autogen-04dev-python-3.12}/docker-compose.yml (100%) rename .devcontainer/{runtime-python-3.9 => autogen-04dev-python-3.9}/devcontainer.json (100%) rename .devcontainer/{runtime-python-3.9 => autogen-04dev-python-3.9}/docker-compose.yml (100%) create mode 100644 .devcontainer/autogen-python-3.10/devcontainer.json create mode 100644 .devcontainer/autogen-python-3.10/docker-compose.yml create mode 100644 .devcontainer/autogen-python-3.11/devcontainer.json create mode 100644 .devcontainer/autogen-python-3.11/docker-compose.yml create mode 100644 .devcontainer/autogen-python-3.12/devcontainer.json create mode 100644 .devcontainer/autogen-python-3.12/docker-compose.yml create mode 100644 .devcontainer/autogen-python-3.9/devcontainer.json create mode 100644 .devcontainer/autogen-python-3.9/docker-compose.yml diff --git a/.devcontainer/runtime-python-3.10/devcontainer.json b/.devcontainer/autogen-04dev-python-3.10/devcontainer.json similarity index 100% rename from .devcontainer/runtime-python-3.10/devcontainer.json rename to .devcontainer/autogen-04dev-python-3.10/devcontainer.json diff --git a/.devcontainer/runtime-python-3.10/docker-compose.yml b/.devcontainer/autogen-04dev-python-3.10/docker-compose.yml similarity index 100% rename from .devcontainer/runtime-python-3.10/docker-compose.yml rename to .devcontainer/autogen-04dev-python-3.10/docker-compose.yml diff --git a/.devcontainer/runtime-python-3.11/devcontainer.json b/.devcontainer/autogen-04dev-python-3.11/devcontainer.json similarity index 100% rename from .devcontainer/runtime-python-3.11/devcontainer.json rename to .devcontainer/autogen-04dev-python-3.11/devcontainer.json diff --git a/.devcontainer/runtime-python-3.11/docker-compose.yml b/.devcontainer/autogen-04dev-python-3.11/docker-compose.yml similarity index 100% rename from .devcontainer/runtime-python-3.11/docker-compose.yml rename to .devcontainer/autogen-04dev-python-3.11/docker-compose.yml diff --git a/.devcontainer/runtime-python-3.12/devcontainer.json b/.devcontainer/autogen-04dev-python-3.12/devcontainer.json similarity index 100% rename from .devcontainer/runtime-python-3.12/devcontainer.json rename to .devcontainer/autogen-04dev-python-3.12/devcontainer.json diff --git a/.devcontainer/runtime-python-3.12/docker-compose.yml b/.devcontainer/autogen-04dev-python-3.12/docker-compose.yml similarity index 100% rename from .devcontainer/runtime-python-3.12/docker-compose.yml rename to .devcontainer/autogen-04dev-python-3.12/docker-compose.yml diff --git a/.devcontainer/runtime-python-3.9/devcontainer.json b/.devcontainer/autogen-04dev-python-3.9/devcontainer.json similarity index 100% rename from .devcontainer/runtime-python-3.9/devcontainer.json rename to .devcontainer/autogen-04dev-python-3.9/devcontainer.json diff --git a/.devcontainer/runtime-python-3.9/docker-compose.yml b/.devcontainer/autogen-04dev-python-3.9/docker-compose.yml similarity index 100% rename from .devcontainer/runtime-python-3.9/docker-compose.yml rename to .devcontainer/autogen-04dev-python-3.9/docker-compose.yml diff --git a/.devcontainer/autogen-python-3.10/devcontainer.json b/.devcontainer/autogen-python-3.10/devcontainer.json new file mode 100644 index 000000000..ea6521fa1 --- /dev/null +++ b/.devcontainer/autogen-python-3.10/devcontainer.json @@ -0,0 +1,98 @@ +{ + "name": "ag2-python-3.10", + // "image": "mcr.microsoft.com/devcontainers/python:3.10", + "dockerComposeFile": [ + "./docker-compose.yml" + ], + "service": "python-3.10-fastagency", + "forwardPorts": [ + "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.10:9222" + ], + "secrets": { + "OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are working on OpenAI-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "TOGETHER_API_KEY": { + "description": "This key is optional and only needed if you are working with Together API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "ANTHROPIC_API_KEY": { + "description": "This key is optional and only needed if you are working with Anthropic API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "AZURE_OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are using Azure's OpenAI services. For it to work, you must also set the related environment variables: AZURE_API_ENDPOINT, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL. Leave it blank if not required. You can always set these variables later in the codespace terminal." + }, + "AZURE_API_ENDPOINT": { + "description": "This key is required if you are using Azure's OpenAI services. It must be used in conjunction with AZURE_OPENAI_API_KEY, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL to ensure proper configuration. You can always set these variables later as environment variables in the codespace terminal." + }, + "AZURE_API_VERSION": { + "description": "This key is required to specify the version of the Azure API you are using. Set this along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL for Azure OpenAI services. These variables can be configured later as environment variables in the codespace terminal." + }, + "AZURE_GPT35_MODEL": { + "description": "This key is required if you are using Azure's GPT-3.5 model. Ensure you also set AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT4_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION for full compatibility with Azure OpenAI services. These can be configured later in the codespace terminal as environment variables." + }, + "AZURE_GPT4_MODEL": { + "description": "This key is required if you are using Azure's GPT-4 model. It must be set along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION to properly integrate with Azure's OpenAI services. All keys can be added later as environment variables in the codespace terminal." + }, + "AZURE_GPT4o_MODEL": { + "description": "This key is required if you are using Azure's GPT-4o model. Ensure that AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, and AZURE_API_VERSION are also set. You can always add these later as environment variables in the codespace terminal." + }, + "BING_API_KEY": { + "description": "This key is optional. The WebSurfer agent can work without it, but when added, it uses Bing's search and data services to improve information retrieval. You can always set it later as an environment variable in the codespace terminal." + } + }, + "shutdownAction": "stopCompose", + "workspaceFolder": "/workspaces/fastagency", + // "runArgs": [], + "remoteEnv": {}, + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": true, + "installOhMyZsh": true, + "configureZshAsDefaultShell": true, + "username": "vscode", + "userUid": "1000", + "userGid": "1000" + // "upgradePackages": "true" + }, + // "ghcr.io/devcontainers/features/python:1": {}, + "ghcr.io/devcontainers/features/node:1": {}, + // The below configuration with "version" set to "latest" fails in codespace + // "ghcr.io/devcontainers/features/git:1": { + // "version": "latest", + // "ppa": true + // }, + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/git-lfs:1": {}, + "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} + }, + "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", + "customizations": { + "vscode": { + "settings": { + "python.linting.enabled": true, + "python.testing.pytestEnabled": true, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": "always" + }, + "[python]": { + "editor.defaultFormatter": "ms-python.vscode-pylance" + }, + "editor.rulers": [ + 80 + ] + }, + "extensions": [ + "ms-python.python", + "ms-toolsai.jupyter", + "ms-toolsai.vscode-jupyter-cell-tags", + "ms-toolsai.jupyter-keymap", + "ms-toolsai.jupyter-renderers", + "ms-toolsai.vscode-jupyter-slideshow", + "ms-python.vscode-pylance", + "ms-playwright.playwright" + ] + } + } +} diff --git a/.devcontainer/autogen-python-3.10/docker-compose.yml b/.devcontainer/autogen-python-3.10/docker-compose.yml new file mode 100644 index 000000000..762d7cac1 --- /dev/null +++ b/.devcontainer/autogen-python-3.10/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3' + +services: + python-3.10-fastagency: # nosemgrep + image: mcr.microsoft.com/devcontainers/python:3.10 + container_name: fastagency-${USER}-python-3.10 + volumes: + - ../../:/workspaces/fastagency:cached + command: sleep infinity + environment: + - NATS_URL=nats://fastagency-${USER}-nats-py3.10:4222 + env_file: + - ../devcontainer.env + networks: + - fastagency-network + nats-fastagency: # nosemgrep + image: nats:latest + container_name: fastagency-${USER}-nats-py3.10 + # ports: + # - "${PORT_PREFIX}4222:4222" + # - "${PORT_PREFIX}9222:9222" + volumes: + - ../nats_server.conf:/etc/nats/server.conf + command: [ "--config", "/etc/nats/server.conf" ] + env_file: + - ../devcontainer.env + networks: + - fastagency-network + +networks: + fastagency-network: + name: fastagency-${USER}-network diff --git a/.devcontainer/autogen-python-3.11/devcontainer.json b/.devcontainer/autogen-python-3.11/devcontainer.json new file mode 100644 index 000000000..4f2b3221f --- /dev/null +++ b/.devcontainer/autogen-python-3.11/devcontainer.json @@ -0,0 +1,98 @@ +{ + "name": "ag2-python-3.11", + // "image": "mcr.microsoft.com/devcontainers/python:3.11", + "dockerComposeFile": [ + "./docker-compose.yml" + ], + "service": "python-3.11-fastagency", + "forwardPorts": [ + "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.11:9222" + ], + "secrets": { + "OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are working on OpenAI-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "TOGETHER_API_KEY": { + "description": "This key is optional and only needed if you are working with Together API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "ANTHROPIC_API_KEY": { + "description": "This key is optional and only needed if you are working with Anthropic API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "AZURE_OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are using Azure's OpenAI services. For it to work, you must also set the related environment variables: AZURE_API_ENDPOINT, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL. Leave it blank if not required. You can always set these variables later in the codespace terminal." + }, + "AZURE_API_ENDPOINT": { + "description": "This key is required if you are using Azure's OpenAI services. It must be used in conjunction with AZURE_OPENAI_API_KEY, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL to ensure proper configuration. You can always set these variables later as environment variables in the codespace terminal." + }, + "AZURE_API_VERSION": { + "description": "This key is required to specify the version of the Azure API you are using. Set this along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL for Azure OpenAI services. These variables can be configured later as environment variables in the codespace terminal." + }, + "AZURE_GPT35_MODEL": { + "description": "This key is required if you are using Azure's GPT-3.5 model. Ensure you also set AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT4_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION for full compatibility with Azure OpenAI services. These can be configured later in the codespace terminal as environment variables." + }, + "AZURE_GPT4_MODEL": { + "description": "This key is required if you are using Azure's GPT-4 model. It must be set along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION to properly integrate with Azure's OpenAI services. All keys can be added later as environment variables in the codespace terminal." + }, + "AZURE_GPT4o_MODEL": { + "description": "This key is required if you are using Azure's GPT-4o model. Ensure that AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, and AZURE_API_VERSION are also set. You can always add these later as environment variables in the codespace terminal." + }, + "BING_API_KEY": { + "description": "This key is optional. The WebSurfer agent can work without it, but when added, it uses Bing's search and data services to improve information retrieval. You can always set it later as an environment variable in the codespace terminal." + } + }, + "shutdownAction": "stopCompose", + "workspaceFolder": "/workspaces/fastagency", + // "runArgs": [], + "remoteEnv": {}, + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": true, + "installOhMyZsh": true, + "configureZshAsDefaultShell": true, + "username": "vscode", + "userUid": "1000", + "userGid": "1000" + // "upgradePackages": "true" + }, + // "ghcr.io/devcontainers/features/python:1": {}, + "ghcr.io/devcontainers/features/node:1": {}, + // The below configuration with "version" set to "latest" fails in codespace + // "ghcr.io/devcontainers/features/git:1": { + // "version": "latest", + // "ppa": true + // }, + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/git-lfs:1": {}, + "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} + }, + "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", + "customizations": { + "vscode": { + "settings": { + "python.linting.enabled": true, + "python.testing.pytestEnabled": true, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": "always" + }, + "[python]": { + "editor.defaultFormatter": "ms-python.vscode-pylance" + }, + "editor.rulers": [ + 80 + ] + }, + "extensions": [ + "ms-python.python", + "ms-toolsai.jupyter", + "ms-toolsai.vscode-jupyter-cell-tags", + "ms-toolsai.jupyter-keymap", + "ms-toolsai.jupyter-renderers", + "ms-toolsai.vscode-jupyter-slideshow", + "ms-python.vscode-pylance", + "ms-playwright.playwright" + ] + } + } +} diff --git a/.devcontainer/autogen-python-3.11/docker-compose.yml b/.devcontainer/autogen-python-3.11/docker-compose.yml new file mode 100644 index 000000000..2e08b9619 --- /dev/null +++ b/.devcontainer/autogen-python-3.11/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3' + +services: + python-3.11-fastagency: # nosemgrep + image: mcr.microsoft.com/devcontainers/python:3.11 + container_name: fastagency-${USER}-python-3.11 + volumes: + - ../../:/workspaces/fastagency:cached + command: sleep infinity + environment: + - NATS_URL=nats://fastagency-${USER}-nats-py3.11:4222 + env_file: + - ../devcontainer.env + networks: + - fastagency-network + nats-fastagency: # nosemgrep + image: nats:latest + container_name: fastagency-${USER}-nats-py3.11 + # ports: + # - "${PORT_PREFIX}4222:4222" + # - "${PORT_PREFIX}9222:9222" + volumes: + - ../nats_server.conf:/etc/nats/server.conf + command: [ "--config", "/etc/nats/server.conf" ] + env_file: + - ../devcontainer.env + networks: + - fastagency-network + +networks: + fastagency-network: + name: fastagency-${USER}-network diff --git a/.devcontainer/autogen-python-3.12/devcontainer.json b/.devcontainer/autogen-python-3.12/devcontainer.json new file mode 100644 index 000000000..662616faf --- /dev/null +++ b/.devcontainer/autogen-python-3.12/devcontainer.json @@ -0,0 +1,98 @@ +{ + "name": "ag2-python-3.12", + // "image": "mcr.microsoft.com/devcontainers/python:3.12", + "dockerComposeFile": [ + "./docker-compose.yml" + ], + "service": "python-3.12-fastagency", + "forwardPorts": [ + "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.12:9222" + ], + "secrets": { + "OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are working on OpenAI-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "TOGETHER_API_KEY": { + "description": "This key is optional and only needed if you are working with Together API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "ANTHROPIC_API_KEY": { + "description": "This key is optional and only needed if you are working with Anthropic API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "AZURE_OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are using Azure's OpenAI services. For it to work, you must also set the related environment variables: AZURE_API_ENDPOINT, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL. Leave it blank if not required. You can always set these variables later in the codespace terminal." + }, + "AZURE_API_ENDPOINT": { + "description": "This key is required if you are using Azure's OpenAI services. It must be used in conjunction with AZURE_OPENAI_API_KEY, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL to ensure proper configuration. You can always set these variables later as environment variables in the codespace terminal." + }, + "AZURE_API_VERSION": { + "description": "This key is required to specify the version of the Azure API you are using. Set this along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL for Azure OpenAI services. These variables can be configured later as environment variables in the codespace terminal." + }, + "AZURE_GPT35_MODEL": { + "description": "This key is required if you are using Azure's GPT-3.5 model. Ensure you also set AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT4_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION for full compatibility with Azure OpenAI services. These can be configured later in the codespace terminal as environment variables." + }, + "AZURE_GPT4_MODEL": { + "description": "This key is required if you are using Azure's GPT-4 model. It must be set along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION to properly integrate with Azure's OpenAI services. All keys can be added later as environment variables in the codespace terminal." + }, + "AZURE_GPT4o_MODEL": { + "description": "This key is required if you are using Azure's GPT-4o model. Ensure that AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, and AZURE_API_VERSION are also set. You can always add these later as environment variables in the codespace terminal." + }, + "BING_API_KEY": { + "description": "This key is optional. The WebSurfer agent can work without it, but when added, it uses Bing's search and data services to improve information retrieval. You can always set it later as an environment variable in the codespace terminal." + } + }, + "shutdownAction": "stopCompose", + "workspaceFolder": "/workspaces/fastagency", + // "runArgs": [], + "remoteEnv": {}, + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": true, + "installOhMyZsh": true, + "configureZshAsDefaultShell": true, + "username": "vscode", + "userUid": "1000", + "userGid": "1000" + // "upgradePackages": "true" + }, + // "ghcr.io/devcontainers/features/python:1": {}, + "ghcr.io/devcontainers/features/node:1": {}, + // The below configuration with "version" set to "latest" fails in codespace + // "ghcr.io/devcontainers/features/git:1": { + // "version": "latest", + // "ppa": true + // }, + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/git-lfs:1": {}, + "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} + }, + "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", + "customizations": { + "vscode": { + "settings": { + "python.linting.enabled": true, + "python.testing.pytestEnabled": true, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": "always" + }, + "[python]": { + "editor.defaultFormatter": "ms-python.vscode-pylance" + }, + "editor.rulers": [ + 80 + ] + }, + "extensions": [ + "ms-python.python", + "ms-toolsai.jupyter", + "ms-toolsai.vscode-jupyter-cell-tags", + "ms-toolsai.jupyter-keymap", + "ms-toolsai.jupyter-renderers", + "ms-toolsai.vscode-jupyter-slideshow", + "ms-python.vscode-pylance", + "ms-playwright.playwright" + ] + } + } +} diff --git a/.devcontainer/autogen-python-3.12/docker-compose.yml b/.devcontainer/autogen-python-3.12/docker-compose.yml new file mode 100644 index 000000000..f52afd429 --- /dev/null +++ b/.devcontainer/autogen-python-3.12/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3' + +services: + python-3.12-fastagency: # nosemgrep + image: mcr.microsoft.com/devcontainers/python:3.12 + container_name: fastagency-${USER}-python-3.12 + volumes: + - ../../:/workspaces/fastagency:cached + command: sleep infinity + environment: + - NATS_URL=nats://fastagency-${USER}-nats-py3.12:4222 + env_file: + - ../devcontainer.env + networks: + - fastagency-network + nats-fastagency: # nosemgrep + image: nats:latest + container_name: fastagency-${USER}-nats-py3.12 + # ports: + # - "${PORT_PREFIX}4222:4222" + # - "${PORT_PREFIX}9222:9222" + volumes: + - ../nats_server.conf:/etc/nats/server.conf + command: [ "--config", "/etc/nats/server.conf" ] + env_file: + - ../devcontainer.env + networks: + - fastagency-network + +networks: + fastagency-network: + name: fastagency-${USER}-network diff --git a/.devcontainer/autogen-python-3.9/devcontainer.json b/.devcontainer/autogen-python-3.9/devcontainer.json new file mode 100644 index 000000000..a6d630f13 --- /dev/null +++ b/.devcontainer/autogen-python-3.9/devcontainer.json @@ -0,0 +1,98 @@ +{ + "name": "ag2-python-3.9", + // "image": "mcr.microsoft.com/devcontainers/python:3.9", + "dockerComposeFile": [ + "./docker-compose.yml" + ], + "service": "python-3.9-fastagency", + "forwardPorts": [ + "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.9:9222" + ], + "secrets": { + "OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are working on OpenAI-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "TOGETHER_API_KEY": { + "description": "This key is optional and only needed if you are working with Together API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "ANTHROPIC_API_KEY": { + "description": "This key is optional and only needed if you are working with Anthropic API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." + }, + "AZURE_OPENAI_API_KEY": { + "description": "This key is optional and only needed if you are using Azure's OpenAI services. For it to work, you must also set the related environment variables: AZURE_API_ENDPOINT, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL. Leave it blank if not required. You can always set these variables later in the codespace terminal." + }, + "AZURE_API_ENDPOINT": { + "description": "This key is required if you are using Azure's OpenAI services. It must be used in conjunction with AZURE_OPENAI_API_KEY, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL to ensure proper configuration. You can always set these variables later as environment variables in the codespace terminal." + }, + "AZURE_API_VERSION": { + "description": "This key is required to specify the version of the Azure API you are using. Set this along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL for Azure OpenAI services. These variables can be configured later as environment variables in the codespace terminal." + }, + "AZURE_GPT35_MODEL": { + "description": "This key is required if you are using Azure's GPT-3.5 model. Ensure you also set AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT4_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION for full compatibility with Azure OpenAI services. These can be configured later in the codespace terminal as environment variables." + }, + "AZURE_GPT4_MODEL": { + "description": "This key is required if you are using Azure's GPT-4 model. It must be set along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION to properly integrate with Azure's OpenAI services. All keys can be added later as environment variables in the codespace terminal." + }, + "AZURE_GPT4o_MODEL": { + "description": "This key is required if you are using Azure's GPT-4o model. Ensure that AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, and AZURE_API_VERSION are also set. You can always add these later as environment variables in the codespace terminal." + }, + "BING_API_KEY": { + "description": "This key is optional. The WebSurfer agent can work without it, but when added, it uses Bing's search and data services to improve information retrieval. You can always set it later as an environment variable in the codespace terminal." + } + }, + "shutdownAction": "stopCompose", + "workspaceFolder": "/workspaces/fastagency", + // "runArgs": [], + "remoteEnv": {}, + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": true, + "installOhMyZsh": true, + "configureZshAsDefaultShell": true, + "username": "vscode", + "userUid": "1000", + "userGid": "1000" + // "upgradePackages": "true" + }, + // "ghcr.io/devcontainers/features/python:1": {}, + "ghcr.io/devcontainers/features/node:1": {}, + // The below configuration with "version" set to "latest" fails in codespace + // "ghcr.io/devcontainers/features/git:1": { + // "version": "latest", + // "ppa": true + // }, + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/git-lfs:1": {}, + "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} + }, + "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", + "customizations": { + "vscode": { + "settings": { + "python.linting.enabled": true, + "python.testing.pytestEnabled": true, + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.organizeImports": "always" + }, + "[python]": { + "editor.defaultFormatter": "ms-python.vscode-pylance" + }, + "editor.rulers": [ + 80 + ] + }, + "extensions": [ + "ms-python.python", + "ms-toolsai.jupyter", + "ms-toolsai.vscode-jupyter-cell-tags", + "ms-toolsai.jupyter-keymap", + "ms-toolsai.jupyter-renderers", + "ms-toolsai.vscode-jupyter-slideshow", + "ms-python.vscode-pylance", + "ms-playwright.playwright" + ] + } + } +} diff --git a/.devcontainer/autogen-python-3.9/docker-compose.yml b/.devcontainer/autogen-python-3.9/docker-compose.yml new file mode 100644 index 000000000..281aef70f --- /dev/null +++ b/.devcontainer/autogen-python-3.9/docker-compose.yml @@ -0,0 +1,32 @@ +version: '3' + +services: + python-3.9-fastagency: # nosemgrep + image: mcr.microsoft.com/devcontainers/python:3.9 + container_name: fastagency-${USER}-python-3.9 + volumes: + - ../../:/workspaces/fastagency:cached + command: sleep infinity + environment: + - NATS_URL=nats://fastagency-${USER}-nats-py3.9:4222 + env_file: + - ../devcontainer.env + networks: + - fastagency-network + nats-fastagency: # nosemgrep + image: nats:latest + container_name: fastagency-${USER}-nats-py3.9 + # ports: + # - "${PORT_PREFIX}4222:4222" + # - "${PORT_PREFIX}9222:9222" + volumes: + - ../nats_server.conf:/etc/nats/server.conf + command: [ "--config", "/etc/nats/server.conf" ] + env_file: + - ../devcontainer.env + networks: + - fastagency-network + +networks: + fastagency-network: + name: fastagency-${USER}-network diff --git a/.devcontainer/build_devcontainers.py b/.devcontainer/build_devcontainers.py index 653f8c88c..333a47d6f 100755 --- a/.devcontainer/build_devcontainers.py +++ b/.devcontainer/build_devcontainers.py @@ -142,7 +142,7 @@ def write_files(): for python in ["3.9", "3.10", "3.11", "3.12"]: - for runtime in ["ag2", "runtime"]: + for runtime in ["ag2", "autogen", "autogen-04dev"]: dir_path = root_path / f"{runtime}-python-{python}" dir_path.mkdir(exist_ok=True, parents=True) diff --git a/pyproject.toml b/pyproject.toml index ce4fb6992..b08a47d75 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,6 +62,10 @@ autogen = [ "markdownify==0.13.1", # Needed by autogen.WebSurferAgent but not included ] +autogen-04dev = [ + "autogen-agentchat==0.4.0.dev6", +] + ag2 = [ "ag2[anthropic,together]>=0.3.0,<0.4", "together>=1.2.11,<1.3", # ToDo: together 1.3.0 has issues with our dev dependencies From c36494d4fcbb1823c1e5e4eb2020ed2d173c5c66 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Wed, 20 Nov 2024 09:34:22 +0000 Subject: [PATCH 04/19] fixes --- .devcontainer/autogen-04dev-python-3.10/devcontainer.json | 2 +- .devcontainer/autogen-04dev-python-3.11/devcontainer.json | 2 +- .devcontainer/autogen-04dev-python-3.12/devcontainer.json | 2 +- .devcontainer/autogen-04dev-python-3.9/devcontainer.json | 2 +- .devcontainer/autogen-python-3.10/devcontainer.json | 2 +- .devcontainer/autogen-python-3.11/devcontainer.json | 2 +- .devcontainer/autogen-python-3.12/devcontainer.json | 2 +- .devcontainer/autogen-python-3.9/devcontainer.json | 2 +- .devcontainer/build_devcontainers.py | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.devcontainer/autogen-04dev-python-3.10/devcontainer.json b/.devcontainer/autogen-04dev-python-3.10/devcontainer.json index ea6521fa1..fcb814d82 100644 --- a/.devcontainer/autogen-04dev-python-3.10/devcontainer.json +++ b/.devcontainer/autogen-04dev-python-3.10/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "ag2-python-3.10", + "name": "autogen-04dev-python-3.10", // "image": "mcr.microsoft.com/devcontainers/python:3.10", "dockerComposeFile": [ "./docker-compose.yml" diff --git a/.devcontainer/autogen-04dev-python-3.11/devcontainer.json b/.devcontainer/autogen-04dev-python-3.11/devcontainer.json index 4f2b3221f..ea5700ff2 100644 --- a/.devcontainer/autogen-04dev-python-3.11/devcontainer.json +++ b/.devcontainer/autogen-04dev-python-3.11/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "ag2-python-3.11", + "name": "autogen-04dev-python-3.11", // "image": "mcr.microsoft.com/devcontainers/python:3.11", "dockerComposeFile": [ "./docker-compose.yml" diff --git a/.devcontainer/autogen-04dev-python-3.12/devcontainer.json b/.devcontainer/autogen-04dev-python-3.12/devcontainer.json index 662616faf..f62824ebf 100644 --- a/.devcontainer/autogen-04dev-python-3.12/devcontainer.json +++ b/.devcontainer/autogen-04dev-python-3.12/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "ag2-python-3.12", + "name": "autogen-04dev-python-3.12", // "image": "mcr.microsoft.com/devcontainers/python:3.12", "dockerComposeFile": [ "./docker-compose.yml" diff --git a/.devcontainer/autogen-04dev-python-3.9/devcontainer.json b/.devcontainer/autogen-04dev-python-3.9/devcontainer.json index a6d630f13..ef17613f8 100644 --- a/.devcontainer/autogen-04dev-python-3.9/devcontainer.json +++ b/.devcontainer/autogen-04dev-python-3.9/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "ag2-python-3.9", + "name": "autogen-04dev-python-3.9", // "image": "mcr.microsoft.com/devcontainers/python:3.9", "dockerComposeFile": [ "./docker-compose.yml" diff --git a/.devcontainer/autogen-python-3.10/devcontainer.json b/.devcontainer/autogen-python-3.10/devcontainer.json index ea6521fa1..eb262e8cc 100644 --- a/.devcontainer/autogen-python-3.10/devcontainer.json +++ b/.devcontainer/autogen-python-3.10/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "ag2-python-3.10", + "name": "autogen-python-3.10", // "image": "mcr.microsoft.com/devcontainers/python:3.10", "dockerComposeFile": [ "./docker-compose.yml" diff --git a/.devcontainer/autogen-python-3.11/devcontainer.json b/.devcontainer/autogen-python-3.11/devcontainer.json index 4f2b3221f..48eeb75cf 100644 --- a/.devcontainer/autogen-python-3.11/devcontainer.json +++ b/.devcontainer/autogen-python-3.11/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "ag2-python-3.11", + "name": "autogen-python-3.11", // "image": "mcr.microsoft.com/devcontainers/python:3.11", "dockerComposeFile": [ "./docker-compose.yml" diff --git a/.devcontainer/autogen-python-3.12/devcontainer.json b/.devcontainer/autogen-python-3.12/devcontainer.json index 662616faf..6deae5bda 100644 --- a/.devcontainer/autogen-python-3.12/devcontainer.json +++ b/.devcontainer/autogen-python-3.12/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "ag2-python-3.12", + "name": "autogen-python-3.12", // "image": "mcr.microsoft.com/devcontainers/python:3.12", "dockerComposeFile": [ "./docker-compose.yml" diff --git a/.devcontainer/autogen-python-3.9/devcontainer.json b/.devcontainer/autogen-python-3.9/devcontainer.json index a6d630f13..5bd4cd9cb 100644 --- a/.devcontainer/autogen-python-3.9/devcontainer.json +++ b/.devcontainer/autogen-python-3.9/devcontainer.json @@ -1,5 +1,5 @@ { - "name": "ag2-python-3.9", + "name": "autogen-python-3.9", // "image": "mcr.microsoft.com/devcontainers/python:3.9", "dockerComposeFile": [ "./docker-compose.yml" diff --git a/.devcontainer/build_devcontainers.py b/.devcontainer/build_devcontainers.py index 333a47d6f..85ae6498d 100755 --- a/.devcontainer/build_devcontainers.py +++ b/.devcontainer/build_devcontainers.py @@ -39,7 +39,7 @@ """ devcontainer = """{{ - "name": "ag2-python-{python}", + "name": "{runtime}-python-{python}", // "image": "mcr.microsoft.com/devcontainers/python:{python}", "dockerComposeFile": [ "./docker-compose.yml" From f25d3317660d5f1fcf7fcca9aa298ba5e7163905 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Wed, 20 Nov 2024 10:42:38 +0100 Subject: [PATCH 05/19] fixes --- .devcontainer/autogen-04dev-python-3.10/devcontainer.json | 2 +- .devcontainer/autogen-04dev-python-3.11/devcontainer.json | 2 +- .devcontainer/autogen-04dev-python-3.12/devcontainer.json | 2 +- .devcontainer/autogen-04dev-python-3.9/devcontainer.json | 2 +- .devcontainer/autogen-python-3.10/devcontainer.json | 2 +- .devcontainer/autogen-python-3.11/devcontainer.json | 2 +- .devcontainer/autogen-python-3.12/devcontainer.json | 2 +- .devcontainer/autogen-python-3.9/devcontainer.json | 2 +- .devcontainer/build_devcontainers.py | 2 +- .devcontainer/setup-autogen-04dev.sh | 8 ++++++++ .devcontainer/setup-autogen.sh | 8 ++++++++ 11 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 .devcontainer/setup-autogen-04dev.sh create mode 100644 .devcontainer/setup-autogen.sh diff --git a/.devcontainer/autogen-04dev-python-3.10/devcontainer.json b/.devcontainer/autogen-04dev-python-3.10/devcontainer.json index fcb814d82..2cf70af0c 100644 --- a/.devcontainer/autogen-04dev-python-3.10/devcontainer.json +++ b/.devcontainer/autogen-04dev-python-3.10/devcontainer.json @@ -65,7 +65,7 @@ "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} }, - "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "updateContentCommand": "bash .devcontainer/setup-autogen-04dev.sh", "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", "customizations": { "vscode": { diff --git a/.devcontainer/autogen-04dev-python-3.11/devcontainer.json b/.devcontainer/autogen-04dev-python-3.11/devcontainer.json index ea5700ff2..40b034b7c 100644 --- a/.devcontainer/autogen-04dev-python-3.11/devcontainer.json +++ b/.devcontainer/autogen-04dev-python-3.11/devcontainer.json @@ -65,7 +65,7 @@ "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} }, - "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "updateContentCommand": "bash .devcontainer/setup-autogen-04dev.sh", "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", "customizations": { "vscode": { diff --git a/.devcontainer/autogen-04dev-python-3.12/devcontainer.json b/.devcontainer/autogen-04dev-python-3.12/devcontainer.json index f62824ebf..9cb665edb 100644 --- a/.devcontainer/autogen-04dev-python-3.12/devcontainer.json +++ b/.devcontainer/autogen-04dev-python-3.12/devcontainer.json @@ -65,7 +65,7 @@ "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} }, - "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "updateContentCommand": "bash .devcontainer/setup-autogen-04dev.sh", "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", "customizations": { "vscode": { diff --git a/.devcontainer/autogen-04dev-python-3.9/devcontainer.json b/.devcontainer/autogen-04dev-python-3.9/devcontainer.json index ef17613f8..2d944ffe9 100644 --- a/.devcontainer/autogen-04dev-python-3.9/devcontainer.json +++ b/.devcontainer/autogen-04dev-python-3.9/devcontainer.json @@ -65,7 +65,7 @@ "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} }, - "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "updateContentCommand": "bash .devcontainer/setup-autogen-04dev.sh", "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", "customizations": { "vscode": { diff --git a/.devcontainer/autogen-python-3.10/devcontainer.json b/.devcontainer/autogen-python-3.10/devcontainer.json index eb262e8cc..28100e452 100644 --- a/.devcontainer/autogen-python-3.10/devcontainer.json +++ b/.devcontainer/autogen-python-3.10/devcontainer.json @@ -65,7 +65,7 @@ "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} }, - "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "updateContentCommand": "bash .devcontainer/setup-autogen.sh", "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", "customizations": { "vscode": { diff --git a/.devcontainer/autogen-python-3.11/devcontainer.json b/.devcontainer/autogen-python-3.11/devcontainer.json index 48eeb75cf..694a7edc0 100644 --- a/.devcontainer/autogen-python-3.11/devcontainer.json +++ b/.devcontainer/autogen-python-3.11/devcontainer.json @@ -65,7 +65,7 @@ "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} }, - "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "updateContentCommand": "bash .devcontainer/setup-autogen.sh", "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", "customizations": { "vscode": { diff --git a/.devcontainer/autogen-python-3.12/devcontainer.json b/.devcontainer/autogen-python-3.12/devcontainer.json index 6deae5bda..bd87d5f96 100644 --- a/.devcontainer/autogen-python-3.12/devcontainer.json +++ b/.devcontainer/autogen-python-3.12/devcontainer.json @@ -65,7 +65,7 @@ "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} }, - "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "updateContentCommand": "bash .devcontainer/setup-autogen.sh", "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", "customizations": { "vscode": { diff --git a/.devcontainer/autogen-python-3.9/devcontainer.json b/.devcontainer/autogen-python-3.9/devcontainer.json index 5bd4cd9cb..19a1b5d26 100644 --- a/.devcontainer/autogen-python-3.9/devcontainer.json +++ b/.devcontainer/autogen-python-3.9/devcontainer.json @@ -65,7 +65,7 @@ "ghcr.io/devcontainers/features/git-lfs:1": {}, "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} }, - "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "updateContentCommand": "bash .devcontainer/setup-autogen.sh", "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", "customizations": { "vscode": { diff --git a/.devcontainer/build_devcontainers.py b/.devcontainer/build_devcontainers.py index 85ae6498d..4a7b5d15b 100755 --- a/.devcontainer/build_devcontainers.py +++ b/.devcontainer/build_devcontainers.py @@ -105,7 +105,7 @@ "ghcr.io/devcontainers/features/git-lfs:1": {{}}, "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {{}} }}, - "updateContentCommand": "bash .devcontainer/setup-ag2.sh", + "updateContentCommand": "bash .devcontainer/setup-{runtime}.sh", "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", "customizations": {{ "vscode": {{ diff --git a/.devcontainer/setup-autogen-04dev.sh b/.devcontainer/setup-autogen-04dev.sh new file mode 100644 index 000000000..4eab3a29c --- /dev/null +++ b/.devcontainer/setup-autogen-04dev.sh @@ -0,0 +1,8 @@ +# update pip +pip install --upgrade pip + +# install dev packages +pip install -e ".[dev-autogen]" + +# install pre-commit hook if not installed already +pre-commit install diff --git a/.devcontainer/setup-autogen.sh b/.devcontainer/setup-autogen.sh new file mode 100644 index 000000000..4eab3a29c --- /dev/null +++ b/.devcontainer/setup-autogen.sh @@ -0,0 +1,8 @@ +# update pip +pip install --upgrade pip + +# install dev packages +pip install -e ".[dev-autogen]" + +# install pre-commit hook if not installed already +pre-commit install From 9018ad63fc79c9e80a53a87113d8a8611823065e Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Wed, 20 Nov 2024 09:56:13 +0000 Subject: [PATCH 06/19] fixes --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5aceba1bd..051bd410a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -76,7 +76,7 @@ repos: entry: "scripts/devcontainer-build-pre-commit.sh" language: python #language_version: python3.10 - files: ^.devcontainer/build_devcontainers.py + files: ^.devcontainer require_serial: true verbose: true From 84ae0cae0cdf33fe086229c37841e71a4ede9812 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Wed, 20 Nov 2024 13:00:16 +0000 Subject: [PATCH 07/19] dependanicies fix --- pyproject.toml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b08a47d75..56c60498c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ mesop = [ ] autogen = [ - "autogen-agentchat[anthropic,together]>=0.2.0,<0.3", + "autogen-agentchat[anthropic,together,websurfer]>=0.2.0,<0.3", "together>=1.2.11,<1.3", # ToDo: together 1.3.0 has issues with our dev dependencies "markdownify==0.13.1", # Needed by autogen.WebSurferAgent but not included ] @@ -176,6 +176,17 @@ dev-ag2 = [ "detect-secrets==1.5.0", ] +dev-autogen-04dev = [ + "fastagency[autogen-04dev,submodules,lint,testing,devdocs]", + "pre-commit==4.0.1", + "detect-secrets==1.5.0", +] + +dev = [ + "fastagency[dev-autogen]", +] + + [project.urls] Homepage = "https://github.com/airtai/fastagency" Documentation = "https://fastagency.ai/latest/" From f5fa0a399f79b8a78efd8dddd901de3c4f782a2a Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Wed, 20 Nov 2024 13:19:25 +0000 Subject: [PATCH 08/19] CI update --- .github/workflows/pipeline.yaml | 12 ++++++++++-- .github/workflows/test.yaml | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 19e14d0cc..a2f56f380 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -20,6 +20,7 @@ jobs: strategy: matrix: python-version: ["3.9", "3.10", "3.11", "3.12"] + runtime: ["autogen", "ag2", "autogen-04dev"] fail-fast: false runs-on: ubuntu-latest steps: @@ -49,6 +50,7 @@ jobs: strategy: matrix: python-version: ["3.9", "3.10", "3.11", "3.12"] + runtime: ["autogen", "ag2", "autogen-04dev"] fail-fast: false uses: ./.github/workflows/test.yaml with: @@ -61,6 +63,7 @@ jobs: strategy: matrix: python-version: ["3.10", "3.11", "3.12"] + runtime: ["autogen"] fail-fast: false uses: ./.github/workflows/test-playwright.yaml with: @@ -74,6 +77,7 @@ jobs: uses: ./.github/workflows/test.yaml with: python-version: "3.9" + runtime: "autogen" environment: testing use-llms: "anthropic" secrets: inherit # pragma: allowlist secret @@ -82,6 +86,7 @@ jobs: uses: ./.github/workflows/test.yaml with: python-version: "3.9" + runtime: "autogen" environment: testing use-llms: "azure_oai" secrets: inherit # pragma: allowlist secret @@ -90,6 +95,7 @@ jobs: uses: ./.github/workflows/test.yaml with: python-version: "3.9" + runtime: "autogen" environment: testing use-llms: "openai" secrets: inherit # pragma: allowlist secret @@ -98,6 +104,7 @@ jobs: uses: ./.github/workflows/test.yaml with: python-version: "3.9" + runtime: "autogen" environment: testing use-llms: "togetherai" secrets: inherit # pragma: allowlist secret @@ -106,6 +113,7 @@ jobs: uses: ./.github/workflows/test.yaml with: python-version: "3.9" + runtime: "autogen" environment: testing use-llms: "llm" secrets: inherit # pragma: allowlist secret @@ -124,7 +132,7 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' - run: pip install .[submodules,docs,testing] + run: pip install .[autogen,submodules,docs,testing] - name: Test run: bash scripts/test.sh -m "not (nats or anthropic or azure_oai or openai or togetherai or llm)" @@ -142,7 +150,7 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' - run: pip install .[submodules,docs,testing] + run: pip install .[autogen,submodules,docs,testing] - name: Test run: bash scripts/test.sh -m "not (nats or anthropic or azure_oai or openai or togetherai or llm)" diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a67a693c1..c46ed7587 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -12,6 +12,10 @@ on: description: 'Python version to run the tests in' required: true type: string + runtime: + description: 'Runtime to run the tests in (autogen, ag2, autogen-04dev)' + required: true + type: string use-llms: description: 'Use LLM in the tests' required: false From f3255f4fe9551c5926a800b56a7d18bf8c618425 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Wed, 20 Nov 2024 13:23:19 +0000 Subject: [PATCH 09/19] CI update --- .github/workflows/pipeline.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index a2f56f380..5dd8b98d8 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -55,6 +55,7 @@ jobs: uses: ./.github/workflows/test.yaml with: python-version: ${{ matrix.python-version }} + runtime: ${{ matrix.runtime }} environment: null use-llms: "" secrets: inherit # pragma: allowlist secret From bf1a941b9b7bd7172704b4d30e2ed167fa30f749 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Wed, 20 Nov 2024 13:27:18 +0000 Subject: [PATCH 10/19] CI update --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c46ed7587..5bdadbeff 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -89,7 +89,7 @@ jobs: key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test-v03 - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' - run: pip install .[docs,testing] + run: pip install .[${{ inputs.runtime }},docs,testing] - name: Install Pydantic v2 run: pip install --pre "pydantic>=2,<3" - run: mkdir coverage From 5eb75262f7e601debb866b1fa179b176be1fa720 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Wed, 20 Nov 2024 13:38:50 +0000 Subject: [PATCH 11/19] CI update --- .github/workflows/pipeline.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 5dd8b98d8..8d8836186 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -64,11 +64,12 @@ jobs: strategy: matrix: python-version: ["3.10", "3.11", "3.12"] - runtime: ["autogen"] + runtime: ["ag2"] fail-fast: false uses: ./.github/workflows/test-playwright.yaml with: python-version: ${{ matrix.python-version }} + runtime: ${{ matrix.runtime }} environment: null use-llms: "" secrets: inherit # pragma: allowlist secret From c743aa4f86705a5861d6a975de5bc0f7da78f218 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Wed, 20 Nov 2024 13:41:13 +0000 Subject: [PATCH 12/19] CI update --- .github/workflows/test-playwright.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-playwright.yaml b/.github/workflows/test-playwright.yaml index 2f7f88df9..b680e5a02 100644 --- a/.github/workflows/test-playwright.yaml +++ b/.github/workflows/test-playwright.yaml @@ -12,6 +12,10 @@ on: description: 'Python version to run the tests in' required: true type: string + runtime: + description: 'Runtime to run the tests in (autogen, ag2, autogen-04dev)' + required: true + type: string use-llms: description: 'Use LLM in the tests' required: false @@ -88,7 +92,7 @@ jobs: key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test-v03 - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' - run: pip install .[docs,testing] + run: pip install .[${{ inputs.runtime }},docs,testing] - name: Install Pydantic v2 run: pip install --pre "pydantic>=2,<3" - run: mkdir coverage From bea12c2199e5369b5a313dcc1a363c101e0ab617 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Wed, 20 Nov 2024 13:46:45 +0000 Subject: [PATCH 13/19] CI update --- .github/workflows/pipeline.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 8d8836186..b4d999c2e 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -79,7 +79,7 @@ jobs: uses: ./.github/workflows/test.yaml with: python-version: "3.9" - runtime: "autogen" + runtime: "ag2" environment: testing use-llms: "anthropic" secrets: inherit # pragma: allowlist secret @@ -88,7 +88,7 @@ jobs: uses: ./.github/workflows/test.yaml with: python-version: "3.9" - runtime: "autogen" + runtime: "ag2" environment: testing use-llms: "azure_oai" secrets: inherit # pragma: allowlist secret @@ -97,7 +97,7 @@ jobs: uses: ./.github/workflows/test.yaml with: python-version: "3.9" - runtime: "autogen" + runtime: "ag2" environment: testing use-llms: "openai" secrets: inherit # pragma: allowlist secret @@ -106,7 +106,7 @@ jobs: uses: ./.github/workflows/test.yaml with: python-version: "3.9" - runtime: "autogen" + runtime: "ag2" environment: testing use-llms: "togetherai" secrets: inherit # pragma: allowlist secret @@ -134,7 +134,7 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' - run: pip install .[autogen,submodules,docs,testing] + run: pip install .[ag2,submodules,docs,testing] - name: Test run: bash scripts/test.sh -m "not (nats or anthropic or azure_oai or openai or togetherai or llm)" @@ -152,7 +152,7 @@ jobs: - name: Install Dependencies if: steps.cache.outputs.cache-hit != 'true' - run: pip install .[autogen,submodules,docs,testing] + run: pip install .[ag2,submodules,docs,testing] - name: Test run: bash scripts/test.sh -m "not (nats or anthropic or azure_oai or openai or togetherai or llm)" From 86f1d9a0fc590231d05eb64ccde9792804fd7cd3 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Wed, 20 Nov 2024 13:50:28 +0000 Subject: [PATCH 14/19] CI update --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5bdadbeff..dac1a258a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -113,7 +113,7 @@ jobs: - name: Store coverage files uses: actions/upload-artifact@v4 with: - name: .coverage.${{ runner.os }}-py${{ inputs.python-version }}-${{ inputs.use-llms }} + name: .coverage.${{ runner.os }}-py${{ inputs.python-version }}-runtime${{ inputs.runtime }}-${{ inputs.use-llms }} path: coverage/.coverage.* if-no-files-found: error overwrite: true From 63dcd51f98b50413d44783046961a2fc042fdce5 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Thu, 21 Nov 2024 12:42:53 +0000 Subject: [PATCH 15/19] wip --- .../autogen-python-3.10/devcontainer.json | 98 ------------------- .../autogen-python-3.10/docker-compose.yml | 32 ------ .../autogen-python-3.11/devcontainer.json | 98 ------------------- .../autogen-python-3.11/docker-compose.yml | 32 ------ .../autogen-python-3.12/devcontainer.json | 98 ------------------- .../autogen-python-3.12/docker-compose.yml | 32 ------ .../autogen-python-3.9/devcontainer.json | 98 ------------------- .../autogen-python-3.9/docker-compose.yml | 32 ------ .github/workflows/pipeline.yaml | 6 +- .github/workflows/test-playwright.yaml | 2 +- .github/workflows/test.yaml | 2 +- pyproject.toml | 6 -- .../build_devcontainers.py | 7 +- 13 files changed, 10 insertions(+), 533 deletions(-) delete mode 100644 .devcontainer/autogen-python-3.10/devcontainer.json delete mode 100644 .devcontainer/autogen-python-3.10/docker-compose.yml delete mode 100644 .devcontainer/autogen-python-3.11/devcontainer.json delete mode 100644 .devcontainer/autogen-python-3.11/docker-compose.yml delete mode 100644 .devcontainer/autogen-python-3.12/devcontainer.json delete mode 100644 .devcontainer/autogen-python-3.12/docker-compose.yml delete mode 100644 .devcontainer/autogen-python-3.9/devcontainer.json delete mode 100644 .devcontainer/autogen-python-3.9/docker-compose.yml rename {.devcontainer => scripts}/build_devcontainers.py (97%) mode change 100755 => 100644 diff --git a/.devcontainer/autogen-python-3.10/devcontainer.json b/.devcontainer/autogen-python-3.10/devcontainer.json deleted file mode 100644 index 28100e452..000000000 --- a/.devcontainer/autogen-python-3.10/devcontainer.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "name": "autogen-python-3.10", - // "image": "mcr.microsoft.com/devcontainers/python:3.10", - "dockerComposeFile": [ - "./docker-compose.yml" - ], - "service": "python-3.10-fastagency", - "forwardPorts": [ - "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.10:9222" - ], - "secrets": { - "OPENAI_API_KEY": { - "description": "This key is optional and only needed if you are working on OpenAI-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." - }, - "TOGETHER_API_KEY": { - "description": "This key is optional and only needed if you are working with Together API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." - }, - "ANTHROPIC_API_KEY": { - "description": "This key is optional and only needed if you are working with Anthropic API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." - }, - "AZURE_OPENAI_API_KEY": { - "description": "This key is optional and only needed if you are using Azure's OpenAI services. For it to work, you must also set the related environment variables: AZURE_API_ENDPOINT, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL. Leave it blank if not required. You can always set these variables later in the codespace terminal." - }, - "AZURE_API_ENDPOINT": { - "description": "This key is required if you are using Azure's OpenAI services. It must be used in conjunction with AZURE_OPENAI_API_KEY, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL to ensure proper configuration. You can always set these variables later as environment variables in the codespace terminal." - }, - "AZURE_API_VERSION": { - "description": "This key is required to specify the version of the Azure API you are using. Set this along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL for Azure OpenAI services. These variables can be configured later as environment variables in the codespace terminal." - }, - "AZURE_GPT35_MODEL": { - "description": "This key is required if you are using Azure's GPT-3.5 model. Ensure you also set AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT4_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION for full compatibility with Azure OpenAI services. These can be configured later in the codespace terminal as environment variables." - }, - "AZURE_GPT4_MODEL": { - "description": "This key is required if you are using Azure's GPT-4 model. It must be set along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION to properly integrate with Azure's OpenAI services. All keys can be added later as environment variables in the codespace terminal." - }, - "AZURE_GPT4o_MODEL": { - "description": "This key is required if you are using Azure's GPT-4o model. Ensure that AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, and AZURE_API_VERSION are also set. You can always add these later as environment variables in the codespace terminal." - }, - "BING_API_KEY": { - "description": "This key is optional. The WebSurfer agent can work without it, but when added, it uses Bing's search and data services to improve information retrieval. You can always set it later as an environment variable in the codespace terminal." - } - }, - "shutdownAction": "stopCompose", - "workspaceFolder": "/workspaces/fastagency", - // "runArgs": [], - "remoteEnv": {}, - "features": { - "ghcr.io/devcontainers/features/common-utils:2": { - "installZsh": true, - "installOhMyZsh": true, - "configureZshAsDefaultShell": true, - "username": "vscode", - "userUid": "1000", - "userGid": "1000" - // "upgradePackages": "true" - }, - // "ghcr.io/devcontainers/features/python:1": {}, - "ghcr.io/devcontainers/features/node:1": {}, - // The below configuration with "version" set to "latest" fails in codespace - // "ghcr.io/devcontainers/features/git:1": { - // "version": "latest", - // "ppa": true - // }, - "ghcr.io/devcontainers/features/git:1": {}, - "ghcr.io/devcontainers/features/git-lfs:1": {}, - "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} - }, - "updateContentCommand": "bash .devcontainer/setup-autogen.sh", - "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", - "customizations": { - "vscode": { - "settings": { - "python.linting.enabled": true, - "python.testing.pytestEnabled": true, - "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.organizeImports": "always" - }, - "[python]": { - "editor.defaultFormatter": "ms-python.vscode-pylance" - }, - "editor.rulers": [ - 80 - ] - }, - "extensions": [ - "ms-python.python", - "ms-toolsai.jupyter", - "ms-toolsai.vscode-jupyter-cell-tags", - "ms-toolsai.jupyter-keymap", - "ms-toolsai.jupyter-renderers", - "ms-toolsai.vscode-jupyter-slideshow", - "ms-python.vscode-pylance", - "ms-playwright.playwright" - ] - } - } -} diff --git a/.devcontainer/autogen-python-3.10/docker-compose.yml b/.devcontainer/autogen-python-3.10/docker-compose.yml deleted file mode 100644 index 762d7cac1..000000000 --- a/.devcontainer/autogen-python-3.10/docker-compose.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: '3' - -services: - python-3.10-fastagency: # nosemgrep - image: mcr.microsoft.com/devcontainers/python:3.10 - container_name: fastagency-${USER}-python-3.10 - volumes: - - ../../:/workspaces/fastagency:cached - command: sleep infinity - environment: - - NATS_URL=nats://fastagency-${USER}-nats-py3.10:4222 - env_file: - - ../devcontainer.env - networks: - - fastagency-network - nats-fastagency: # nosemgrep - image: nats:latest - container_name: fastagency-${USER}-nats-py3.10 - # ports: - # - "${PORT_PREFIX}4222:4222" - # - "${PORT_PREFIX}9222:9222" - volumes: - - ../nats_server.conf:/etc/nats/server.conf - command: [ "--config", "/etc/nats/server.conf" ] - env_file: - - ../devcontainer.env - networks: - - fastagency-network - -networks: - fastagency-network: - name: fastagency-${USER}-network diff --git a/.devcontainer/autogen-python-3.11/devcontainer.json b/.devcontainer/autogen-python-3.11/devcontainer.json deleted file mode 100644 index 694a7edc0..000000000 --- a/.devcontainer/autogen-python-3.11/devcontainer.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "name": "autogen-python-3.11", - // "image": "mcr.microsoft.com/devcontainers/python:3.11", - "dockerComposeFile": [ - "./docker-compose.yml" - ], - "service": "python-3.11-fastagency", - "forwardPorts": [ - "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.11:9222" - ], - "secrets": { - "OPENAI_API_KEY": { - "description": "This key is optional and only needed if you are working on OpenAI-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." - }, - "TOGETHER_API_KEY": { - "description": "This key is optional and only needed if you are working with Together API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." - }, - "ANTHROPIC_API_KEY": { - "description": "This key is optional and only needed if you are working with Anthropic API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." - }, - "AZURE_OPENAI_API_KEY": { - "description": "This key is optional and only needed if you are using Azure's OpenAI services. For it to work, you must also set the related environment variables: AZURE_API_ENDPOINT, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL. Leave it blank if not required. You can always set these variables later in the codespace terminal." - }, - "AZURE_API_ENDPOINT": { - "description": "This key is required if you are using Azure's OpenAI services. It must be used in conjunction with AZURE_OPENAI_API_KEY, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL to ensure proper configuration. You can always set these variables later as environment variables in the codespace terminal." - }, - "AZURE_API_VERSION": { - "description": "This key is required to specify the version of the Azure API you are using. Set this along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL for Azure OpenAI services. These variables can be configured later as environment variables in the codespace terminal." - }, - "AZURE_GPT35_MODEL": { - "description": "This key is required if you are using Azure's GPT-3.5 model. Ensure you also set AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT4_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION for full compatibility with Azure OpenAI services. These can be configured later in the codespace terminal as environment variables." - }, - "AZURE_GPT4_MODEL": { - "description": "This key is required if you are using Azure's GPT-4 model. It must be set along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION to properly integrate with Azure's OpenAI services. All keys can be added later as environment variables in the codespace terminal." - }, - "AZURE_GPT4o_MODEL": { - "description": "This key is required if you are using Azure's GPT-4o model. Ensure that AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, and AZURE_API_VERSION are also set. You can always add these later as environment variables in the codespace terminal." - }, - "BING_API_KEY": { - "description": "This key is optional. The WebSurfer agent can work without it, but when added, it uses Bing's search and data services to improve information retrieval. You can always set it later as an environment variable in the codespace terminal." - } - }, - "shutdownAction": "stopCompose", - "workspaceFolder": "/workspaces/fastagency", - // "runArgs": [], - "remoteEnv": {}, - "features": { - "ghcr.io/devcontainers/features/common-utils:2": { - "installZsh": true, - "installOhMyZsh": true, - "configureZshAsDefaultShell": true, - "username": "vscode", - "userUid": "1000", - "userGid": "1000" - // "upgradePackages": "true" - }, - // "ghcr.io/devcontainers/features/python:1": {}, - "ghcr.io/devcontainers/features/node:1": {}, - // The below configuration with "version" set to "latest" fails in codespace - // "ghcr.io/devcontainers/features/git:1": { - // "version": "latest", - // "ppa": true - // }, - "ghcr.io/devcontainers/features/git:1": {}, - "ghcr.io/devcontainers/features/git-lfs:1": {}, - "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} - }, - "updateContentCommand": "bash .devcontainer/setup-autogen.sh", - "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", - "customizations": { - "vscode": { - "settings": { - "python.linting.enabled": true, - "python.testing.pytestEnabled": true, - "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.organizeImports": "always" - }, - "[python]": { - "editor.defaultFormatter": "ms-python.vscode-pylance" - }, - "editor.rulers": [ - 80 - ] - }, - "extensions": [ - "ms-python.python", - "ms-toolsai.jupyter", - "ms-toolsai.vscode-jupyter-cell-tags", - "ms-toolsai.jupyter-keymap", - "ms-toolsai.jupyter-renderers", - "ms-toolsai.vscode-jupyter-slideshow", - "ms-python.vscode-pylance", - "ms-playwright.playwright" - ] - } - } -} diff --git a/.devcontainer/autogen-python-3.11/docker-compose.yml b/.devcontainer/autogen-python-3.11/docker-compose.yml deleted file mode 100644 index 2e08b9619..000000000 --- a/.devcontainer/autogen-python-3.11/docker-compose.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: '3' - -services: - python-3.11-fastagency: # nosemgrep - image: mcr.microsoft.com/devcontainers/python:3.11 - container_name: fastagency-${USER}-python-3.11 - volumes: - - ../../:/workspaces/fastagency:cached - command: sleep infinity - environment: - - NATS_URL=nats://fastagency-${USER}-nats-py3.11:4222 - env_file: - - ../devcontainer.env - networks: - - fastagency-network - nats-fastagency: # nosemgrep - image: nats:latest - container_name: fastagency-${USER}-nats-py3.11 - # ports: - # - "${PORT_PREFIX}4222:4222" - # - "${PORT_PREFIX}9222:9222" - volumes: - - ../nats_server.conf:/etc/nats/server.conf - command: [ "--config", "/etc/nats/server.conf" ] - env_file: - - ../devcontainer.env - networks: - - fastagency-network - -networks: - fastagency-network: - name: fastagency-${USER}-network diff --git a/.devcontainer/autogen-python-3.12/devcontainer.json b/.devcontainer/autogen-python-3.12/devcontainer.json deleted file mode 100644 index bd87d5f96..000000000 --- a/.devcontainer/autogen-python-3.12/devcontainer.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "name": "autogen-python-3.12", - // "image": "mcr.microsoft.com/devcontainers/python:3.12", - "dockerComposeFile": [ - "./docker-compose.yml" - ], - "service": "python-3.12-fastagency", - "forwardPorts": [ - "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.12:9222" - ], - "secrets": { - "OPENAI_API_KEY": { - "description": "This key is optional and only needed if you are working on OpenAI-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." - }, - "TOGETHER_API_KEY": { - "description": "This key is optional and only needed if you are working with Together API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." - }, - "ANTHROPIC_API_KEY": { - "description": "This key is optional and only needed if you are working with Anthropic API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." - }, - "AZURE_OPENAI_API_KEY": { - "description": "This key is optional and only needed if you are using Azure's OpenAI services. For it to work, you must also set the related environment variables: AZURE_API_ENDPOINT, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL. Leave it blank if not required. You can always set these variables later in the codespace terminal." - }, - "AZURE_API_ENDPOINT": { - "description": "This key is required if you are using Azure's OpenAI services. It must be used in conjunction with AZURE_OPENAI_API_KEY, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL to ensure proper configuration. You can always set these variables later as environment variables in the codespace terminal." - }, - "AZURE_API_VERSION": { - "description": "This key is required to specify the version of the Azure API you are using. Set this along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL for Azure OpenAI services. These variables can be configured later as environment variables in the codespace terminal." - }, - "AZURE_GPT35_MODEL": { - "description": "This key is required if you are using Azure's GPT-3.5 model. Ensure you also set AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT4_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION for full compatibility with Azure OpenAI services. These can be configured later in the codespace terminal as environment variables." - }, - "AZURE_GPT4_MODEL": { - "description": "This key is required if you are using Azure's GPT-4 model. It must be set along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION to properly integrate with Azure's OpenAI services. All keys can be added later as environment variables in the codespace terminal." - }, - "AZURE_GPT4o_MODEL": { - "description": "This key is required if you are using Azure's GPT-4o model. Ensure that AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, and AZURE_API_VERSION are also set. You can always add these later as environment variables in the codespace terminal." - }, - "BING_API_KEY": { - "description": "This key is optional. The WebSurfer agent can work without it, but when added, it uses Bing's search and data services to improve information retrieval. You can always set it later as an environment variable in the codespace terminal." - } - }, - "shutdownAction": "stopCompose", - "workspaceFolder": "/workspaces/fastagency", - // "runArgs": [], - "remoteEnv": {}, - "features": { - "ghcr.io/devcontainers/features/common-utils:2": { - "installZsh": true, - "installOhMyZsh": true, - "configureZshAsDefaultShell": true, - "username": "vscode", - "userUid": "1000", - "userGid": "1000" - // "upgradePackages": "true" - }, - // "ghcr.io/devcontainers/features/python:1": {}, - "ghcr.io/devcontainers/features/node:1": {}, - // The below configuration with "version" set to "latest" fails in codespace - // "ghcr.io/devcontainers/features/git:1": { - // "version": "latest", - // "ppa": true - // }, - "ghcr.io/devcontainers/features/git:1": {}, - "ghcr.io/devcontainers/features/git-lfs:1": {}, - "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} - }, - "updateContentCommand": "bash .devcontainer/setup-autogen.sh", - "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", - "customizations": { - "vscode": { - "settings": { - "python.linting.enabled": true, - "python.testing.pytestEnabled": true, - "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.organizeImports": "always" - }, - "[python]": { - "editor.defaultFormatter": "ms-python.vscode-pylance" - }, - "editor.rulers": [ - 80 - ] - }, - "extensions": [ - "ms-python.python", - "ms-toolsai.jupyter", - "ms-toolsai.vscode-jupyter-cell-tags", - "ms-toolsai.jupyter-keymap", - "ms-toolsai.jupyter-renderers", - "ms-toolsai.vscode-jupyter-slideshow", - "ms-python.vscode-pylance", - "ms-playwright.playwright" - ] - } - } -} diff --git a/.devcontainer/autogen-python-3.12/docker-compose.yml b/.devcontainer/autogen-python-3.12/docker-compose.yml deleted file mode 100644 index f52afd429..000000000 --- a/.devcontainer/autogen-python-3.12/docker-compose.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: '3' - -services: - python-3.12-fastagency: # nosemgrep - image: mcr.microsoft.com/devcontainers/python:3.12 - container_name: fastagency-${USER}-python-3.12 - volumes: - - ../../:/workspaces/fastagency:cached - command: sleep infinity - environment: - - NATS_URL=nats://fastagency-${USER}-nats-py3.12:4222 - env_file: - - ../devcontainer.env - networks: - - fastagency-network - nats-fastagency: # nosemgrep - image: nats:latest - container_name: fastagency-${USER}-nats-py3.12 - # ports: - # - "${PORT_PREFIX}4222:4222" - # - "${PORT_PREFIX}9222:9222" - volumes: - - ../nats_server.conf:/etc/nats/server.conf - command: [ "--config", "/etc/nats/server.conf" ] - env_file: - - ../devcontainer.env - networks: - - fastagency-network - -networks: - fastagency-network: - name: fastagency-${USER}-network diff --git a/.devcontainer/autogen-python-3.9/devcontainer.json b/.devcontainer/autogen-python-3.9/devcontainer.json deleted file mode 100644 index 19a1b5d26..000000000 --- a/.devcontainer/autogen-python-3.9/devcontainer.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "name": "autogen-python-3.9", - // "image": "mcr.microsoft.com/devcontainers/python:3.9", - "dockerComposeFile": [ - "./docker-compose.yml" - ], - "service": "python-3.9-fastagency", - "forwardPorts": [ - "fastagency-${containerEnv:CONTAINER_PREFIX}-nats-py3.9:9222" - ], - "secrets": { - "OPENAI_API_KEY": { - "description": "This key is optional and only needed if you are working on OpenAI-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." - }, - "TOGETHER_API_KEY": { - "description": "This key is optional and only needed if you are working with Together API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." - }, - "ANTHROPIC_API_KEY": { - "description": "This key is optional and only needed if you are working with Anthropic API-related code. Leave it blank if not required. You can always set it later as an environment variable in the codespace terminal." - }, - "AZURE_OPENAI_API_KEY": { - "description": "This key is optional and only needed if you are using Azure's OpenAI services. For it to work, you must also set the related environment variables: AZURE_API_ENDPOINT, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL. Leave it blank if not required. You can always set these variables later in the codespace terminal." - }, - "AZURE_API_ENDPOINT": { - "description": "This key is required if you are using Azure's OpenAI services. It must be used in conjunction with AZURE_OPENAI_API_KEY, AZURE_API_VERSION, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL to ensure proper configuration. You can always set these variables later as environment variables in the codespace terminal." - }, - "AZURE_API_VERSION": { - "description": "This key is required to specify the version of the Azure API you are using. Set this along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, and at least one of AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, or AZURE_GPT4o_MODEL for Azure OpenAI services. These variables can be configured later as environment variables in the codespace terminal." - }, - "AZURE_GPT35_MODEL": { - "description": "This key is required if you are using Azure's GPT-3.5 model. Ensure you also set AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT4_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION for full compatibility with Azure OpenAI services. These can be configured later in the codespace terminal as environment variables." - }, - "AZURE_GPT4_MODEL": { - "description": "This key is required if you are using Azure's GPT-4 model. It must be set along with AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4o_MODEL, and AZURE_API_VERSION to properly integrate with Azure's OpenAI services. All keys can be added later as environment variables in the codespace terminal." - }, - "AZURE_GPT4o_MODEL": { - "description": "This key is required if you are using Azure's GPT-4o model. Ensure that AZURE_OPENAI_API_KEY, AZURE_API_ENDPOINT, AZURE_GPT35_MODEL, AZURE_GPT4_MODEL, and AZURE_API_VERSION are also set. You can always add these later as environment variables in the codespace terminal." - }, - "BING_API_KEY": { - "description": "This key is optional. The WebSurfer agent can work without it, but when added, it uses Bing's search and data services to improve information retrieval. You can always set it later as an environment variable in the codespace terminal." - } - }, - "shutdownAction": "stopCompose", - "workspaceFolder": "/workspaces/fastagency", - // "runArgs": [], - "remoteEnv": {}, - "features": { - "ghcr.io/devcontainers/features/common-utils:2": { - "installZsh": true, - "installOhMyZsh": true, - "configureZshAsDefaultShell": true, - "username": "vscode", - "userUid": "1000", - "userGid": "1000" - // "upgradePackages": "true" - }, - // "ghcr.io/devcontainers/features/python:1": {}, - "ghcr.io/devcontainers/features/node:1": {}, - // The below configuration with "version" set to "latest" fails in codespace - // "ghcr.io/devcontainers/features/git:1": { - // "version": "latest", - // "ppa": true - // }, - "ghcr.io/devcontainers/features/git:1": {}, - "ghcr.io/devcontainers/features/git-lfs:1": {}, - "ghcr.io/robbert229/devcontainer-features/postgresql-client:1": {} - }, - "updateContentCommand": "bash .devcontainer/setup-autogen.sh", - "postCreateCommand": "npm install && npx playwright install-deps && npx playwright install", - "customizations": { - "vscode": { - "settings": { - "python.linting.enabled": true, - "python.testing.pytestEnabled": true, - "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.organizeImports": "always" - }, - "[python]": { - "editor.defaultFormatter": "ms-python.vscode-pylance" - }, - "editor.rulers": [ - 80 - ] - }, - "extensions": [ - "ms-python.python", - "ms-toolsai.jupyter", - "ms-toolsai.vscode-jupyter-cell-tags", - "ms-toolsai.jupyter-keymap", - "ms-toolsai.jupyter-renderers", - "ms-toolsai.vscode-jupyter-slideshow", - "ms-python.vscode-pylance", - "ms-playwright.playwright" - ] - } - } -} diff --git a/.devcontainer/autogen-python-3.9/docker-compose.yml b/.devcontainer/autogen-python-3.9/docker-compose.yml deleted file mode 100644 index 281aef70f..000000000 --- a/.devcontainer/autogen-python-3.9/docker-compose.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: '3' - -services: - python-3.9-fastagency: # nosemgrep - image: mcr.microsoft.com/devcontainers/python:3.9 - container_name: fastagency-${USER}-python-3.9 - volumes: - - ../../:/workspaces/fastagency:cached - command: sleep infinity - environment: - - NATS_URL=nats://fastagency-${USER}-nats-py3.9:4222 - env_file: - - ../devcontainer.env - networks: - - fastagency-network - nats-fastagency: # nosemgrep - image: nats:latest - container_name: fastagency-${USER}-nats-py3.9 - # ports: - # - "${PORT_PREFIX}4222:4222" - # - "${PORT_PREFIX}9222:9222" - volumes: - - ../nats_server.conf:/etc/nats/server.conf - command: [ "--config", "/etc/nats/server.conf" ] - env_file: - - ../devcontainer.env - networks: - - fastagency-network - -networks: - fastagency-network: - name: fastagency-${USER}-network diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index b4d999c2e..84b41eb22 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -20,7 +20,7 @@ jobs: strategy: matrix: python-version: ["3.9", "3.10", "3.11", "3.12"] - runtime: ["autogen", "ag2", "autogen-04dev"] + runtime: ["ag2", "autogen-04dev"] fail-fast: false runs-on: ubuntu-latest steps: @@ -50,7 +50,7 @@ jobs: strategy: matrix: python-version: ["3.9", "3.10", "3.11", "3.12"] - runtime: ["autogen", "ag2", "autogen-04dev"] + runtime: ["ag2"] fail-fast: false uses: ./.github/workflows/test.yaml with: @@ -115,7 +115,7 @@ jobs: uses: ./.github/workflows/test.yaml with: python-version: "3.9" - runtime: "autogen" + runtime: "ag2" environment: testing use-llms: "llm" secrets: inherit # pragma: allowlist secret diff --git a/.github/workflows/test-playwright.yaml b/.github/workflows/test-playwright.yaml index b680e5a02..ce2c509f6 100644 --- a/.github/workflows/test-playwright.yaml +++ b/.github/workflows/test-playwright.yaml @@ -13,7 +13,7 @@ on: required: true type: string runtime: - description: 'Runtime to run the tests in (autogen, ag2, autogen-04dev)' + description: 'Runtime to run the tests in (ag2, autogen-04dev)' required: true type: string use-llms: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index dac1a258a..8f1ea77a6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,7 +13,7 @@ on: required: true type: string runtime: - description: 'Runtime to run the tests in (autogen, ag2, autogen-04dev)' + description: 'Runtime to run the tests in (ag2, autogen-04dev)' required: true type: string use-llms: diff --git a/pyproject.toml b/pyproject.toml index 56c60498c..782e10caa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,12 +56,6 @@ mesop = [ "mesop>=0.12.7, <1; python_version >= '3.10'" ] -autogen = [ - "autogen-agentchat[anthropic,together,websurfer]>=0.2.0,<0.3", - "together>=1.2.11,<1.3", # ToDo: together 1.3.0 has issues with our dev dependencies - "markdownify==0.13.1", # Needed by autogen.WebSurferAgent but not included -] - autogen-04dev = [ "autogen-agentchat==0.4.0.dev6", ] diff --git a/.devcontainer/build_devcontainers.py b/scripts/build_devcontainers.py old mode 100755 new mode 100644 similarity index 97% rename from .devcontainer/build_devcontainers.py rename to scripts/build_devcontainers.py index 4a7b5d15b..41d7d27e3 --- a/.devcontainer/build_devcontainers.py +++ b/scripts/build_devcontainers.py @@ -2,6 +2,7 @@ #! /usr/bin/env python3 from pathlib import Path +import shutil docker_compose = """version: '3' @@ -138,12 +139,14 @@ }} """ -root_path = Path(__file__).parent +root_path = Path(__file__).parents[1] / ".devcontainer" + def write_files(): for python in ["3.9", "3.10", "3.11", "3.12"]: - for runtime in ["ag2", "autogen", "autogen-04dev"]: + for runtime in ["ag2", "autogen-04dev"]: dir_path = root_path / f"{runtime}-python-{python}" + shutil.rmtree(dir_path, ignore_errors=True) dir_path.mkdir(exist_ok=True, parents=True) with open(dir_path / "docker-compose.yml", "w") as f: From 21b16cf96bc4456ca4470f179a1f5f3dd9376189 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Thu, 21 Nov 2024 13:01:18 +0000 Subject: [PATCH 16/19] fixes --- fastagency/__about__.py | 2 +- pyproject.toml | 13 +------------ scripts/build-docs-pre-commit.sh | 2 +- scripts/lint-pre-commit.sh | 2 +- scripts/test-no-llm-pre-commit.sh | 2 +- 5 files changed, 5 insertions(+), 16 deletions(-) diff --git a/fastagency/__about__.py b/fastagency/__about__.py index 9fbdc3e7f..85f5ddc6e 100644 --- a/fastagency/__about__.py +++ b/fastagency/__about__.py @@ -1,3 +1,3 @@ """The fastest way to bring multi-agent workflows to production.""" -__version__ = "0.3.4" +__version__ = "0.4.0-dev0" diff --git a/pyproject.toml b/pyproject.toml index fa4f79eaa..bfd1ecf62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,7 +61,7 @@ autogen-04dev = [ ] ag2 = [ - "ag2[anthropic,together]>=0.3.0,<0.4", + "ag2[anthropic,together,websurfer]>=0.3.0,<0.4", "together>=1.2.11,<1.3", # ToDo: together 1.3.0 has issues with our dev dependencies "markdownify==0.13.1", # Needed by autogen.WebSurferAgent but not included ] @@ -158,12 +158,6 @@ testing = [ ] -dev-autogen = [ - "fastagency[autogen,submodules,lint,testing,devdocs]", - "pre-commit==4.0.1", - "detect-secrets==1.5.0", -] - dev-ag2 = [ "fastagency[ag2,submodules,lint,testing,devdocs]", "pre-commit==4.0.1", @@ -176,11 +170,6 @@ dev-autogen-04dev = [ "detect-secrets==1.5.0", ] -dev = [ - "fastagency[dev-autogen]", -] - - [project.urls] Homepage = "https://github.com/airtai/fastagency" Documentation = "https://fastagency.ai/latest/" diff --git a/scripts/build-docs-pre-commit.sh b/scripts/build-docs-pre-commit.sh index 23ac81cea..c189c4fb0 100755 --- a/scripts/build-docs-pre-commit.sh +++ b/scripts/build-docs-pre-commit.sh @@ -15,7 +15,7 @@ cd "$(dirname "$0")"/.. # In my case, I need to use a custom index URL. # Avoid pip spending time quietly retrying since # likely cause of failure is lack of VPN connection. -pip install --editable ".[dev]" \ +pip install --editable ".[dev-ag2]" \ --retries 1 \ --no-input \ --quiet diff --git a/scripts/lint-pre-commit.sh b/scripts/lint-pre-commit.sh index 37747f312..8ec2ca29c 100755 --- a/scripts/lint-pre-commit.sh +++ b/scripts/lint-pre-commit.sh @@ -15,7 +15,7 @@ cd "$(dirname "$0")"/.. # In my case, I need to use a custom index URL. # Avoid pip spending time quietly retrying since # likely cause of failure is lack of VPN connection. -pip install --editable ".[dev]" \ +pip install --editable ".[dev-ag2]" \ --retries 1 \ --no-input \ --quiet diff --git a/scripts/test-no-llm-pre-commit.sh b/scripts/test-no-llm-pre-commit.sh index c86add112..56bc276fe 100755 --- a/scripts/test-no-llm-pre-commit.sh +++ b/scripts/test-no-llm-pre-commit.sh @@ -15,7 +15,7 @@ cd "$(dirname "$0")"/.. # In my case, I need to use a custom index URL. # Avoid pip spending time quietly retrying since # likely cause of failure is lack of VPN connection. -pip install --editable ".[dev]" \ +pip install --editable ".[dev-ag2]" \ --retries 1 \ --no-input \ --quiet From 116b64f1d0c459b07feb3215d3c8325a27840300 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Thu, 21 Nov 2024 13:07:31 +0000 Subject: [PATCH 17/19] add docs deploy to CI for 0.4-dev branch --- .github/workflows/deploy-docs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 6da53a698..9e08d7bf4 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -3,6 +3,7 @@ on: push: branches: - main + - 0.4-dev paths: - docs/** - .github/workflows/deploy-docs.yaml From e500d27d4ede7f877957920c8a527c3f528a693c Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Thu, 21 Nov 2024 13:09:01 +0000 Subject: [PATCH 18/19] CI precommit fix --- scripts/devcontainer-build-pre-commit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/devcontainer-build-pre-commit.sh b/scripts/devcontainer-build-pre-commit.sh index 729fd5bbd..51475d691 100755 --- a/scripts/devcontainer-build-pre-commit.sh +++ b/scripts/devcontainer-build-pre-commit.sh @@ -15,7 +15,7 @@ cd "$(dirname "$0")"/.. # In my case, I need to use a custom index URL. # Avoid pip spending time quietly retrying since # likely cause of failure is lack of VPN connection. -pip install --editable ".[dev]" \ +pip install --editable ".[dev-ag2]" \ --retries 1 \ --no-input \ --quiet From 2391d3c08362aec5ff1a3d1cb14a064f59b995d1 Mon Sep 17 00:00:00 2001 From: Davor Runje Date: Thu, 21 Nov 2024 13:26:31 +0000 Subject: [PATCH 19/19] fix --- scripts/devcontainer-build-pre-commit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/devcontainer-build-pre-commit.sh b/scripts/devcontainer-build-pre-commit.sh index 51475d691..04bdc74f9 100755 --- a/scripts/devcontainer-build-pre-commit.sh +++ b/scripts/devcontainer-build-pre-commit.sh @@ -29,4 +29,4 @@ pip install --editable ".[dev-ag2]" \ # Note that we do not use --ignore-missing-imports, # as this can give us false confidence in our results. # mypy fastagency -python .devcontainer/build_devcontainers.py +python scripts/build_devcontainers.py