Skip to content

Migrate from pyautogen to ag2 Library #1

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions a/autogenstudio/0.0.56rc9-0.0.9a0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,15 @@
"typer",
"uvicorn",
"arxiv",
- "pyautogen[gemini]>=0.2.0",
- "ag2[gemini]>=0.2.0",
- "python-dotenv",
- "websockets",
- "numpy < 2.0.0",
- "sqlmodel",
- "psycopg",
- "alembic",
- "loguru",
+ "pyautogen==0.2.0"
+ "ag2==0.2.0"
]
-optional-dependencies = {web = ["fastapi", "uvicorn"], database = ["psycopg"]}
+optional-dependencies = {web = ["fastapi", "uvicorn"]}
Expand Down
10 changes: 5 additions & 5 deletions c/composio-autogen/0.2.9-0.3.0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@
+Requires-Python: >=3.9,<4
Description-Content-Type: text/markdown
-Requires-Dist: composio_core===0.2.9
-Requires-Dist: pyautogen>=0.2.29
-Requires-Dist: ag2>=0.2.29
+Requires-Dist: composio_core===0.3.0
+Requires-Dist: pyautogen>=0.2.19
+Requires-Dist: ag2>=0.2.19

# Composio <> Autogen
Use Composio to enhance your Autogen workflows with a suite of tools.
Expand Down Expand Up @@ -103,9 +103,9 @@
+Requires-Python: >=3.9,<4
Description-Content-Type: text/markdown
-Requires-Dist: composio_core===0.2.9
-Requires-Dist: pyautogen>=0.2.29
-Requires-Dist: ag2>=0.2.29
+Requires-Dist: composio_core===0.3.0
+Requires-Dist: pyautogen>=0.2.19
+Requires-Dist: ag2>=0.2.19

# Composio <> Autogen
Use Composio to enhance your Autogen workflows with a suite of tools.
Expand Down Expand Up @@ -158,7 +158,7 @@
],
- python_requires=">=3.9",
+ python_requires=">=3.9,<4",
+ install_requires=["composio_core===0.3.0", "pyautogen>=0.2.19"],
+ install_requires=["composio_core===0.3.0", "ag2>=0.2.19"],
include_package_data=True,
)
```
Expand Down
210 changes: 105 additions & 105 deletions c/composio-autogen/0.3.1-0.3.2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
Description-Content-Type: text/markdown
-Requires-Dist: composio_core===0.3.1
+Requires-Dist: composio_core===0.3.2
Requires-Dist: pyautogen>=0.2.19
Requires-Dist: ag2>=0.2.19

# Composio <> Autogen
Use Composio to enhance your Autogen workflows with a suite of tools.
Expand All @@ -83,110 +83,110 @@

```diff
@@ -45,22 +45,24 @@
def register_tools(
self,
tools: t.Sequence[App],
caller: t.Optional[ConversableAgent] = None,
executor: t.Optional[ConversableAgent] = None,
tags: t.Optional[t.Sequence[Tag]] = None,
+ entity_id: t.Optional[str] = None,
) -> None:
"""
Register tools to the proxy agents.
:param tools: List of tools to register.
:param caller: Caller agent.
:param executor: Executor agent.
:param tags: Filter by the list of given Tags.
+ :param entity_id: Entity ID to use for executing function calls.
"""
if isinstance(tools, App):
tools = [tools]
caller = caller or self.caller
if caller is None:
raise RuntimeError("Please provide `caller` agent")

def register_tools(
self,
tools: t.Sequence[App],
caller: t.Optional[ConversableAgent] = None,
executor: t.Optional[ConversableAgent] = None,
tags: t.Optional[t.Sequence[Tag]] = None,
+ entity_id: t.Optional[str] = None,
) -> None:
"""
Register tools to the proxy agents.

:param tools: List of tools to register.
:param caller: Caller agent.
:param executor: Executor agent.
:param tags: Filter by the list of given Tags.
+ :param entity_id: Entity ID to use for executing function calls.
"""
if isinstance(tools, App):
tools = [tools]

