From aa0a21690ba8d0bf502cfcf7e9cc47024cf1d44b Mon Sep 17 00:00:00 2001 From: Nick Bobrowski <39348559+bonk1t@users.noreply.github.com> Date: Mon, 16 Dec 2024 23:46:04 +0000 Subject: [PATCH 1/2] Add Python 3.13 support --- agency_swarm/tools/BaseTool.py | 16 ++++++++++++---- pyproject.toml | 2 +- tests/demos/demo_gradio.py | 3 ++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/agency_swarm/tools/BaseTool.py b/agency_swarm/tools/BaseTool.py index 78a81c85..67d98b3e 100644 --- a/agency_swarm/tools/BaseTool.py +++ b/agency_swarm/tools/BaseTool.py @@ -7,11 +7,20 @@ from agency_swarm.util.shared_state import SharedState +class classproperty: + def __init__(self, fget): + self.fget = fget + + def __get__(self, instance, owner): + return self.fget(owner) + + class BaseTool(BaseModel, ABC): _shared_state: ClassVar[SharedState] = None _caller_agent: Any = None _event_handler: Any = None _tool_call: Any = None + openai_schema: ClassVar[dict[str, Any]] def __init__(self, **kwargs): if not self.__class__._shared_state: @@ -37,14 +46,13 @@ class ToolConfig: output_as_result: bool = False async_mode: Union[Literal["threading"], None] = None - @classmethod - @property - def openai_schema(cls): + @classproperty + def openai_schema(cls) -> dict[str, Any]: """ Return the schema in the format of OpenAI's schema as jsonschema Note: - Its important to add a docstring to describe how to best use this class, it will be included in the description attribute and be part of the prompt. + It's important to add a docstring to describe how to best use this class; it will be included in the description attribute and be part of the prompt. Returns: model_json_schema (dict): A dictionary in the format of OpenAI's schema as jsonschema diff --git a/pyproject.toml b/pyproject.toml index f9b98812..8d0211ab 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ dependencies = [ "rich==13.7.1", "jsonref==1.1.0" ] -requires-python = ">=3.7" +requires-python = ">=3.10" urls = { homepage = "https://github.com/VRSEN/agency-swarm" } [project.scripts] diff --git a/tests/demos/demo_gradio.py b/tests/demos/demo_gradio.py index 3c31fe51..c100f0ac 100644 --- a/tests/demos/demo_gradio.py +++ b/tests/demos/demo_gradio.py @@ -47,7 +47,8 @@ def run(self, **kwargs): agency = Agency( [ ceo, - [ceo, test_agent, test_agent2], + [ceo, test_agent], + [test_agent, test_agent2], ], shared_instructions="", settings_path="./test_settings.json", From 9974e1d30afc821aabf5e4acbb06f8465e982645 Mon Sep 17 00:00:00 2001 From: Nick Bobrowski <39348559+bonk1t@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:09:24 +0000 Subject: [PATCH 2/2] Update Python version in setup.py, bump package version --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c40aa0f5..dd2b47c7 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="agency-swarm", - version="0.4.2", + version="0.4.3", author="VRSEN", author_email="me@vrsen.ai", description="An opensource agent orchestration framework built on top of the latest OpenAI Assistants API.", @@ -23,5 +23,5 @@ entry_points={ "console_scripts": ["agency-swarm=agency_swarm.cli:main"], }, - python_requires=">=3.7", + python_requires=">=3.10", )