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

fix: Handle remote enums fetching dynamically #963

Merged
merged 9 commits into from
Dec 8, 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
2 changes: 1 addition & 1 deletion python/composio/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5.51"
__version__ = "0.5.52-rc.1"
15 changes: 14 additions & 1 deletion python/composio/client/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,20 @@ def get( # type: ignore
app
:return: List of actions
"""
actions = t.cast(t.List[Action], [Action(action) for action in actions or []])

def is_action(obj):
try:
return hasattr(obj, "app")
except AttributeError:
return False

actions = t.cast(
t.List[Action],
[
action if is_action(action) else Action(action)
for action in actions or []
],
)
apps = t.cast(t.List[App], [App(app) for app in apps or []])
tags = t.cast(t.List[Tag], [Tag(tag) for tag in tags or []])

Expand Down
2 changes: 1 addition & 1 deletion python/composio/tools/env/host/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def check_for_missing_dependencies(
missing[app.slug].add(dependency)

actions = actions or []
for action in map(Action, actions):
for action in [Action(a) if not isinstance(a, Action) else a for a in actions]:
if not action.is_local or action.is_runtime:
continue

Expand Down
6 changes: 4 additions & 2 deletions python/composio/tools/toolset.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ def execute_action(
:param connected_account_id: Connection ID for executing the remote action
:return: Output object from the function call
"""
action = Action(action)
action = load_action(self.client, action)
params = self._serialize_execute_params(param=params)
if processors is not None:
self._merge_processors(processors)
Expand Down Expand Up @@ -863,6 +863,8 @@ def validate_tools(
# NOTE: This an experimental, can convert to decorator for more convinience
if not apps and not actions and not tags:
return
if actions:
actions = [load_action(self.client, action) for action in actions]
self.workspace.check_for_missing_dependencies(
apps=apps,
actions=actions,
Expand All @@ -884,7 +886,7 @@ def get_action_schemas(
actions = t.cast(
t.List[Action],
[
Action(action)
load_action(self.client, action)
for action in actions or []
if action not in runtime_actions
],
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/autogen/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_autogen",
version="0.5.51",
version="0.5.52-rc.1",
author="Sawradip",
author_email="sawradip@composio.dev",
description="Use Composio to get an array of tools with your Autogen agent.",
Expand All @@ -23,7 +23,7 @@
],
python_requires=">=3.9,<4",
install_requires=[
"composio_core>=0.5.50,<=0.5.51",
"composio_core>=0.5.50,<=0.5.52-rc.1",
"pyautogen>=0.2.19",
"flaml==2.2.0",
],
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/camel/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_camel",
version="0.5.51",
version="0.5.52-rc.1",
author="Sawradip",
author_email="sawradip@composio.dev",
description="Use Composio to get an array of tools with your Claude LLMs.",
Expand All @@ -23,7 +23,7 @@
],
python_requires=">=3.9,<4",
install_requires=[
"composio_core>=0.5.50,<=0.5.51",
"composio_core>=0.5.50,<=0.5.52-rc.1",
"camel-ai>=0.1.5.7,<=0.2.2",
"pillow",
],
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/claude/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_claude",
version="0.5.51",
version="0.5.52-rc.1",
author="Sawradip",
author_email="sawradip@composio.dev",
description="Use Composio to get an array of tools with your Claude LLMs.",
Expand All @@ -22,6 +22,6 @@
"Operating System :: OS Independent",
],
python_requires=">=3.9,<4",
install_requires=["composio_openai>=0.5.50,<=0.5.51", "anthropic>=0.25.7"],
install_requires=["composio_openai>=0.5.50,<=0.5.52-rc.1", "anthropic>=0.25.7"],
include_package_data=True,
)
4 changes: 2 additions & 2 deletions python/plugins/crew_ai/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_crewai",
version="0.5.51",
version="0.5.52-rc.1",
author="Himanshu",
author_email="himanshu@composio.dev",
description="Use Composio to get an array of tools with your CrewAI agent.",
Expand All @@ -23,7 +23,7 @@
],
python_requires=">=3.9,<4",
install_requires=[
"composio_langchain>=0.5.50,<=0.5.51",
"composio_langchain>=0.5.50,<=0.5.52-rc.1",
"crewai>=0.51.0,<=0.75.0",
],
include_package_data=True,
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/google/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_google",
version="0.5.51",
version="0.5.52-rc.1",
author="Assistant",
author_email="karan@composio.dev",
description="Use Composio to get an array of tools with your Google AI Python Gemini model.",
Expand All @@ -23,7 +23,7 @@
],
python_requires=">=3.9,<4",
install_requires=[
"composio_core>=0.5.50,<=0.5.51",
"composio_core>=0.5.50,<=0.5.52-rc.1",
"google-cloud-aiplatform>=1.38.0",
],
include_package_data=True,
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/griptape/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_griptape",
version="0.5.51",
version="0.5.52-rc.1",
author="Sawradip",
author_email="sawradip@composio.dev",
description="Use Composio to get an array of tools with your Griptape wokflow.",
Expand All @@ -22,6 +22,6 @@
"Operating System :: OS Independent",
],
python_requires=">=3.9,<4",
install_requires=["composio_core>=0.5.50,<=0.5.51", "griptape>=0.24.2"],
install_requires=["composio_core>=0.5.50,<=0.5.52-rc.1", "griptape>=0.24.2"],
include_package_data=True,
)
4 changes: 2 additions & 2 deletions python/plugins/julep/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_julep",
version="0.5.51",
version="0.5.52-rc.1",
author="Sawradip",
author_email="sawradip@composio.dev",
description="Use Composio to get an array of tools with your Julep wokflow.",
Expand All @@ -22,6 +22,6 @@
"Operating System :: OS Independent",
],
python_requires=">=3.9,<4",
install_requires=["composio_openai>=0.5.50,<=0.5.51", "julep>=0.3.2"],
install_requires=["composio_openai>=0.5.50,<=0.5.52-rc.1", "julep>=0.3.2"],
include_package_data=True,
)
4 changes: 2 additions & 2 deletions python/plugins/langchain/composio_langchain/toolset.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import typing_extensions as te
from langchain_core.tools import StructuredTool as BaseStructuredTool

