Skip to content

Commit

Permalink
Merge branch 'master' into ENG-2785
Browse files Browse the repository at this point in the history
  • Loading branch information
plxity authored Dec 9, 2024
2 parents a328121 + ecd754c commit a274541
Show file tree
Hide file tree
Showing 24 changed files with 71 additions and 48 deletions.
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.2"
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
12 changes: 11 additions & 1 deletion python/composio/tools/env/host/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,17 @@ def check_for_missing_dependencies(
missing[app.slug].add(dependency)

actions = actions or []
for action in map(Action, actions):

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

actions = t.cast(
t.List[Action], [Action(a) if not is_action(a) else a for a in actions]
)
for action 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
2 changes: 1 addition & 1 deletion python/composio/utils/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


def get_enum_key(name: str) -> str:
characters_to_replace = [" ", "-", "/", "(", ")", "\\", ":", '"', "'", "."]
characters_to_replace = [" ", "-", "/", "(", ")", "\\", ":", '"', "'", ".", "&"]
for char in characters_to_replace:
name = name.replace(char, "_")
return name.upper()
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.2",
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.2",
"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.2",
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.2",
"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.2",
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.2", "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.2",
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.2",
"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.2",
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.2",
"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.2",
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.2", "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.2",
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.2", "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.2",
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.2",
],
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.2",
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.2",
"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.2",
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.2",
],
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.2",
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.2",
"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.2",
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.2", "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.2",
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.2",
"composio_openai>=0.5.50,<=0.5.52-rc.2",
"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.2",
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.2", "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.2",
author="Utkarsh",
author_email="utkarsh@composio.dev",
description="Core package to act as a bridge between composio platform and other services.",
Expand Down
Loading

0 comments on commit a274541

Please sign in to comment.