caller = caller or self.caller
if caller is None:
raise RuntimeError("Please provide `caller` agent")
@@ -75,28 +77,31 @@
schema=schema.model_dump(
exclude_defaults=True,
exclude_none=True,
exclude_unset=True,
),
caller=caller,
executor=executor,
+ entity_id=entity_id or self.entity_id,
)
def register_actions(
self,
actions: t.Sequence[Action],
caller: t.Optional[ConversableAgent] = None,
executor: t.Optional[ConversableAgent] = None,
+ entity_id: t.Optional[str] = None,
):
"""
Register tools to the proxy agents.
:param actions: List of tools to register.
:param caller: Caller agent.
:param executor: Executor agent.
+ :param entity_id: Entity ID to use for executing function calls.
"""
caller = caller or self.caller
if caller is None:
raise RuntimeError("Please provide `caller` agent")
executor = executor or self.executor
schema=schema.model_dump(
exclude_defaults=True,
exclude_none=True,
exclude_unset=True,
),
caller=caller,
executor=executor,
+ entity_id=entity_id or self.entity_id,
)

def register_actions(
self,
actions: t.Sequence[Action],
caller: t.Optional[ConversableAgent] = None,
executor: t.Optional[ConversableAgent] = None,
+ entity_id: t.Optional[str] = None,
):
"""
Register tools to the proxy agents.

:param actions: List of tools to register.
:param caller: Caller agent.
:param executor: Executor agent.
+ :param entity_id: Entity ID to use for executing function calls.
"""

caller = caller or self.caller
if caller is None:
raise RuntimeError("Please provide `caller` agent")

executor = executor or self.executor
@@ -109,14 +114,15 @@
schema=schema.model_dump(
exclude_defaults=True,
exclude_none=True,
exclude_unset=True,
),
caller=caller,
executor=executor,
+ entity_id=entity_id or self.entity_id,
)
def _process_function_name_for_registration(
self,
input_string: str,
max_allowed_length: int = 64,
num_hash_char: int = 10,
schema=schema.model_dump(
exclude_defaults=True,
exclude_none=True,
exclude_unset=True,
),
caller=caller,
executor=executor,
+ entity_id=entity_id or self.entity_id,
)

def _process_function_name_for_registration(
self,
input_string: str,
max_allowed_length: int = 64,
num_hash_char: int = 10,
@@ -130,28 +136,30 @@
return processed_name
def _register_schema_to_autogen(
self,
schema: t.Dict,
caller: ConversableAgent,
executor: ConversableAgent,
- ):
+ entity_id: t.Optional[str] = None,
+ ) -> None:
+ """Register action schema to autogen registry."""
name = schema["name"]
appName = schema["appName"]
description = schema["description"]
def execute_action(**kwargs: t.Any) -> t.Dict:
"""Placeholder function for executing action."""
return self.execute_action(
action=Action.from_app_and_action(
app=appName,
name=name,
),
params=kwargs,
- entity_id=self.entity_id,
+ entity_id=entity_id or self.entity_id,
)
function = types.FunctionType(
code=execute_action.__code__,
globals=globals(),
name=self._process_function_name_for_registration(
return processed_name

def _register_schema_to_autogen(
self,
schema: t.Dict,
caller: ConversableAgent,
executor: ConversableAgent,
- ):
+ entity_id: t.Optional[str] = None,
+ ) -> None:
+ """Register action schema to autogen registry."""
name = schema["name"]
appName = schema["appName"]
description = schema["description"]

def execute_action(**kwargs: t.Any) -> t.Dict:
"""Placeholder function for executing action."""
return self.execute_action(
action=Action.from_app_and_action(
app=appName,
name=name,
),
params=kwargs,
- entity_id=self.entity_id,
+ entity_id=entity_id or self.entity_id,
)

function = types.FunctionType(
code=execute_action.__code__,
globals=globals(),
name=self._process_function_name_for_registration(
input_string=name,
```

Expand All @@ -211,7 +211,7 @@
Description-Content-Type: text/markdown
-Requires-Dist: composio_core===0.3.1
+Requires-Dist: composio_core===0.3.2
Requires-Dist: pyautogen>=0.2.19
Requires-Dist: ag2>=0.2.19

# Composio <> Autogen
Use Composio to enhance your Autogen workflows with a suite of tools.
Expand Down Expand Up @@ -246,8 +246,8 @@
"Operating System :: OS Independent",
],
python_requires=">=3.9,<4",
- install_requires=["composio_core===0.3.1", "pyautogen>=0.2.19"],
+ install_requires=["composio_core===0.3.2", "pyautogen>=0.2.19"],
- install_requires=["composio_core===0.3.1", "ag2>=0.2.19"],
+ install_requires=["composio_core===0.3.2", "ag2>=0.2.19"],
include_package_data=True,
)
```
Expand Down