Skip to content

Commit c2fc759

Browse files
committed
Initial commit
0 parents  commit c2fc759

File tree

13 files changed

+2035
-0
lines changed

13 files changed

+2035
-0
lines changed

.gitignore

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
# .python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
#Pipfile.lock
96+
97+
# UV
98+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
#uv.lock
102+
103+
# poetry
104+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108+
#poetry.lock
109+
110+
# pdm
111+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112+
#pdm.lock
113+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114+
# in version control.
115+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116+
.pdm.toml
117+
.pdm-python
118+
.pdm-build/
119+
120+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121+
__pypackages__/
122+
123+
# Celery stuff
124+
celerybeat-schedule
125+
celerybeat.pid
126+
127+
# SageMath parsed files
128+
*.sage.py
129+
130+
# Environments
131+
.env
132+
.venv
133+
env/
134+
venv/
135+
ENV/
136+
env.bak/
137+
venv.bak/
138+
139+
# Spyder project settings
140+
.spyderproject
141+
.spyproject
142+
143+
# Rope project settings
144+
.ropeproject
145+
146+
# mkdocs documentation
147+
/site
148+
149+
# mypy
150+
.mypy_cache/
151+
.dmypy.json
152+
dmypy.json
153+
154+
# Pyre type checker
155+
.pyre/
156+
157+
# pytype static type analyzer
158+
.pytype/
159+
160+
# Cython debug symbols
161+
cython_debug/
162+
163+
# PyCharm
164+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166+
# and can be added to the global gitignore or merged into this file. For a more nuclear
167+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
168+
#.idea/
169+
170+
# Ruff stuff:
171+
.ruff_cache/
172+
173+
# PyPI configuration file
174+
.pypirc

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"tabWidth": 4,
3+
"overrides": [
4+
{
5+
"files": "*.yml",
6+
"options": {
7+
"tabWidth": 2
8+
}
9+
}
10+
]
11+
}

LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2025, Renato Byrro
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
1. Redistributions of source code must retain the above copyright notice, this
9+
list of conditions and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
3. Neither the name of the copyright holder nor the names of its
16+
contributors may be used to endorse or promote products derived from
17+
this software without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.PHONY: sync
2+
sync:
3+
uv sync --all-extras --all-packages --group dev
4+
5+
.PHONY: format
6+
format:
7+
uv run ruff format
8+
9+
.PHONY: lint
10+
lint:
11+
uv run ruff check
12+
13+
.PHONY: mypy
14+
mypy:
15+
uv run mypy .
16+
17+
.PHONY: tests
18+
tests:
19+
uv run pytest
20+
21+
.PHONY: build-docs
22+
build-docs:
23+
uv run mkdocs build
24+
25+
.PHONY: serve-docs
26+
serve-docs:
27+
uv run mkdocs serve
28+
29+
.PHONY: deploy-docs
30+
deploy-docs:
31+
uv run mkdocs gh-deploy --force --verbose

README.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<h3 align="center">
2+
<a name="readme-top"></a>
3+
<img
4+
src="https://docs.arcade.dev/images/logo/arcade-logo.png"
5+
>
6+
</h3>
7+
<div align="center">
8+
<h3>Arcade Integration for OpenAI Agents</h3>
9+
<a href="https://github.com/your-organization/agents-arcade/blob/main/LICENSE">
10+
<img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License">
11+
</a>
12+
<a href="https://pypi.org/project/agents-arcade/">
13+
<img src="https://img.shields.io/pypi/v/agents-arcade.svg" alt="PyPI">
14+
</a>
15+
</div>
16+
17+
<p align="center">
18+
<a href="https://docs.arcade.dev" target="_blank">Arcade Documentation</a> •
19+
<a href="https://docs.arcade.dev/toolkits" target="_blank">Toolkits</a> •
20+
<a href="https://github.com/ArcadeAI/arcade-py" target="_blank">Arcade Python Client</a> •
21+
<a href="https://platform.openai.com/docs/guides/agents" target="_blank">OpenAI Agents</a>
22+
</p>
23+
24+
# agents-arcade
25+
26+
`agents-arcade` provides an integration between [Arcade](https://docs.arcade.dev) and the [OpenAI Agents Library](https://github.com/openai/openai-python). This allows you to enhance your AI agents with Arcade's extensive toolkit ecosystem, including tools that reqwuire authorization like Google Mail, Linkedin, X, and more.
27+
28+
## Installation
29+
30+
```bash
31+
pip install agents-arcade
32+
```
33+
34+
## Basic Usage
35+
36+
```python
37+
from agents import Agent, RunConfig, Runner
38+
from arcadepy import AsyncArcade
39+
40+
from agents_arcade import get_arcade_tools
41+
42+
43+
async def main():
44+
client = AsyncArcade()
45+
tools = await get_arcade_tools(client, ["google"])
46+
47+
google_agent = Agent(
48+
name="Google agent",
49+
instructions="You are a helpful assistant that can assist with Google API calls.",
50+
model="gpt-4o-mini",
51+
tools=tools,
52+
)
53+
54+
result = await Runner.run(
55+
starting_agent=google_agent,
56+
input="What are my latest emails?",
57+
context={"user_id": "user@example.com"},
58+
)
59+
print("Final output:\n\n", result.final_output)
60+
61+
62+
if __name__ == "__main__":
63+
import asyncio
64+
65+
asyncio.run(main())
66+
```
67+
68+
## Key Features
69+
70+
- **Easy Integration**: Simple API (one function) to connect Arcade tools with OpenAI Agents
71+
- **Extensive Toolkit Support**: Access to all Arcade toolkits including Gmail, Google Drive, Search, and more
72+
- **Asynchronous Support**: Built with async/await for compatibility with OpenAI's Agent framework
73+
- **Authentication Handling**: Manages authorization for tools requiring user permissions like Google, LinkedIn, etc
74+
75+
## Available Toolkits
76+
77+
Arcade provides many toolkits including:
78+
79+
- **Google**: Gmail, Google Drive, Google Calendar
80+
- **Search**: Google search, Bing search
81+
- **Web**: Crawling, scraping, etc
82+
- **Github**: Repository operations
83+
- **Slack**: Sending messages to Slack
84+
- **LinkedIn**: Posting to LinkedIn
85+
- **X**: Posting and reading tweets on X
86+
- And many more
87+
88+
For a complete list, see the [Arcade Toolkits documentation](https://docs.arcade.dev/toolkits).
89+
90+
## Authentication
91+
92+
Many Arcade tools require user authentication. The authentication flow is managed by Arcade and can be triggered by providing a `user_id` in the context when running your agent. Refer to the Arcade documentation for more details on managing tool authentication.
93+
94+
## License
95+
96+
This project is licensed under the MIT License - see the LICENSE file for details.

agents_arcade/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .tools import get_arcade_tools
2+
3+
__all__ = ["get_arcade_tools"]

0 commit comments

Comments
 (0)