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/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", ) 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",