from composio import Action, ActionType, AppType, TagType
from composio import ActionType, AppType, TagType
from composio.tools import ComposioToolSet as BaseComposioToolSet
from composio.tools.toolset import ProcessorsType
from composio.utils.pydantic import parse_pydantic_error
Expand Down Expand Up @@ -82,7 +82,7 @@ def function(**kwargs: t.Any) -> t.Dict:
"""Wrapper function for composio action."""
self.logger.debug(f"Executing action: {action} with params: {kwargs}")
return self.execute_action(
action=Action(value=action),
action=action,
params=kwargs,
entity_id=entity_id or self.entity_id,
)
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/langchain/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_langchain",
version="0.5.51",
version="0.5.52-rc.1",
author="Karan",
author_email="karan@composio.dev",
description="Use Composio to get an array of tools with your LangChain agent.",
Expand All @@ -27,7 +27,7 @@
"langchain-openai>=0.0.2.post1",
"pydantic>=2.6.4",
"langchainhub>=0.1.15",
"composio_core>=0.5.50,<=0.5.51",
"composio_core>=0.5.50,<=0.5.52-rc.1",
],
include_package_data=True,
)
4 changes: 2 additions & 2 deletions python/plugins/langgraph/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_langgraph",
version="0.5.51",
version="0.5.52-rc.1",
author="Sawradip",
author_email="sawradip@composio.dev",
description="Use Composio to get array of tools with LnagGraph Agent Workflows",
Expand All @@ -23,7 +23,7 @@
],
python_requires=">=3.9,<4",
install_requires=[
"composio_langchain>=0.5.50,<=0.5.51",
"composio_langchain>=0.5.50,<=0.5.52-rc.1",
"langgraph",
],
include_package_data=True,
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/llamaindex/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_llamaindex",
version="0.5.51",
version="0.5.52-rc.1",
author="Sawradip",
author_email="sawradip@composio.dev",
description="Use Composio to get an array of tools with your LlamaIndex agent.",
Expand All @@ -24,7 +24,7 @@
python_requires=">=3.9,<4",
install_requires=[
"llama_index>=0.10.43",
"composio_core>=0.5.50,<=0.5.51",
"composio_core>=0.5.50,<=0.5.52-rc.1",
],
include_package_data=True,
)
4 changes: 2 additions & 2 deletions python/plugins/lyzr/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_lyzr",
version="0.5.51",
version="0.5.52-rc.1",
author="Sawradip",
author_email="sawradip@composio.dev",
description="Use Composio to get an array of tools with your Lyzr workflow.",
Expand All @@ -25,7 +25,7 @@
install_requires=[
"lyzr-automata>=0.1.3",
"pydantic>=2.6.4",
"composio_core>=0.5.50,<=0.5.51",
"composio_core>=0.5.50,<=0.5.52-rc.1",
"langchain>=0.1.0",
],
include_package_data=True,
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/openai/composio_openai/toolset.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
)
from openai.types.chat.chat_completion_tool_param import ChatCompletionToolParam

