Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.13 Support #203

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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="me@vrsen.ai",
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
Loading