Skip to content

Commit

Permalink
Merge pull request #203 from bonk1t/dev/support-python-3-13
Browse files Browse the repository at this point in the history
Add Python 3.13 Support
  • Loading branch information
bonk1t authored Dec 19, 2024
2 parents 0895df7 + 9974e1d commit 1e28824
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
16 changes: 12 additions & 4 deletions agency_swarm/tools/BaseTool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name="agency-swarm",
version="0.4.2",
version="0.4.3",
author="VRSEN",
author_email="[email protected]",
description="An opensource agent orchestration framework built on top of the latest OpenAI Assistants API.",
Expand All @@ -23,5 +23,5 @@
entry_points={
"console_scripts": ["agency-swarm=agency_swarm.cli:main"],
},
python_requires=">=3.7",
python_requires=">=3.10",
)
3 changes: 2 additions & 1 deletion tests/demos/demo_gradio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 1e28824

Please sign in to comment.