Skip to content
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
8 changes: 3 additions & 5 deletions data_analyst_agent/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ import matplotlib.pyplot as plt
import os

# Fetch data from external system
# Composio and user_id are imported at runtime and do not require separate imports
result = composio.tools.execute(
# execute_composio_tool is imported at runtime and does not require a separate import
result = execute_composio_tool(
"TOOL_NAME_HERE",
user_id=user_id,
arguments={"param1": "value1"},
dangerously_skip_version_check=True
{"param1": "value1"},
)

# Transform to DataFrame
Expand Down
25 changes: 19 additions & 6 deletions helpers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import inspect
import os

from composio import Composio
Expand All @@ -10,7 +11,13 @@
_composio_clients: dict[str, Composio] = {}


def _refresh_runtime_env() -> None:
"""Reload add-on keys written through the TUI into the running process."""
_load_openswarm_dotenv(override=True)


def get_composio_user_id() -> str | None:
_refresh_runtime_env()
for key in ("COMPOSIO_USER_ID", "USER_ID"):
value = os.getenv(key)
if value:
Expand All @@ -19,6 +26,7 @@ def get_composio_user_id() -> str | None:


def get_composio_client() -> Composio | None:
_refresh_runtime_env()
api_key = os.getenv("COMPOSIO_API_KEY")
if not api_key:
return None
Expand All @@ -37,12 +45,17 @@ def execute_composio_tool(tool_name: str, arguments: dict):
if not user_id:
return {"error": "COMPOSIO_USER_ID is not set."}

return composio.tools.execute(
tool_name,
user_id=user_id,
arguments=arguments,
dangerously_skip_version_check=True,
)
kwargs = {"user_id": user_id, "arguments": arguments}
# composio>=0.9.0 checks tool versions on execute; skip it when supported.
# Older releases (0.8.x) have no such check and reject the keyword.
try:
parameters = inspect.signature(composio.tools.execute).parameters
except (TypeError, ValueError):
parameters = {}
if "dangerously_skip_version_check" in parameters:
kwargs["dangerously_skip_version_check"] = True

return composio.tools.execute(tool_name, **kwargs)


def get_composio_tools(**kwargs):
Expand Down
76 changes: 38 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vrsen/openswarm",
"version": "1.1.0",
"version": "1.1.1",
"description": "An open-source multi-agent AI team built on Agency Swarm",
"license": "MIT",
"publishConfig": {
Expand Down Expand Up @@ -52,18 +52,18 @@
"sharp": "^0.33.0"
},
"optionalDependencies": {
"@vrsen/openswarm-cli-darwin-arm64": "1.1.0",
"@vrsen/openswarm-cli-darwin-x64": "1.1.0",
"@vrsen/openswarm-cli-darwin-x64-baseline": "1.1.0",
"@vrsen/openswarm-cli-linux-arm64": "1.1.0",
"@vrsen/openswarm-cli-linux-arm64-musl": "1.1.0",
"@vrsen/openswarm-cli-linux-x64": "1.1.0",
"@vrsen/openswarm-cli-linux-x64-baseline": "1.1.0",
"@vrsen/openswarm-cli-linux-x64-baseline-musl": "1.1.0",
"@vrsen/openswarm-cli-linux-x64-musl": "1.1.0",
"@vrsen/openswarm-cli-windows-arm64": "1.1.0",
"@vrsen/openswarm-cli-windows-x64": "1.1.0",
"@vrsen/openswarm-cli-windows-x64-baseline": "1.1.0"
"@vrsen/openswarm-cli-darwin-arm64": "1.1.1",
"@vrsen/openswarm-cli-darwin-x64": "1.1.1",
"@vrsen/openswarm-cli-darwin-x64-baseline": "1.1.1",
"@vrsen/openswarm-cli-linux-arm64": "1.1.1",
"@vrsen/openswarm-cli-linux-arm64-musl": "1.1.1",
"@vrsen/openswarm-cli-linux-x64": "1.1.1",
"@vrsen/openswarm-cli-linux-x64-baseline": "1.1.1",
"@vrsen/openswarm-cli-linux-x64-baseline-musl": "1.1.1",
"@vrsen/openswarm-cli-linux-x64-musl": "1.1.1",
"@vrsen/openswarm-cli-windows-arm64": "1.1.1",
"@vrsen/openswarm-cli-windows-x64": "1.1.1",
"@vrsen/openswarm-cli-windows-x64-baseline": "1.1.1"
},
"engines": {
"node": ">=20.0.0",
Expand Down
2 changes: 1 addition & 1 deletion patches/patch_ipython_interpreter_composio.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def _build_bootstrap_code() -> str:
sys.path.insert(0, r"{root_dir}")

import helpers as _helpers
from helpers import get_composio_client, get_composio_user_id
from helpers import execute_composio_tool, get_composio_client, get_composio_user_id

composio = get_composio_client()
user_id = get_composio_user_id()
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[project]
name = "open-swarm"
description = "An open-source multi-agent AI team built on Agency Swarm and the OpenAI Agents SDK"
version = "1.1.0"
version = "1.1.1"
license = { text = "MIT" }
keywords = ["agency-swarm", "openai", "multi-agent", "open-source", "openswarm"]
requires-python = ">=3.12"
dependencies = [
"agency-swarm[fastapi,jupyter,litellm]==1.10.4",
"agency-swarm[fastapi,jupyter,litellm]==1.10.5",
"questionary>=2.0.0",
"python-dotenv",
"rich",
"fastapi",
"uvicorn",
"composio==0.8.0",
"composio-openai-agents==0.8.0",
"composio==0.15.0",
"composio-openai-agents==0.15.0",
"pytz",
# Data analysis
"pandas>=2.0.0",
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
agency-swarm[fastapi,jupyter,litellm]==1.10.4
agency-swarm[fastapi,jupyter,litellm]==1.10.5
questionary>=2.0.0
fastapi
uvicorn
composio==0.8.0
composio-openai-agents==0.8.0
composio==0.15.0
composio-openai-agents==0.15.0
pytz
# Data analysis and manipulation
pandas>=2.0.0
Expand Down
12 changes: 5 additions & 7 deletions shared_instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ Agents (except for Agent Swarm agent) can extend their functionality by adding c
### 5.3 Advanced queries

- For standard tasks, prefer shared tools (`ManageConnections`, `SearchTools`, `FindTools`, `ExecuteTool`).
- If `ProgrammaticToolCalling` is unavoidable, direct calls to `composio.tools.execute(...)` and `composio.tools.get(...)` are allowed.
- In `ProgrammaticToolCalling`, `composio` (the injected Composio client object for `tools.get`/`tools.execute`) and `user_id` are automatically available at runtime.
- If `ProgrammaticToolCalling` is unavoidable, use `execute_composio_tool(...)` for execution and `composio.tools.get(...)` for discovery.
- In `ProgrammaticToolCalling`, `execute_composio_tool`, `composio` (the injected Composio client object for `tools.get`), and `user_id` are automatically available at runtime.
Do not import them manually unless explicitly needed for compatibility.

```python
Expand All @@ -51,15 +51,13 @@ tools = composio.tools.get(
limit=5,
)

result = composio.tools.execute(
tool_name="GMAIL_SEND_EMAIL",
user_id=user_id,
arguments={
result = execute_composio_tool(
"GMAIL_SEND_EMAIL",
{
"to": ["user@example.com"],
"subject": "Hello",
"body": "Hi from agent",
},
dangerously_skip_version_check=True,
)
print(result)
```
Expand Down
9 changes: 3 additions & 6 deletions virtual_assistant/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,10 @@ Use `ExecuteTool` for single tool execution without data transformation. Optiona
Use this option for tasks that require multiple tool calls, data processing, storing intermediate results, or complex logic.

```python
from helpers import composio, user_id # only need to be imported in the first tool call

result = composio.tools.execute(
# execute_composio_tool is automatically available at runtime; no import needed
result = execute_composio_tool(
"TOOL_NAME_HERE",
user_id=user_id,
arguments={"param1": "value1", "param2": "value2"},
dangerously_skip_version_check=True
{"param1": "value1", "param2": "value2"},
)
print(result)
```
Expand Down
Loading