Skip to content

Commit

Permalink
Merge pull request #88 from SamparkAI/fx-local-tools-actions-enums-key
Browse files Browse the repository at this point in the history
fix: make local tools action enums key follow standard, fix ragtool and bump to 0.3.7
  • Loading branch information
utkarsh-dixit authored Jun 1, 2024
2 parents 7e050aa + 24585f1 commit ca730c0
Show file tree
Hide file tree
Showing 14 changed files with 274 additions and 272 deletions.
2 changes: 1 addition & 1 deletion composio/cli/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def _get_action_enum(apps: t.List[AppModel], actions: t.List[ActionModel]) -> st
local_tool_handler = LocalToolHandler()
for tool in local_tool_handler.registered_tools:
for action in tool.actions():
enum_name = f"{_get_enum_key(action().action_name)}"
enum_name = f"{_get_enum_key(action().get_tool_merged_action_name())}"
enum_value = f'("{tool.tool_name}", "{tool.tool_name}_{action().action_name}", True, True)'
action_enums += f" {enum_name} = {enum_value}\n"
return ACTION_ENUM_TEMPLATE.format(actions=action_enums)
Expand Down
504 changes: 252 additions & 252 deletions composio/client/enums.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composio/local_tools/ragtool/actions/rag_add_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AddContentToRagTool(Action):
_request_schema = RagToolAddRequest
_response_schema = RagToolAddResponse
_tags = ["Knowledge Base"]
_tool_name = "ragtoolactions"
_tool_name = "ragtool"

def execute(self, request: RagToolAddRequest, authorisation_data: dict = {}):
"""Add content to the knowledge base"""
Expand Down
2 changes: 1 addition & 1 deletion composio/local_tools/ragtool/actions/rag_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class RagToolQuery(Action):
_request_schema = RagToolQueryRequest
_response_schema = RagToolQueryResponse
_tags = ["Knowledge Base"]
_tool_name = "ragtoolactions"
_tool_name = "ragtool"


def execute(self, request: RagToolQueryRequest, authorisation_data: dict = {}):
Expand Down
2 changes: 2 additions & 0 deletions docs/adding-local-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ composio/local_tools/
return {"execution_details": {"executed": True}, "response_data": response_data}
```

**Note:** Make sure _tool_name is always the lowercase of the <ToolName> class we defined in the previous steps. E.g if we defined <ToolName> as `MyTool`, then _tool_name should be `mytool`.

4. **`composio/local_tools/<tool_name>/actions/__init__.py`:** Exports the action class.

```python
Expand Down
4 changes: 2 additions & 2 deletions 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.3.6",
version="0.3.7",
author="Sawradip",
author_email="[email protected]",
description="Use Composio to get an array of tools with your Autogen agent.",
Expand All @@ -22,6 +22,6 @@
"Operating System :: OS Independent",
],
python_requires=">=3.9,<4",
install_requires=["composio_core===0.3.6", "pyautogen>=0.2.19"],
install_requires=["composio_core===0.3.7", "pyautogen>=0.2.19"],
include_package_data=True,
)
4 changes: 2 additions & 2 deletions 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.3.6",
version="0.3.7",
author="Sawradip",
author_email="[email protected]",
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.3.6", "anthropic>=0.25.7"],
install_requires=["composio_openai===0.3.7", "anthropic>=0.25.7"],
include_package_data=True,
)
4 changes: 2 additions & 2 deletions 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.3.6",
version="0.3.7",
author="Himanshu",
author_email="[email protected]",
description="Use Composio to get an array of tools with your CrewAI agent.",
Expand All @@ -22,6 +22,6 @@
"Operating System :: OS Independent",
],
python_requires=">=3.9,<4",
install_requires=["composio_langchain===0.3.6"],
install_requires=["composio_langchain===0.3.7"],
include_package_data=True,
)
4 changes: 2 additions & 2 deletions 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.3.6",
version="0.3.7",
author="Sawradip",
author_email="[email protected]",
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.3.6", "griptape>=0.24.2"],
install_requires=["composio_core===0.3.7", "griptape>=0.24.2"],
include_package_data=True,
)
4 changes: 2 additions & 2 deletions 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.3.6",
version="0.3.7",
author="Sawradip",
author_email="[email protected]",
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.3.6", "julep>=0.3.2"],
install_requires=["composio_openai===0.3.7", "julep>=0.3.2"],
include_package_data=True,
)
4 changes: 2 additions & 2 deletions 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.3.6",
version="0.3.7",
author="Karan",
author_email="[email protected]",
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.3.6",
"composio_core===0.3.7",
],
include_package_data=True,
)
4 changes: 2 additions & 2 deletions 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.3.6",
version="0.3.7",
author="Sawradip",
author_email="[email protected]",
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.3.6",
"composio_core===0.3.7",
"langchain>=0.1.0",
],
include_package_data=True,
Expand Down
4 changes: 2 additions & 2 deletions 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.3.6",
version="0.3.7",
author="Sawradip",
author_email="[email protected]",
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.3.6"],
install_requires=["composio_core===0.3.7"],
include_package_data=True,
)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name="composio_core",
version="0.3.6",
version="0.3.7",
author="Utkarsh",
author_email="[email protected]",
description="Core package to act as a bridge between composio platform and other services.",
Expand Down

0 comments on commit ca730c0

Please sign in to comment.