Commit graph

273 commits

Author SHA1 Message Date
Sam Partee
8bfd6755ee
Update README.md (#298)
Minor spelling and changes to README.
2025-03-16 15:11:34 -07:00
Sam Partee
88b1a3d9c2
Shorten README (#297) 2025-03-16 14:49:42 -07:00
Eric Gustin
b7d5736995
Replace changed-files GH Action (#295) 2025-03-15 15:15:01 -07:00
Sterling Dreyer
54fb135a3c
Allow workerup to run without login (#296) 2025-03-15 14:47:43 -07:00
Eric Gustin
7428397318
Notion Toolkit (#283) 2025-03-15 11:08:10 -08:00
Eric Gustin
99ff11d30e
Various Search Toolkits (#285)
1. Add the following tools:
* Google Finance
    - get_stock_summary
    - get_stock_historical_data
* Google Flights
    - search_roundtrip_flights
    - search_one_way_flights
* Google Hotels
    - search_hotels
    
2. Add some common helper functions for serpAPI tools.
2025-03-14 14:23:14 -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
Mateo Torres
f04087b389
Math tools expanded (#293)
Migrated all interfaces to get and return strings.

Added tests and evals for all functions (except the random generation)
Math functions are now organized into different math categories

---------

Co-authored-by: Nate Barbettini <nate@arcade-ai.com>
2025-03-14 09:47:04 -03: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
Eric Gustin
b296594863
Fix examples (#289)
Somehow these have slipped through the cracks. It hasn't been
`authorization_url` for some time.
2025-03-12 16:46:14 -07:00
Eric Gustin
2fe907e5dd
Release Google Toolkit version 1.0.0 (#280)
Updates to the Google Toolkit:
https://github.com/ArcadeAI/arcade-ai/pull/264 (google patch)
https://github.com/ArcadeAI/arcade-ai/pull/188 (google minor)
https://github.com/ArcadeAI/arcade-ai/pull/272 (google major)
https://github.com/ArcadeAI/arcade-ai/pull/269 (google minor)
https://github.com/ArcadeAI/arcade-ai/pull/265 (google major)
2025-03-12 14:25:50 -07:00
Sam Partee
9da87b1f22
Whitespace fix (#286) 2025-03-11 06:33:58 -07:00
Sam Partee
0cf0a7beeb
Update README.md 2025-03-11 04:23:15 -07:00
Sam Partee
bc2c4919fe
Update README.md (#284) 2025-03-10 20:23:15 -07:00
Sam Partee
28ea4d8933
Update README (#281) 2025-03-10 20:15:45 -07:00
Sam Partee
140f4eca17
Langchain arcade 1.2 (#282)
- **New Class Structure**: Introduced `ToolManager` and
`AsyncToolManager` classes (`ArcadeToolManager` is deprecated)
- **Async Support**: Full async implementation for modern LangChain
applications
- **Better Tool Management**: New methods for adding individual tools
and toolkits
- **CI/CD**: for langchain_arcade


## Upgrade Changes

```python
# Old pattern
manager = ArcadeToolManager(api_key="...")
tools = manager.get_tools(toolkits=["Google"])

# New pattern
manager = ToolManager(api_key="...")
manager.init_tools(toolkits=["Google"])
tools = manager.to_langchain()
```

Now supports underscores vs dots in tool names for better model
compatibility.
2025-03-10 18:52:06 -07:00
Sterling Dreyer
4164f796b0
Fix package install for modal example (#267)
Co-authored-by: Eric Gustin <eric@arcade.dev>
2025-03-07 19:08:49 -08: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
Renato Byrro
ac0f5aa10c
Search Google Drive documents and retrieve contents (#265)
This tool will be useful in scenarios akin to RAG, where someone wants
to ask questions or request the production of a summary, for instance,
about a bunch of documents related to a particular topic. Currently, to
fulfill such requests, the LLM needs to first `list_documents`, then
`get_document_by_id` for each document.

We also implement a utility functions to return documents in Markdown
and HTML, since the Drive API JSON is verbose and would waste too many
tokens unnecessarily.

Limitations: the Markdown/HTML utilities do not handle table of contents
(which I think aren't really useful here), headers, footers, or
footnotes.

---
This PR deprecates `list_documents` and implements `search_documents`,
apart from `search_and_retrieve_documents`). This configuration makes it
easier for LLMs to understand when to call each tool.

Both tools had their interfaces refactored to remove Google API-specific
arguments that were confusing LLMs sometimes, such as "corpora" and
"support_all_drives". It now accepts arguments that better relate to
expected user requests.

---------

Co-authored-by: Eric Gustin <eric@arcade.dev>
2025-03-07 18:42:12 -03:00
Renato Byrro
2135101acd
Tool to retrieve file tree structure from Google 'My Drive' and 'Shared Drives' (#269) 2025-03-07 18:02:09 -03: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
e9ee3bba40
fix: Use tool secrets in toolkits (#271)
~~Note: Don't merge until the correct secrets have been added to Arcade
Cloud.~~

Ready to merge, the feature is already on its way to prod.

---------

Co-authored-by: Eric Gustin <eric@arcade.dev>
2025-03-04 13:35:36 -08:00
Renato Byrro
75da4bf8b0
Make search_contacts interface more LLM-friendly (#272)
Break down `search_contacts` into `search_contacts_by_name` and
`search_contacts_by_email`. The search_contacts' `query` argument was
not clear enough for LLMs.
2025-02-28 16:47:03 -03: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
Alex Salazar
7b1110f2b7
Alex gmail improvements (#188)
Improved gmail toolkit. Added support for threading in draft replies,
multipart email parsing, and label management. Fixed the DateRange
parameter issue in list_emails_by_headers. Added logging and removed
print statements. Created custom exceptions for each specific google
toolkit.

-----
Summary of changes by @byrro:

- Fixed minor bug related to the `date_range` argument of
`list_emails_by_header`
- A few utility functions (`build_email_message`,
`build_reply_recipients`, `build_reply_body`) to centralize logic and
remove repeated code from email-sending tools
- New `reply_to_email` tool (apart from `write_draft_reply_email`,
implemented by Alex) to keep the toolkit consistent
- Evals and unit tests
- Handling of reply-to (only sender) and reply-to-all recipients
- Removed some unnecessary debug messages, which Alex had added to
replace print statements
- Removed HTML handling implemented by Alex in `write_draft_reply_email`
> I think we should either support HTML across all applicable tools or
not at all; I decided to remove it and leave this feature for a future
PR.

---------

Co-authored-by: Renato Byrro <rmbyrro@gmail.com>
2025-02-27 11:56:32 -03:00
Sam Partee
f997ca9449
Langchain-arcade README update (#268) 2025-02-26 00:08:06 -08:00
Eric Gustin
ad66667bdb
Update CrewAI example: Custom Auth Flow (#260) 2025-02-21 16:25:43 -08:00
Nate Barbettini
62173da343
Update scope on Google.ListDocuments (#264)
Updating the scope on this unreleased tool to be more granular.
2025-02-20 21:36:46 -08:00
Nate Barbettini
668e92934e
fix: Rename actor->worker in gh workflow dispatch (#263)
Fixes a typo (will be relevant later with future CI changes).
2025-02-20 14:15:30 -08:00
Eric Gustin
eeb47dbec5
[Toolkit Release] Weekly Toolkit Release 02-20-25 (#261)
# Weekly Toolkit Release 02-20-25
Previous Toolkit Release: #248 

## Google Toolkit Minor Release
https://github.com/ArcadeAI/arcade-ai/pull/249
#259 

## Slack Toolkit Minor Release
#254 

## X Toolkit Patch Release
#256
2025-02-20 13:27:35 -08:00
Eric Gustin
936319ccba
Fix langchain-arcade SyncOffsetPage iteration (#262)
## PR Description
The `ArcadeToolManager` was retrieving tools from the Arcade client
incorrectly as it was only returning the first page of results.

This PR removes the use of `SyncOffsetPage`'s `.items` attribute since
`.items` only contains the tools in the **current page**. Since
`SyncOffsetPage` implements an `__iter__` that iterates over all pages,
we can simply drop the `.items`.

## Try it for yourself
Run the following code without the changes in this PR and notice that
only 25 tools are in the internal tool list, which also happens to be
the size of a page. Now run again, but with the changes in this PR and
notice that all tools hosted by Arcade are in the internal tool list.
```python
import os

from langchain_arcade import ArcadeToolManager

arcade_api_key = os.environ.get("ARCADE_API_KEY")
manager = ArcadeToolManager(api_key=arcade_api_key)

tools = manager.init_tools()
print(len(manager.tools))
```
2025-02-20 13:24:03 -08:00
Nate Barbettini
274e63c9e5
Polish up Google.SearchContacts and CreateContact (#259)
Adding the missing polish (evals, tests) for #249
2025-02-20 08:53:12 -08:00
Eric Gustin
1e0def78df
CrewAI Arcade (#253)
# CrewAI Integration
crewai-arcade enables you to add Arcade tools and Arcade Auth into your
CrewAI applications. Just create an `ArcadeToolManager` and add your
tools to your CrewAI Agent/Tasks.

## Initializing the ArcadeToolManager
There are two main ways to initialize your `ArcadeToolManager`
1. Default handling of tool authorization and execution:
    ```py
    """
    When you provide a user id to the ArcadeToolManger, 
    it will handle the tool authorization and tool execution for you
    """
manager = ArcadeToolManager(default_user_id="me@example.com,
api_key="...")
    ```
2. Custom handling of tool authorization and execution
    ```py
    """
    Provide a callback function to the `ArcadeToolManager` that handles 
tool authorization and tool execution. The callback function will be
called whenever your CrewAI
    application wants to call a tool.
    """
    
    
    def custom_tool_executor(
manager: ArcadeToolManager, tool_name: str, **tool_input: dict[str, Any]
    ) -> Any:
        """Custom tool executor for the ArcadeToolManager
    
ArcadeToolManager's default executor handles authorization and tool
execution.
This function overrides the default executor to handle authorization and
tool execution
        in a custom way.
        """
        # Your custom tool auth logic goes here
        # Your custom tool execution logic goes here
        ...
    
manager = ArcadeToolManager(executor=custom_tool_executor,
api_key="...")
    ```

## Tool Registration
1. Initialize the tools in the manager
    ```py
    """
Clears any existing tools in the manager and replaces them with tools
and toolkits that are provided.
    """
    manager.init_tools(tools=["Google.ListEmails"], toolkits=["Slack"])
    ```
2. Add tools to the manager
    ```py
    """
    Adds tools and toolkits to the manager's internal tool list.
    """
    manager.add_tools(tools=["Google.ListEmails"], toolkits=["Slack"])
    ```
3. Retrieve tools and toolkits from the manager
    ```py
    """
    Retrieves the provided tools and toolkits as CrewAI StructuredTools.
    """
    manager.get_tools(tools=["Google.ListEmails"], toolkits=["Slack"])
    ```
    
 ## Auth Helpers
The `ArcadeToolManager` provides multiple helper methods for when you
need to create
a custom auth flow.
1. `authorize_tool` handles the whole authorization flow for you. This
is used internally when a custom auth flow is not needed.
2. `requires_auth(tool_name)` checks if the provided tool has
authorization requirements.
3. `authorize(tool_name, user_id)` authorizes the use of the provided
tool for the provided user ID
4. `is_authorized(tool_name, user_id)` checks if a tool is authorized
for use by the provided user ID
5. `wait_for_auth(auth_response)` waits for an authorization process to
complete before returning

## Tool Execution Helpers
1. `execute_tool` handles the whole tool execution flow for you. This is
used internally when a custom tool execution flow is not needed.

---------

Co-authored-by: lgesuellip <lgesuellipinto@uade.edu.ar>
Co-authored-by: lpetralli <123559656+lpetralli@users.noreply.github.com>
Co-authored-by: lgesuellip <102637283+lgesuellip@users.noreply.github.com>
Co-authored-by: “lgesuellip” <“lgesuellipinto@uade.edu.ar”>
2025-02-19 15:02:42 -08:00
Renato Byrro
8efa9a51df
Slack tools to retrieve messages & metadata from multi-person DM conversation (#254) 2025-02-19 16:51:45 -03:00
Nate Barbettini
becd86da0c
Google toolkit: Search and create contacts POC (#249)
This is an initial sketch of what Contacts (People) API tools could look
like. But I haven't yet thought like an MX Engineer @byrro 😉
2025-02-18 17:27:33 -08:00
Eric Gustin
3f655f7dca
Update README (#257)
Fixes some broken links in the Readme file
2025-02-18 13:53:34 -08:00
Eric Gustin
7d45a99722
X Toolkit: Handle no tweets returned in search (#256)
## PR Description
Search ([see API docs
here](https://docs.x.com/x-api/posts/recent-search)) returns a 'data'
field that maps to a list of tweets returned. We've observed that the
'data' field is not present if no tweets match the search. This PR
handles that case safely.
2025-02-18 13:28:33 -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
Sterling Dreyer
f31cabdf2b
Give release permissions (#245) 2025-02-10 16:07:25 -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