composio-openai-agents 1.0.0rc5__tar.gz → 1.0.0rc6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {composio_openai_agents-1.0.0rc5 → composio_openai_agents-1.0.0rc6}/PKG-INFO +12 -7
- {composio_openai_agents-1.0.0rc5 → composio_openai_agents-1.0.0rc6}/composio_openai_agents/__init__.py +1 -5
- {composio_openai_agents-1.0.0rc5 → composio_openai_agents-1.0.0rc6}/composio_openai_agents/provider.py +7 -12
- composio_openai_agents-1.0.0rc6/composio_openai_agents/py.typed +0 -0
- composio_openai_agents-1.0.0rc6/composio_openai_agents.egg-info/PKG-INFO +79 -0
- composio_openai_agents-1.0.0rc6/composio_openai_agents.egg-info/SOURCES.txt +11 -0
- composio_openai_agents-1.0.0rc6/composio_openai_agents.egg-info/dependency_links.txt +1 -0
- composio_openai_agents-1.0.0rc6/composio_openai_agents.egg-info/requires.txt +2 -0
- composio_openai_agents-1.0.0rc6/composio_openai_agents.egg-info/top_level.txt +1 -0
- {composio_openai_agents-1.0.0rc5 → composio_openai_agents-1.0.0rc6}/pyproject.toml +1 -5
- composio_openai_agents-1.0.0rc6/setup.cfg +4 -0
- {composio_openai_agents-1.0.0rc5 → composio_openai_agents-1.0.0rc6}/setup.py +1 -2
- composio_openai_agents-1.0.0rc5/.gitignore +0 -186
- composio_openai_agents-1.0.0rc5/openai_agents_demo.py +0 -36
- {composio_openai_agents-1.0.0rc5 → composio_openai_agents-1.0.0rc6}/README.md +0 -0
@@ -1,16 +1,21 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: composio-openai-agents
|
3
|
-
Version: 1.0.
|
3
|
+
Version: 1.0.0rc6
|
4
4
|
Summary: Use Composio to get array of strongly typed tools for OpenAI Agents
|
5
|
-
|
5
|
+
Home-page: https://github.com/ComposioHQ/composio
|
6
|
+
Author: Composio
|
6
7
|
Author-email: Composio <tech@composio.dev>
|
8
|
+
Project-URL: Homepage, https://github.com/ComposioHQ/composio
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
7
10
|
Classifier: License :: OSI Approved :: Apache Software License
|
8
11
|
Classifier: Operating System :: OS Independent
|
9
|
-
|
10
|
-
Requires-Python: <4,>=3.9
|
11
|
-
Requires-Dist: composio
|
12
|
-
Requires-Dist: openai-agents>=0.0.3
|
12
|
+
Requires-Python: >=3.9,<4
|
13
13
|
Description-Content-Type: text/markdown
|
14
|
+
Requires-Dist: openai-agents>=0.0.3
|
15
|
+
Requires-Dist: composio
|
16
|
+
Dynamic: author
|
17
|
+
Dynamic: home-page
|
18
|
+
Dynamic: requires-python
|
14
19
|
|
15
20
|
# Composio Integration for OpenAI Agents
|
16
21
|
|
@@ -71,4 +76,4 @@ asyncio.run(main())
|
|
71
76
|
|
72
77
|
## License
|
73
78
|
|
74
|
-
Apache 2.0
|
79
|
+
Apache 2.0
|
@@ -1,16 +1,13 @@
|
|
1
|
-
import json
|
2
1
|
import asyncio
|
2
|
+
import json
|
3
3
|
import typing as t
|
4
|
-
from inspect import Signature
|
5
|
-
from typing import List, cast
|
6
4
|
|
7
5
|
import pydantic
|
8
|
-
import
|
9
|
-
from agents import FunctionTool, Tool
|
6
|
+
from agents import FunctionTool
|
10
7
|
|
8
|
+
from composio.core.provider import AgenticProvider
|
11
9
|
from composio.core.provider.agentic import AgenticProviderExecuteFn
|
12
10
|
from composio.types import Tool
|
13
|
-
from composio.core.provider import AgenticProvider
|
14
11
|
from composio.utils.pydantic import parse_pydantic_error
|
15
12
|
|
16
13
|
|
@@ -21,9 +18,7 @@ def _remove_examples_from_schema(schema_obj: t.Dict[str, t.Any]) -> None:
|
|
21
18
|
schema, including nested ones. Also ensure that any 'items' object has a 'type' key.
|
22
19
|
"""
|
23
20
|
# Handle properties directly
|
24
|
-
if "properties" in schema_obj and isinstance(
|
25
|
-
schema_obj["properties"], dict
|
26
|
-
):
|
21
|
+
if "properties" in schema_obj and isinstance(schema_obj["properties"], dict):
|
27
22
|
for _, prop_value in schema_obj["properties"].items():
|
28
23
|
if isinstance(prop_value, dict):
|
29
24
|
# Remove examples, pattern, and default from this property
|
@@ -35,9 +30,7 @@ def _remove_examples_from_schema(schema_obj: t.Dict[str, t.Any]) -> None:
|
|
35
30
|
del prop_value["default"]
|
36
31
|
|
37
32
|
# Ensure 'items' has a 'type' key
|
38
|
-
if "items" in prop_value and isinstance(
|
39
|
-
prop_value["items"], dict
|
40
|
-
):
|
33
|
+
if "items" in prop_value and isinstance(prop_value["items"], dict):
|
41
34
|
if "type" not in prop_value["items"]:
|
42
35
|
# Default to string type for items if not specified
|
43
36
|
prop_value["items"]["type"] = "string"
|
@@ -67,6 +60,7 @@ def _remove_examples_from_schema(schema_obj: t.Dict[str, t.Any]) -> None:
|
|
67
60
|
if isinstance(item, dict):
|
68
61
|
_remove_examples_from_schema(item)
|
69
62
|
|
63
|
+
|
70
64
|
class OpenAIAgentsProvider(
|
71
65
|
AgenticProvider[FunctionTool, list[FunctionTool]],
|
72
66
|
name="openai_agents",
|
@@ -81,6 +75,7 @@ class OpenAIAgentsProvider(
|
|
81
75
|
execute_tool: AgenticProviderExecuteFn,
|
82
76
|
) -> FunctionTool:
|
83
77
|
"""Wrap a tool as a FunctionTool."""
|
78
|
+
|
84
79
|
# Create a function that accepts explicit JSON string for parameters
|
85
80
|
# This avoids the issue with **kwargs in schema validation
|
86
81
|
async def execute_tool_wrapper(_ctx, payload):
|
File without changes
|
@@ -0,0 +1,79 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: composio-openai-agents
|
3
|
+
Version: 1.0.0rc6
|
4
|
+
Summary: Use Composio to get array of strongly typed tools for OpenAI Agents
|
5
|
+
Home-page: https://github.com/ComposioHQ/composio
|
6
|
+
Author: Composio
|
7
|
+
Author-email: Composio <tech@composio.dev>
|
8
|
+
Project-URL: Homepage, https://github.com/ComposioHQ/composio
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
11
|
+
Classifier: Operating System :: OS Independent
|
12
|
+
Requires-Python: >=3.9,<4
|
13
|
+
Description-Content-Type: text/markdown
|
14
|
+
Requires-Dist: openai-agents>=0.0.3
|
15
|
+
Requires-Dist: composio
|
16
|
+
Dynamic: author
|
17
|
+
Dynamic: home-page
|
18
|
+
Dynamic: requires-python
|
19
|
+
|
20
|
+
# Composio Integration for OpenAI Agents
|
21
|
+
|
22
|
+
This package integrates the OpenAI Agents framework with Composio, allowing you to use Composio's rich set of tools with the OpenAI Agents framework.
|
23
|
+
|
24
|
+
## Installation
|
25
|
+
|
26
|
+
```bash
|
27
|
+
pip install composio_openai_agents
|
28
|
+
```
|
29
|
+
|
30
|
+
## Usage
|
31
|
+
|
32
|
+
```python
|
33
|
+
import asyncio
|
34
|
+
import dotenv
|
35
|
+
from agents import Agent, Runner
|
36
|
+
|
37
|
+
from composio_openai_agents import Action, ComposioToolSet
|
38
|
+
|
39
|
+
# Load environment variables from .env
|
40
|
+
dotenv.load_dotenv()
|
41
|
+
|
42
|
+
# Initialize Composio toolset
|
43
|
+
composio_toolset = ComposioToolSet()
|
44
|
+
|
45
|
+
# Get all the tools
|
46
|
+
tools = composio_toolset.get_tools(actions=[Action.GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER])
|
47
|
+
|
48
|
+
# Create an agent with the tools
|
49
|
+
agent = Agent(
|
50
|
+
name="GitHub Agent",
|
51
|
+
instructions="You are a helpful assistant that helps users with GitHub tasks.",
|
52
|
+
tools=tools,
|
53
|
+
)
|
54
|
+
|
55
|
+
# Run the agent
|
56
|
+
async def main():
|
57
|
+
result = await Runner.run(agent, "Star the repository composiohq/composio on GitHub")
|
58
|
+
print(result.final_output)
|
59
|
+
|
60
|
+
asyncio.run(main())
|
61
|
+
```
|
62
|
+
|
63
|
+
## Features
|
64
|
+
|
65
|
+
- Seamlessly integrate Composio's tools with OpenAI Agents
|
66
|
+
- Access hundreds of pre-built API integrations
|
67
|
+
- Maintain consistent schema formats between frameworks
|
68
|
+
- Error handling for validation issues
|
69
|
+
- Proper type annotations that work with mypy and pylance
|
70
|
+
|
71
|
+
## Requirements
|
72
|
+
|
73
|
+
- Python 3.9+
|
74
|
+
- OpenAI Agents framework
|
75
|
+
- Composio (with valid API key)
|
76
|
+
|
77
|
+
## License
|
78
|
+
|
79
|
+
Apache 2.0
|
@@ -0,0 +1,11 @@
|
|
1
|
+
README.md
|
2
|
+
pyproject.toml
|
3
|
+
setup.py
|
4
|
+
composio_openai_agents/__init__.py
|
5
|
+
composio_openai_agents/provider.py
|
6
|
+
composio_openai_agents/py.typed
|
7
|
+
composio_openai_agents.egg-info/PKG-INFO
|
8
|
+
composio_openai_agents.egg-info/SOURCES.txt
|
9
|
+
composio_openai_agents.egg-info/dependency_links.txt
|
10
|
+
composio_openai_agents.egg-info/requires.txt
|
11
|
+
composio_openai_agents.egg-info/top_level.txt
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
composio_openai_agents
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "composio-openai-agents"
|
3
|
-
version = "1.0.0-
|
3
|
+
version = "1.0.0-rc6"
|
4
4
|
description = "Use Composio to get array of strongly typed tools for OpenAI Agents"
|
5
5
|
readme = "README.md"
|
6
6
|
requires-python = ">=3.9,<4"
|
@@ -19,7 +19,3 @@ dependencies = [
|
|
19
19
|
|
20
20
|
[project.urls]
|
21
21
|
Homepage = "https://github.com/ComposioHQ/composio"
|
22
|
-
|
23
|
-
[build-system]
|
24
|
-
requires = ["hatchling"]
|
25
|
-
build-backend = "hatchling.build"
|
@@ -6,10 +6,9 @@ from pathlib import Path
|
|
6
6
|
|
7
7
|
from setuptools import find_packages, setup
|
8
8
|
|
9
|
-
|
10
9
|
setup(
|
11
10
|
name="composio_openai_agents",
|
12
|
-
version="1.0.0-
|
11
|
+
version="1.0.0-rc6",
|
13
12
|
author="Composio",
|
14
13
|
author_email="tech@composio.dev",
|
15
14
|
description="Use Composio to get array of strongly typed tools for OpenAI Agents",
|
@@ -1,186 +0,0 @@
|
|
1
|
-
############################
|
2
|
-
## Project Specific Items ##
|
3
|
-
############################
|
4
|
-
try.ipynb
|
5
|
-
refactor_debug.ipynb
|
6
|
-
temp
|
7
|
-
|
8
|
-
.vscode
|
9
|
-
#############################################
|
10
|
-
## From @Github/gitignore/Python.gitignore ##
|
11
|
-
#############################################
|
12
|
-
# Byte-compiled / optimized / DLL files
|
13
|
-
#
|
14
|
-
__pycache__/
|
15
|
-
*.py[cod]
|
16
|
-
*$py.class
|
17
|
-
|
18
|
-
# C extensions
|
19
|
-
*.so
|
20
|
-
|
21
|
-
# Distribution / packaging
|
22
|
-
.Python
|
23
|
-
build/
|
24
|
-
develop-eggs/
|
25
|
-
dist/
|
26
|
-
downloads/
|
27
|
-
eggs/
|
28
|
-
.eggs/
|
29
|
-
lib/
|
30
|
-
lib64/
|
31
|
-
parts/
|
32
|
-
sdist/
|
33
|
-
var/
|
34
|
-
wheels/
|
35
|
-
share/python-wheels/
|
36
|
-
*.egg-info/
|
37
|
-
.installed.cfg
|
38
|
-
*.egg
|
39
|
-
MANIFEST
|
40
|
-
|
41
|
-
# PyInstaller
|
42
|
-
# Usually these files are written by a python script from a template
|
43
|
-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
44
|
-
*.manifest
|
45
|
-
*.spec
|
46
|
-
|
47
|
-
# Installer logs
|
48
|
-
pip-log.txt
|
49
|
-
pip-delete-this-directory.txt
|
50
|
-
|
51
|
-
# Unit test / coverage reports
|
52
|
-
htmlcov/
|
53
|
-
.tox/
|
54
|
-
.nox/
|
55
|
-
.coverage
|
56
|
-
.coverage.*
|
57
|
-
.cache
|
58
|
-
nosetests.xml
|
59
|
-
coverage.xml
|
60
|
-
*.cover
|
61
|
-
*.py,cover
|
62
|
-
.hypothesis/
|
63
|
-
.pytest_cache/
|
64
|
-
cover/
|
65
|
-
|
66
|
-
# Translations
|
67
|
-
*.mo
|
68
|
-
*.pot
|
69
|
-
|
70
|
-
# Django stuff:
|
71
|
-
*.log
|
72
|
-
local_settings.py
|
73
|
-
db.sqlite3
|
74
|
-
db.sqlite3-journal
|
75
|
-
|
76
|
-
# Flask stuff:
|
77
|
-
instance/
|
78
|
-
.webassets-cache
|
79
|
-
|
80
|
-
# Scrapy stuff:
|
81
|
-
.scrapy
|
82
|
-
|
83
|
-
# Sphinx documentation
|
84
|
-
docs/_build/
|
85
|
-
|
86
|
-
# PyBuilder
|
87
|
-
.pybuilder/
|
88
|
-
target/
|
89
|
-
|
90
|
-
# Jupyter Notebook
|
91
|
-
.ipynb_checkpoints
|
92
|
-
|
93
|
-
# IPython
|
94
|
-
profile_default/
|
95
|
-
ipython_config.py
|
96
|
-
|
97
|
-
# pyenv
|
98
|
-
# For a library or package, you might want to ignore these files since the code is
|
99
|
-
# intended to run in multiple environments; otherwise, check them in:
|
100
|
-
# .python-version
|
101
|
-
|
102
|
-
# pipenv
|
103
|
-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
104
|
-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
105
|
-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
106
|
-
# install all needed dependencies.
|
107
|
-
Pipfile.lock
|
108
|
-
|
109
|
-
# UV
|
110
|
-
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
111
|
-
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
112
|
-
# commonly ignored for libraries.
|
113
|
-
#uv.lock
|
114
|
-
|
115
|
-
# poetry
|
116
|
-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
117
|
-
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
118
|
-
# commonly ignored for libraries.
|
119
|
-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
120
|
-
#poetry.lock
|
121
|
-
|
122
|
-
# pdm
|
123
|
-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
124
|
-
#pdm.lock
|
125
|
-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
126
|
-
# in version control.
|
127
|
-
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
128
|
-
.pdm.toml
|
129
|
-
.pdm-python
|
130
|
-
.pdm-build/
|
131
|
-
|
132
|
-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
133
|
-
__pypackages__/
|
134
|
-
|
135
|
-
# Celery stuff
|
136
|
-
celerybeat-schedule
|
137
|
-
celerybeat.pid
|
138
|
-
|
139
|
-
# SageMath parsed files
|
140
|
-
*.sage.py
|
141
|
-
|
142
|
-
# Environments
|
143
|
-
.env
|
144
|
-
.venv
|
145
|
-
env/
|
146
|
-
venv/
|
147
|
-
ENV/
|
148
|
-
env.bak/
|
149
|
-
venv.bak/
|
150
|
-
|
151
|
-
# Spyder project settings
|
152
|
-
.spyderproject
|
153
|
-
.spyproject
|
154
|
-
|
155
|
-
# Rope project settings
|
156
|
-
.ropeproject
|
157
|
-
|
158
|
-
# mkdocs documentation
|
159
|
-
/site
|
160
|
-
|
161
|
-
# mypy
|
162
|
-
.mypy_cache/
|
163
|
-
.dmypy.json
|
164
|
-
dmypy.json
|
165
|
-
|
166
|
-
# Pyre type checker
|
167
|
-
.pyre/
|
168
|
-
|
169
|
-
# pytype static type analyzer
|
170
|
-
.pytype/
|
171
|
-
|
172
|
-
# Cython debug symbols
|
173
|
-
cython_debug/
|
174
|
-
|
175
|
-
# PyCharm
|
176
|
-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
177
|
-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
178
|
-
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
179
|
-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
180
|
-
#.idea/
|
181
|
-
|
182
|
-
# Ruff stuff:
|
183
|
-
.ruff_cache/
|
184
|
-
|
185
|
-
# PyPI configuration file
|
186
|
-
.pypirc
|
@@ -1,36 +0,0 @@
|
|
1
|
-
import asyncio
|
2
|
-
|
3
|
-
from agents import Agent, Runner
|
4
|
-
|
5
|
-
from composio import Composio
|
6
|
-
from composio_openai_agents import OpenAIAgentsProvider
|
7
|
-
|
8
|
-
# Initialize Composio toolset
|
9
|
-
composio = Composio(provider=OpenAIAgentsProvider())
|
10
|
-
|
11
|
-
# Get all the tools
|
12
|
-
tools = composio.tools.get(
|
13
|
-
user_id="default",
|
14
|
-
tools=["GITHUB_STAR_A_REPOSITORY_FOR_THE_AUTHENTICATED_USER"],
|
15
|
-
)
|
16
|
-
|
17
|
-
# Create an agent with the tools
|
18
|
-
agent = Agent(
|
19
|
-
name="GitHub Agent",
|
20
|
-
instructions="You are a helpful assistant that helps users with GitHub tasks.",
|
21
|
-
tools=tools,
|
22
|
-
)
|
23
|
-
|
24
|
-
# Run the agent
|
25
|
-
async def main():
|
26
|
-
result = await Runner.run(
|
27
|
-
starting_agent=agent,
|
28
|
-
input=(
|
29
|
-
"Star the repository composiohq/composio on GitHub. If done "
|
30
|
-
"successfully, respond with 'Action executed successfully'"
|
31
|
-
),
|
32
|
-
)
|
33
|
-
print(result.final_output)
|
34
|
-
|
35
|
-
|
36
|
-
asyncio.run(main())
|
File without changes
|