Commit graph

170 commits

Author SHA1 Message Date
Shub
0246682a30
fix: update typer dependency to ^0.10.0 to fix Python 3.13 compatibility (#413) 2025-05-29 10:56:03 -04:00
Sterling Dreyer
f8907684b7
Cleanup deploy exceptions (#410) 2025-05-23 17:21:47 -07:00
Sam Partee
24758ad35a
DevEx: Hot Reload all installed toolkits on save (#400)
Add hot-reload capability 

adds watchfiles dependency and changes uvicorn server logic
but does not have any breaking changes.

---------

Co-authored-by: Eric Gustin <eric@arcade.dev>
Co-authored-by: sdreyer <sterling@arcade-ai.com>
Co-authored-by: Eric Gustin <34000337+EricGustin@users.noreply.github.com>
2025-05-21 21:50:33 -07:00
Evan Tahler
28637f5543
Revert "Arcade Gateway" (#403)
Reverts ArcadeAI/arcade-ai#401
2025-05-20 14:24:08 -07:00
Evan Tahler
bd1d75970d
Arcade Gateway (#401)
Updating the CLI and Docs to say "gateway" not "engine". I didn't touch
the code
2025-05-16 16:43:08 -07:00
Sterling Dreyer
c128717e53
Worker status polling (#385)
Changes deployments so that worker status is polled instead of waiting
in a single request to reduce risk of proxy timeouts
2025-05-09 10:43:39 -07:00
Sterling Dreyer
31470f8954
Remove credential requirements from arcade serve (#390) 2025-05-02 16:27:22 -07:00
Sam Partee
02653ff28b
Fix bug in Arcade new (#389) 2025-05-02 14:31:06 -07:00
Renato Byrro
09539db25a
Add Asana class to auth init (#388)
missed this in the previous PR to add asana class
2025-05-02 18:11:50 -03:00
Eric Gustin
2de123f271
Fix local worker toolkit registration (#387)
This PR fixes two bugs:
1. `serve_default_worker` was not registering toolkits to the worker
(non mcp). This caused workers created during `arcade workerup` and
`arcade serve` to have 0 tools.
2. We were logging the number of files in the toolkit as the number of
tools in the toolkit.
2025-05-02 13:38:58 -07:00
Sam Partee
9bc1cd4a12
Support for MCP stdio transport (#368)
MCP stdio Implementation:

The PR adds support for standard input/output (stdio) as a transport
mechanism for the Message Control Protocol. This is a replacement to the
SSE (Server-Sent Events) transport that was worked on in PR #359 but
will not be merged as it's not deprecated.

This will allow developers to use Arcade tools (written by the dev or
Arcade) in Claude, Cursor, windsurf, etc.

The engine Gateway already supports adding HTTPS streamable (replacement
for SSE) MCP servers as tool servers, and will soon support full gateway
capability in the client API as well.

To use any existing Toolkit just 

## Examples

### Quickstart setup with existing toolkits

```bash
pip install arcade-ai
pip install <name of toolkit> # ex. arcade-google
arcade serve --mcp
```

### Run with Claude

Just add the following to the Claude config

```json
{
  "mcpServers": {
    "arcade": {
      "command": "bash",
      "args": ["-c", "export ARCADE_API_KEY=arc_xxxx && /path/to/python /path/to/arcade serve --mcp"]
    }
  }
}
```

### Customizing the Tool Server

Developers can customize their served tools and server furthermore by
importing the worker sdk

```python

import arcade_google  # pip install arcade_google
import arcade_search  # pip install arcade_search

from arcade.core.catalog import ToolCatalog
from arcade.worker.mcp.stdio import StdioServer

# 2. Create and populate the tool catalog
catalog = ToolCatalog()
catalog.add_module(arcade_google)  # Registers all tools in the package
catalog.add_module(arcade_search)


# 3. Main entrypoint
async def main():
    # Create the worker with the tool catalog
    worker = StdioServer(catalog)

    # Run the worker
    await worker.run()


if __name__ == "__main__":
    import asyncio

    asyncio.run(main())
    
 ```
 
 Then to run with claude, just run this python file instead of the prebuilt server used in ``arcade serve --mcp``
2025-05-02 06:27:43 -07:00
Renato Byrro
60c3bbe3fa
Add Asana auth class (#380) 2025-04-29 10:09:21 -07:00
Eric Gustin
817131c6ce
Add arcade dashboard CLI Command (#330)
* `arcade dashboard` opens the Arcade Dashboard in a web browser.
Defaults to `https://api.arcade.dev/dashboard`, but is configurable via
flags.


* `arcade dashboard --local` opens your locally hosted Arcade Dashboard
in a web browser.


* Performs a health check of the engine and will print a warning to the
console if the Engine is not healthy / not running.


----------------------------------------

* Inspiration from https://minikube.sigs.k8s.io/docs/handbook/dashboard/
2025-04-28 10:22:55 -07:00
Eric Gustin
ef886bb503
Microsoft Outlook Mail Tools (#377)
| Name | Description |

|------------------------------|--------------------------------------------------------------------------------|
| Microsoft.CreateDraftEmail | Compose a new draft email in Outlook |
| Microsoft.UpdateDraftEmail | Update an existing draft email in Outlook
|
| Microsoft.CreateAndSendEmail | Create and immediately send a new email
in Outlook to the specified recipients |
| Microsoft.SendDraftEmail | Send an existing draft email in Outlook |
| Microsoft.ReplyToEmail | Reply only to the sender of an existing email
in Outlook |
| Microsoft.ReplyAllToEmail | Reply to all recipients of an existing
email in Outlook |
| Microsoft.ListEmails | List emails in the user's mailbox across all
folders |
| Microsoft.ListEmailsInFolder | List the user's emails in the specified
folder |
2025-04-24 14:27:52 -07:00
Renato Byrro
ea14b898b4
Add Hubspot OAuth class (#372) 2025-04-21 17:55:45 -03:00
Eric Gustin
edac6ab48d
Add Microsoft as well-known auth provider (#369) 2025-04-18 14:26:08 -07:00
Eric Gustin
ad713e4939
Tool Metadata (#357) 2025-04-16 19:17:36 -08:00
Eric Gustin
ae3b02f79e
Support PEP 604 Union Types (#347)
⚠️ Local Worker will not work with Slack toolkit until this is merged 

Support [PEP 604](https://peps.python.org/pep-0604/) Union Types for
tool input param types and return types.

https://github.com/ArcadeAI/arcade-ai/pull/345 introduced PEP 604 Union
Types into our toolkits, but the worker did not support this syntax, so
it was failing on start up if a tool used bar syntax in its return type
(Slack).

Additionally, optionals defined with `Union[T, None]` were already
supported, but didn't have any unit tests, so I added them.
2025-04-07 10:52:53 -07:00
Sam Partee
3fa06f5ef1
fix terminal (#349)
Fix terminal output
2025-04-05 13:20:53 -07:00
Eric Gustin
6af49ef068
Common changes in all toolkits (#345)
Addresses general improvements to all toolkits including changing ruff
from python 3.9 to python 3.10 which is the reason for the removal of
Optional[] among others.

Also, turns out that our `make install` for toolkits wasn't correctly
checking for whether poetry was installed (&> /dev/null syntax isn't
supported by our check-toolkits GitHub action, so we were installing
poetry twice. I replaced with the more portable >/dev/null 2>&1)

Question: Should we also change ruff to py310 for the `arcade/` package
in a later PR?

-------------------

CU-86b4gzyp6
2025-04-04 09:32:37 -07:00
Eric Gustin
2dd7719517
Skip listing tools that aren't valid ToolDefinitions (#340)
The tool used in the mcp demo isn't a valid ToolDefinition.

Unable to list tool 'Demo.lorem': 1 validation error for ToolDefinition
requirements Input should be a valid dictionary or
instance of ToolRequirements For further information visit
https://errors.pydantic.dev/2.10/v/model_type
2025-04-01 14:20:17 -07:00
Renato Byrro
351814aa74
In arcade chat, ground the LLM with today's date for better accuracy (#337)
Some tools have date-related arguments where LLMs fail to provide the
correct values if the user asks in a relative way (e.g. next Monday,
last month, etc). By including today's date and day of the week in the
`arcade chat` system prompt, we avoid that issue.
2025-04-01 00:33:08 -03:00
Eric Gustin
89a009d1af
Normalize arcade show -T input (#331)
Small change that normalizes the toolkit package name to use underscores
instead of hyphens. Python packages use underscores, not hyphens
2025-03-27 10:38:37 -07:00
Renato Byrro
d91e417c8d
Improve error message when an exception is raised at toolkit import time upon Worker startup (#327)
Upon Worker startup, when an exception raised in a toolkit at import
time, the worker logged output will not display the cause of the
exception, or even that there was an exception raised in the toolkit.

Instead, the worker logs only a not very useful message:

```
 Failed to start Arcade Worker: Could not find tool {tool_name} in module {toolkit_name}.tools.{module_name}
```

This PR improves the logged message by adding the cause of the error.
2025-03-24 22:31:49 -03:00
Eric Gustin
e26f647c3d
Add 'Invalid Renamed Tool Parameter' Check (#324)
Arcade tools can rename parameters like so,

```py
@tool()
def func_with_renamed_param(
    param1: Annotated[str, "MyRenamedParam", "The first parameter"],
):
    pass
```

but there is no check for whether the renamed parameter is a valid
identifier.

Anthropic models, for example, will fail if a renamed parameter is not a
valid identifier (which was the cause for
https://github.com/ArcadeAI/arcade-ai/pull/319).
2025-03-22 09:25:56 -07:00
Sterling Dreyer
f7f9489c3e
Deployment Secrets (#301)
Allows environment variables to be used as secrets
2025-03-17 21:17:17 -07:00
Eric Gustin
b3d254fe56
Relax arcade-ai dep for arcade new (#308) 2025-03-17 17:13:27 -07:00
Sterling Dreyer
54fb135a3c
Allow workerup to run without login (#296) 2025-03-15 14:47:43 -07:00
Nate Barbettini
ef5b19b4a2
feat: Add Reddit and Twitch named providers (#294)
Adding auth support for future Reddit and Twitch tools.
2025-03-14 13:52:46 -07:00
Sterling Dreyer
6cafadac9c
Disable Toml Deployment Updates (#291) 2025-03-13 10:58:30 -07:00
Sterling Dreyer
2df682f3b0
Add packaging requirement (#290) 2025-03-13 10:57:00 -07:00
Sterling Dreyer
a181dc5681
Worker Deploy (#278) 2025-03-13 09:02:36 -07:00
Sterling Dreyer
eed4c0181b
Arcade Serve (#274)
Co-authored-by: Sam Partee <sam@arcade-ai.com>
2025-03-07 18:40:26 -08:00
Eric Gustin
16db170b2c
Update arcade new (#266)
* New README
2025-03-07 18:38:14 -08:00
Eric Gustin
4608cce862
Fix parameterized type bug & better error message (#273)
## PR Description
### 1. Bug Fix
A bug was observed where tools that were using [parameterized
generics](https://docs.python.org/3/library/stdtypes.html#types-genericalias)
(e.g., `dict[str, Any]`) for their input parameters or output, then this
would cause the Worker to fail on startup with the error `issubclass()
arg 1 must be a class` for Python3.13+. This error would not occur for
Python versions less than 3.13.

In Python <3.13, parameterized generics would implicitly be treated as
their underlying type (its origin), so it was possible to treat
`dict[str, Any]` as a class and pass it to `issubclass`. This is not the
case for Python 3.13, so we need to explicitly strip the GenericAlias
(e.g., `dict[str, Any]`) down to its origin (e.g., `dict`), before
checking if it is a subclass of `Enum`.

### 2. Better Error Message
When a tool used an unsupported parameter/output type, then Arcade would
display the following message:
```
Failed to start Arcade Worker: 
Type error encountered while adding tool get_website_map from arcade_web.tools.firecrawl. 
Reason: issubclass() arg 1 must be a class
```

But now it displays
```
Failed to start Arcade Worker: 
Error encountered while adding tool get_website_map from arcade_web.tools.firecrawl. 
Reason: Unsupported type: tuple[str, str]
```
2025-03-07 11:46:42 -08:00
Eric Gustin
fb69e9ef77
Add Notion Auth Provider (#277)
<img width="409" alt="Screenshot 2025-03-06 at 11 01 24 AM"
src="https://github.com/user-attachments/assets/27cb160e-c8cc-4107-a455-aa1ee9b392c4"
/>
2025-03-06 16:06:52 -08:00
Nate Barbettini
3638038ddf
fix: Package version in pyproject.toml is wrong (#276)
Package [1.0.5](https://pypi.org/project/arcade-ai/1.0.5/) is currently
the latest on pypi. The version number in pyproject.toml got out of
sync.

The next release should be 1.1.0 to take into account these minor
version changes that _should_ have bumped the version:
- https://github.com/ArcadeAI/arcade-ai/pull/243
- https://github.com/ArcadeAI/arcade-ai/pull/252
2025-03-05 16:15:23 -08:00
Nate Barbettini
4a0e2b8667
fix: Tool secret keys must use a case-insensitive comparison (#275)
Missed one test case here.
2025-03-04 14:33:55 -08:00
Nate Barbettini
3f7226709f
feat: Tool secrets (#252)
SDK support for tool secrets (stored and managed by the engine):
- [x] New `requires_secrets=` option in the `@tool` decorator
- [x] Internal plumbing in the catalog and `ToolContext`
- [x] Full test coverage of all added code
- [x] Bumped minor version (new feature)

This PR can be merged without waiting for Engine changes, because it is
additive only (no breaking changes).

After this is merged, I will open another PR to update existing toolkits
that will benefit from this feature!
2025-02-27 15:56:11 -08:00
Nate Barbettini
7466543bde
fix: add missing --model option (#270)
Fixes an inconsistency in `arcade chat --help`.

Before:
<img width="590" alt="image"
src="https://github.com/user-attachments/assets/bf643e3c-ee12-421a-8cd3-e0d322c0972a"
/>

After:
<img width="588" alt="image"
src="https://github.com/user-attachments/assets/c0a40cdf-3429-468c-9bf1-9e3710907796"
/>
2025-02-27 15:45:47 -08:00
Eric Gustin
e636b686c1
Add @tool.deprecated (#247)
## PR Description
Add the ability to mark a tool as deprecated and display the warning in
the user's runtime. This PR also lays the foundation for future work for
emitting other levels of logs (debug, info, etc) that occur during the
tool's execution.

NOTE: Updates to the Arcade Clients (Python and JS) still need to be
done before the deprecation warning is emitted, but this PR needs to be
merged before those updates!

Let's cross our fingers that we'll never need to deprecate
`@tool.deprecated`!

### Example

1. Mark your tool as deprecated
```python
from typing import Annotated

from arcade.sdk import tool


@tool.deprecated("Use the 'Math.AddInt' tool instead.") # order of decorators does not matter
@tool
def add(
    a: Annotated[int, "The first number"], b: Annotated[int, "The second number"]
) -> Annotated[int, "The sum of the two numbers"]:
"""
Add two numbers together
"""
return a + b
```

2. Call the deprecated tool
```python
from arcadepy import Arcade

client = Arcade()

tool_input = {"a": 9001, "b": 42}

response = client.tools.execute(
    tool_name="Math.Add",
    input=tool_input,
    user_id="me@example.com",
)
print(f"The result of adding {tool_input['a']} and {tool_input['b']} is: {response.output.value}")
```

3. Observe the DeprecationWarning:
``` 
❯ python examples/call_a_tool_directly.py 
/Users/ericgustin/repos/Team/arcade-ai/examples/call_a_tool_directly.py:22: DeprecationWarning: 'Math.Add' is deprecated: Use the `Math.AddInt` tool instead.
  response = client.tools.execute(
The result of adding 9001 and 42 is: 9043
```
2025-02-18 13:27:49 -08:00
Eric Gustin
3870e84108
Workerup doesnt need to be logged in (#255) 2025-02-18 11:11:15 -08:00
Eric Gustin
49ff013e80
[Toolkit Release] Weekly Toolkit Release 02-13-25 (#248)
# Weekly Toolkit Release 02-13-25
Previous Toolkit Release: #236 

## Associated PRs
* Minor #241
2025-02-13 13:06:11 -08:00
Nate Barbettini
cb5cb7b730
fix: use correct UTF-8 encoding on Windows in arcade new (#246)
Fixes the linked issue. Tested on Windows 10
2025-02-12 14:50:46 -08:00
Eric Gustin
19086818d2
Make fastapi a regular dependency (#243)
## PR Description
Changes `pip install 'arcade-ai[fastapi]'` to `pip install arcade-ai`. 
In other words, FastAPI is now a required dependecy of arcade-ai.


Additionally, I snuck in some minor cleanup changes.
2025-02-10 15:30:51 -08:00
Eric Gustin
df969d9d73
Improve Arcade CLI (#244) 2025-02-08 10:56:04 -08:00
Eric Gustin
be2539602f
Evals New Features (#208)
# PR Description
This PR adds ~~four~~ three improvements to evals.

~~## 1. Add parameterized eval cases~~
~~Adds a new method named `add_parameterized_case`. Just like pytest’s
parameterized tests, eval cases can be parameterized with multiple user
messages. Adds a case to the `EvalSuite` for each user message. All
cases have the same expected tool call(s), params, additional_messages.
This reduces duplicate code and makes it easy to observe how a model
performs based on increasingly more difficult prompts.~~
```python
""" NO LONGER IN THIS PR
user_messages = [
    "Call the delete tweet by id tool with the tweet ID '148975632'.",
    "Delete the tweet with ID '148975632'.",
    "I don't want to have this tweet (148975632) on my account anymore.",
    "do the opposite of post for https://x.com/x/status/148975632",
]

suite.add_parameterized_case(
    name="Delete a tweet by ID",
    user_messages=user_messages,
    expected_tool_calls=[
        ExpectedToolCall(
            func=delete_tweet_by_id,
            args={"tweet_id": "148975632"},
        )
    ],
    critics=[
        BinaryCritic(
            critic_field="tweet_id",
            weight=1.0,
        ),
    ],
)
"""
```

~~PASSED Delete a tweet by ID (user_message 1 of 4) -- Score: 100.00%~~
~~PASSED Delete a tweet by ID (user_message 2 of 4) -- Score: 100.00%~~
~~PASSED Delete a tweet by ID (user_message 3 of 4) -- Score: 100.00%~~
~~FAILED Delete a tweet by ID (user_message 4 of 4) -- Score: 0.00%~~
~~Summary -- Total: 4 -- Passed: 3 -- Failed: 1~~

## 2. Parameters that are not explicitly criticized are assigned a
`NoneCritic`.
A NoneCritic has no effect on the evaluation results and does not
actually evaluate. Parameters that have a NoneCritic will be displayed
as ‘un-criticized’ in the evaluation summary (if `-d` flag is used).

![image](https://github.com/user-attachments/assets/300756ec-9b53-436a-9cf9-fc61d0b00c01)


## 3. Add a hardcoded `seed` parameter for evals.
The seed parameter aides in receiving (mostly) consistent outputs -
aiding in reproducibility for evaluations.

## 4. Disallow more than one critic for the same field.
Raises a `ValueError` if more than one critic is assigned to a field.

---------

Co-authored-by: Eric Gustin <eric@arcade-ai.com>
2025-02-05 15:22:08 -08:00
Nate Barbettini
9d49572f09
Update CDN URL to cdn.arcade.dev (#238)
Updates our public CDN URL.
2025-01-30 11:58:41 -08:00
Eric Gustin
a344cc0a8b
Use cross platform paths (#237)
# PR Description
Tiny PR to use `os.path.join` instead of hardcoding paths with forward
slashes.
2025-01-30 09:51:57 -08:00
Eric Gustin
ce2fb0f6c1
Update Examples & Various Renames (#233)
# PR Description
* This PR updates code in `examples/` to be compatible with version
1.0.0
* This PR removes the Spotify examples since the Arcade hosted worker
doesn't currently cataloge the Spotify toolkit. We can reintroduce these
examples when it does.
* This PR performs various renames across the codebase for
`arcade-ai.com` --> `arcade.dev` and `Arcade AI` --> `Arcade`
2025-01-28 17:17:29 -08:00