from composio import Action, ActionType, AppType, TagType
from composio import ActionType, AppType, TagType
from composio.constants import DEFAULT_ENTITY_ID
from composio.tools import ComposioToolSet as BaseComposioToolSet
from composio.tools.schema import OpenAISchema, SchemaType
Expand Down Expand Up @@ -176,7 +176,7 @@ def execute_tool_call(
:return: Object containing output data from the tool call.
"""
return self.execute_action(
action=Action(value=tool_call.function.name),
action=tool_call.function.name,
params=json.loads(tool_call.function.arguments),
entity_id=entity_id or self.entity_id,
)
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/openai/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_openai",
version="0.5.51",
version="0.5.52-rc.1",
author="Sawradip",
author_email="sawradip@composio.dev",
description="Use Composio to get an array of tools with your OpenAI Function Call.",
Expand All @@ -22,6 +22,6 @@
"Operating System :: OS Independent",
],
python_requires=">=3.9,<4",
install_requires=["composio_core>=0.5.50,<=0.5.51", "openai"],
install_requires=["composio_core>=0.5.50,<=0.5.52-rc.1", "openai"],
include_package_data=True,
)
6 changes: 3 additions & 3 deletions python/plugins/phidata/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_phidata",
version="0.5.51",
version="0.5.52-rc.1",
author="Sawradip",
author_email="sawradip@composio.dev",
description="Use Composio to get an array of tools with your Phidata Plugin.",
Expand All @@ -23,8 +23,8 @@
],
python_requires=">=3.9,<4",
install_requires=[
"composio_core>=0.5.50,<=0.5.51",
"composio_openai>=0.5.50,<=0.5.51",
"composio_core>=0.5.50,<=0.5.52-rc.1",
"composio_openai>=0.5.50,<=0.5.52-rc.1",
"phidata",
],
include_package_data=True,
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/praisonai/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name="composio_praisonai",
version="0.5.51",
version="0.5.52-rc.1",
author="Sawradip",
author_email="sawradip@composio.dev",
description="Use Composio Tools to enhance your PraisonAI agents capabilities.",
Expand All @@ -22,6 +22,6 @@
"Operating System :: OS Independent",
],
python_requires=">=3.9",
install_requires=["composio_core>=0.5.50,<=0.5.51", "PraisonAI>=0.0.2"],
install_requires=["composio_core>=0.5.50,<=0.5.52-rc.1", "PraisonAI>=0.0.2"],
include_package_data=True,
)
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def scan_for_package_data(

setup(
name="composio_core",
version="0.5.51",
version="0.5.52-rc.1",
author="Utkarsh",
author_email="utkarsh@composio.dev",
description="Core package to act as a bridge between composio platform and other services.",
Expand Down
6 changes: 3 additions & 3 deletions python/swe/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def scan_for_package_data(

setup(
name="swekit",
version="0.2.49",
version="0.2.50-rc.1",
author="Shubhra",
author_email="shubhra@composio.dev",
description="Tools for running a SWE agent using Composio platform",
Expand Down Expand Up @@ -66,7 +66,7 @@ def scan_for_package_data(
"swebench==2.1.0",
"datasets>=2.20.0",
"gitpython>=3.1.43",
"composio_core>=0.5.50,<=0.5.51",
"composio_core>=0.5.50,<=0.5.52-rc.1",
"unidiff==0.7.5",
"tqdm==4.66.4",
"rich",
Expand All @@ -75,7 +75,7 @@ def scan_for_package_data(
"langgraph": [
"langchain-aws==0.1.17",
"langgraph>=0.2.16",
"composio_langgraph>=0.5.50,<=0.5.51",
"composio_langgraph>=0.5.50,<=0.5.52-rc.1",
"python-dotenv==1.0.1",
]
},
Expand Down
Loading