MCP Server Framework and Tool Development library for building custom capabilities into agents.
Find a file
Nate Barbettini 894fa878f1
Fix ruff (#64)
On the last few PRs I have noticed two problems:
1. `ruff format` fails even though it seems OK on our local machines
(sometimes, not always)
2. Nate's and Sam's machines kept flip-flopping a specific piece of
formatting back and forth, indicating a subtle difference of config
hiding somewhere
3. This was reproducible by running `ruff format` in the terminal,
followed by `make check`. The former would edit files, and then `make
check` would edit them back!

This PR addresses both issues, and further standardizes our editor &
linter configs to be super stable.
Specifically:
1. The main fix for the above, the pre-commit hook was pinned to a super
old version of ruff.
This resulted in subtle differences in behavior between our machines,
and on CI.

2. Moved ruff settings from `pyproject.toml` to `.ruff.toml`
pyproject files in subdirectories (e.g. `toolkits/**`) were overriding
the main pyproject file and erasing the custom ruff config we set at the
root. This meant that our ruff config was applied to `arcade` but not to
any of the other packages.
By moving the config to `.ruff.toml` at the root, all projects will
inherit the same ruff linting & formatting config.

4. Un-ignored the `.vscode/` directory so that we can share
vscode/cursor workspace settings.
This is valuable for standardizing settings like the default formatter
(ruff) and default test framework (pytest).
However, it's important that going forward we _only_ commit things here
that should apply across all of our machines.

5. To avoid any conflict between prettier and ruff, prettier now
explicitly ignores *.py files

6. Finally, `ruff format` and `make check` agree. A number of files are
newly auto-formatted.
2024-09-25 09:47:30 -07:00
.github Generate poetry.lock before caching (#63) 2024-09-25 09:46:29 -07:00
.vscode Fix ruff (#64) 2024-09-25 09:47:30 -07:00
arcade Fix ruff (#64) 2024-09-25 09:47:30 -07:00
docker Update dockerfile to install extras on build (#61) 2024-09-24 18:18:10 -07:00
examples Fix ruff (#64) 2024-09-25 09:47:30 -07:00
schemas/preview SDK: Fully qualified tool names (#47) 2024-09-23 15:47:36 -07:00
toolkits Fix ruff (#64) 2024-09-25 09:47:30 -07:00
.editorconfig Fix ruff (#64) 2024-09-25 09:47:30 -07:00
.gitignore Fix ruff (#64) 2024-09-25 09:47:30 -07:00
.pre-commit-config.yaml Fix ruff (#64) 2024-09-25 09:47:30 -07:00
.prettierignore Fix ruff (#64) 2024-09-25 09:47:30 -07:00
.prettierrc.toml Fix ruff (#64) 2024-09-25 09:47:30 -07:00
.ruff.toml Fix ruff (#64) 2024-09-25 09:47:30 -07:00
CONTRIBUTING.md MyPy Compliant (#5) 2024-07-16 17:01:38 -07:00
cspell.config.yaml Refactor into library approach (#7) 2024-07-23 16:26:54 -07:00
LICENSE Tool SDK, Schemas (#2) 2024-07-14 23:37:46 -07:00
Makefile Release python (#48) 2024-09-20 16:42:53 -07:00
README.md Add initial X toolkit, remove Github toolkit, rename math toolkit (#52) 2024-09-23 13:42:22 -07:00

Release Build status codecov Commit activity License

Arcade AI

Arcade AI is the developer platform for building tools designed to be used with language models. With Arcade, developers can create, deploy, and easily integrate new tools with language models to enhance their capabilities.

arcade-ai

The arcade-ai package contains:

  • arcade CLI
  • arcade.sdk Tool SDK
  • arcade.actor serving tools with FastAPI, Flask, or Django

Installation

To install the Arcade AI package, execute the following command:

pip install arcade-ai

or install from source:

git clone https://github.com/arcadeai/arcade-ai.git
cd arcade-ai
pip install poetry
poetry install

First steps

Follow these steps if you've cloned the repo and installed the package from source:

cd examples/search
poetry install

arcade show arcade_search

This will show an output that looks like

┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━┓ ┃ Name ┃ Description ┃ Toolkit ┃ Version ┃ ┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━┩ │ SearchGoogle │ Search Google using SerpAPI and return organic search results. │ search │ 0.1.0 │ └──────────────┴────────────────────────────────────────────────────────────────┴───────────┴─────────┘

Predict the parameters with a model and run the tool with the predicted parameters. Arcade adds the execute choice to the tool, which allows you to run the tool with the predicted parameters in a single request.

> arcade run arcade_search "who is Sam Partee?" --choice "execute"
Running tool: SearchGoogle with params: {'query': 'Sam Partee'}

[{"position": 1, "title": "Sam Partee (@SamPartee) / X", "link": "https://twitter.com/sampartee", "redirect_link":
"https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://twitter.com/sampartee&ved=2ahUKEwjBwKiz3b6HAxV1VTABHXL8BZQQFnoECAYQAQ",
"displayed_link": "1.5K+ followers", "thumbnail":
.....
.. (truncated)

Arcade also adds the predict choice to the tool, which allows you to predict the parameters with a model.

> arcade run arcade_search "who is Sam Partee?" --choice "predict" # also the default
Running tool: SearchGoogle with params: {'query': 'Sam Partee'}

Sam Partee is a CTO, Co-founder of Arcade AI and former Machine Learning Engineer at companies like RedisInc and HPE_Cray. They have
expertise in AI/ML, vector search, Python, HPC, and are a sports fan.