# PR Description
* Adds/updates the following files to all toolkits:
- `.pre-commit-config.yaml`
- `.ruff.toml`
- `LICENSE`
- `Makefile`
- `pyproject.toml`
* Lint all toolkits such that they pass `make check` and `make test` (a
total doozy). This includes adding some unit tests and evals.
* Github workflow for testing toolkits before merge into main (courtesy
of @sdreyer)
* Added a QOL improvement for tool developers for when they need to get
the context's auth token.
* Minor updates to `arcade new` template.
# PR Description
This PR renames `ExpectedToolCall` to `NamedExpectedToolCall` and then
creates a new dataclass called `ExpectedToolCall`. `ExpectedToolCall`
can be passed to the `EvalSuite.add_case` and `EvalSuite.extend_case`
methods.
1. Enhance `EvalSuite.add_case` and `EvalSuite.extend_case` by accepting
a list of `ExpectedToolCall` as their `expected_tool_calls` input
parameter. This helps create a scaffolding for developers. Previously,
the expected type was `list[tuple[Callable, dict[str, Any]]]`, which is
still valid for backward compatibility.
```python
# Before (still valid for backward compatibility)
expected_tool_calls=[
(
adjust_playback_position,
{
"absolute_position_ms": 10000,
},
)
]
# After
expected_tool_calls=[
ExpectedToolCall(
func=adjust_playback_position,
args={"absolute_position_ms": 10000},
)
]
```
2. Removed any references to arcade.core in toolkits directory.
3. Some linting for import organization.
# PR Description
### The following bug was observed:
* When connected to the cloud engine for `arcade chat`, and the user
types `/show`, then the local environment tools are displayed. Instead,
the cloud engine's tools should be displayed.
### Why was this bug happening?:
* When a user entered the `/show` command, the CLI Command `show` was
being called directly. Since the function was a CLI command, the `local`
parameter was not being processed and resolved to its intended value
because the Typer CLI interface was being bypassed. So, the conditional
`if local:` would always evaluate to `True`.
### How this was fixed:
* I created a wrapper function for the `show` CLI Command. Now, when the
user types `/show`, then the wrapper function is called instead of the
`show` CLI command. This ensures that all input parameters are resolved
to their intended values.
# PR Description
* `arcade evals` now run evaluations against Arcade Engine at
`http://localhost:9099` by default.
* Added optional flag `--cloud` to run evaluations against Arcade's
Cloud Engine at `https://api.arcade-ai.com`. Overrides `-h` flag.
* Always print the Engine that the evaluations are using. Previously
this was reserved for `-d` flag.
# PR Description
* Fixes available commands display bug
* Add `/history` command. Displays the conversation history.
```
Available Commands:
/show Show all available tools
/history Show the chat history
/clear Clear the chat history
/exit Exit the chat
/?, /help Help for a command
Surround in """ for multi-line messages
```
# PR Description
* Update `search_recent_tweets_by_username`,
`search_recent_tweets_by_keywords`, and `lookup_tweet_by_id` to support
long tweets. Previously, only the first 280 characters of the tweet's
text were returned by the tool.
# PR Description
Adds an optional `next_token` input parameter to the
`X.SearchRecentTweetsByUsername` and `X.SearchRecentTweetsByKeywords`
tools.
This allows users to paginate through tweets. A `next_token` is provided
in the tools's response.
For example, to access the `next_token` when using the `tools.execute`,
you can do `next_token = response.output.value["meta"].get("next_token",
None)` and then pass it to the tool on your next call through the tools'
`next_token` input parameter.
# PR Description
This PR is a part of the community contributed toolkits story.
* `arcade new` now uses jinja templates
* `arcade new` now creates a "cookiecutter" toolkit equipped with
everything a community contributed toolkit needs to be easily tested,
published to PyPi, etc. as its own Github repo
* I created the following toolkit with `arcade new`:
- [PyPi](https://pypi.org/project/arcade-local-file-management/0.1.5/)
-
[Github](https://github.com/EricGustin/local_file_management/tree/0.1.5)
This PR introduces the `lookup_tweet_by_id` tool to the X toolkit,
enabling users to retrieve tweet details by tweet ID. This enhancement
extends the toolkit's capabilities, allowing for more comprehensive
interactions with the X (Twitter) API.
**Key Changes:**
- **Added `lookup_tweet_by_id` Tool:**
- Implemented the `lookup_tweet_by_id` function in `tools/tweets.py`,
which allows users to fetch tweet information using a tweet ID.
- Included error handling for API response codes and expanded URLs in
tweets to assist language models in avoiding hallucinations due to
shortened URLs.
- **Enhanced Toolkit Structure:**
- Added several configuration files to the X toolkit to establish a
standardized project structure, which in the future will be generated by
`arcade new`. These include:
- `.pre-commit-config.yaml`: Defines pre-commit hooks for code quality
checks.
- `.ruff.toml`: Configuration for the Ruff linter.
- `LICENSE`: MIT License file for the toolkit.
- `Makefile`: Contains common commands for building, testing, and
linting the toolkit.
- **Updated Makefile:**
- Added `make check-toolkits` command to the top-level `Makefile`. This
command runs code quality tools for each toolkit that contains a
`Makefile`.
**Additional Notes:**
- **Tests:**
- Added unit tests for the new `lookup_tweet_by_id` tool in
`tests/test_tweets.py`.
- Included tests for the user lookup functionality in
`tests/test_users.py`.
- **Linting and Code Quality:**
- Configured pre-commit hooks and Ruff linter to enforce code standards.
- Updated the `pyproject.toml` file with development dependencies for
testing and linting.
-
---------
Co-authored-by: Eric Gustin <eric@arcade-ai.com>
This supports Discord as an auth provider. It depends on the next
release of the Arcade Engine to work, so ~we'll hold off on merging for
now.~ we'll do it live!
# PR Description
1. This PR adds three new tools:
- GetThread (by ID)
- ListThreads
- SearchThreads
2. This PR updates the return type for various Gmail tools from str to
dict.
3. This PR adds evals and tests for the added tools
# PR Description
This PR creates a new toolkit called CodeSandbox. This toolkit has two
tools:
1. `RunCode`: Creates an E2B sandbox and runs the provided code in that
sandbox. Returns the execution logs, result, and errors. Supports
Python, JavaScript, R, Java, and Bash code.
2. `CreateStaticMatplotlibChart`: Creates a sandbox, runs the provided
python code that uses matplotlib, and returns the base64 encoded image
of the chart along with any logs or errors.
- I recommend not using `tool_choice="generate"` since the return object
contains a base64 image can be a lot of tokens that will not provide
much value to a generate's response.
Example of creating a pie chart:
```python
import base64
import json
import os
from openai import OpenAI
def call_tool_with_openai(client: OpenAI) -> dict:
response = client.chat.completions.create(
messages=[
{
"role": "user",
"content": "There are 17 red apples, 4 green apples, and 10 yellow apples. Create a pie chart for this data.",
},
],
model="gpt-4o-mini",
user="you@example.com",
tools=["CodeSandbox.CreateStaticMatplotlibChart"],
tool_choice="execute",
)
return response
arcade_api_key = os.environ.get("ARCADE_API_KEY")
cloud_host = "http://localhost:9099/v1"
openai_client = OpenAI(
api_key=arcade_api_key,
base_url=cloud_host,
)
chat_result = call_tool_with_openai(openai_client)
tool_call_id = chat_result.choices[0].message.tool_calls[0].id
content = json.loads(chat_result.choices[0].message.content)
base64_image = content[tool_call_id]["value"]["base64_image"]
image_data = base64.b64decode(base64_image)
with open("output_image.png", "wb") as image_file:
image_file.write(image_data)
```
# PR Description
The `arcade/pyproject.toml` wasn't able to find the `README.md` file
because it must be a subpath of `arcade-ai/arcade`. I created a simple
README for PyPi
# PR Description
Given that `arcade chat` is the entry point for all users, this PR makes
the developer's first experience with Arcade a better experience.
1. Add multi-line & pasting support to `arcade chat`. To start a
multi-line chat message, start your message with `"""`. To end the
multi-line chat message, end your line with `"""`.

2. Added chat commands
- `/?` displays all available chat commands that are available
- `/show` shows all of the tools available. This uses `arcade show`.
Currently no option to specify the toolkit, or tool.
- `/clear` clears the chat conversation history of the current session
- `/exit` exits the chat. (ctrl+c still works of course!)

1. Fixes bug where arcade login doesn't work for localhost
- `arcade login -h localhost` will open login page at
`http://localhost:8000/...`
- Optionally specify the port: `arcade login -h localhost -p 8000`
3. Adds `local` flag to `arcade show`
- `-h localhost`, `-h 127.0.0.1`, and `-h 0.0.0.0` shows the tools that
are in the local engine's catalog
- `--local` show the tools that are in the local environment.
## PR Description
This PR adds 7 examples.
* `call_a_tool_directly_with_auth.py` - Simple example that uses Arcade
client to execute a tool that lists Gmail emails
* `call_a_tool_directly.py` - Simple example that uses Arcade client to
execute a tool that adds two numbers together
* `call_a_tool_with_llm.py` - Simple example that uses the LLM api to
star the arcade-ai repository
* `get_auth_token.py` - Simple example that gets a Google auth token and
then calls the Google API
* `call_multiple_tools_directly_with_auth.py` - A more involved example
that directly calls multiple spotify tools sequentially
* `call_multiple_tools_with_llm.py` - A more involved example that uses
an llm to call multiple spotify tools sequentially
* `simple_chatbot.py` - Simple chatbot that uses arcade tools and has
history
---------
Co-authored-by: Nate Barbettini <nathanaelb@gmail.com>
Fixes an edge case where the actor doesn't start because no toolkits are
installed in the local environment, but `arcade dev` keeps waiting for a
healthy actor.
# PR Description
Previously, if a tool adjusted the playback state, then the tool would
return the current playback state after the modification had occurred.
The problem with this approach was that Spotify would not update the
playback state in time (sometimes), so the tools were returning stale
data!
Context: Currently, `arcade dev` starts the actor process and then waits
a hardcoded amount of time (2sec) for the actor to start up. This isn't
enough time on some slower machines, which leads to the engine trying to
start but failing.
Fix: Wait until the actor is healthy according to its own
`/actor/health` endpoint.
I ran into this and was scratching my head why `arcade login` was
exiting with no output.
Fix: Get config data from the new top-level object we introduced.
# PR Description
This PR adds three new spotify tools that are natural language friendly.
1. `search` - Search Spotify Catalog information
2. `play_artist_by_name` - Gets 5 songs by the specified artist and
plays them. Uses `search`, and `start_tracks_playback_by_id` under the
hood
3. `play_track_by_name` - Plays the specified song, optionally provide
the artist name who plays the song. Uses `search`, and
`start_tracks_playback_by_id` under the hood
Symptom: If an `otel_meter` wasnot passed when constructing the actor
(which is allowed, it's an optional param), the actor would later crash
at runtime.
Fix: Always set `tool_counter` to a default value.
Fixes a circular import issue where `arcade.sdk -> arcade.core` but also
`arcade.core -> arcade.sdk`. My mistake!
Moved some of the shared classes down into `core`, and re-exported them
to `sdk` to keep the expected interface for devs.
# PR Description
1. `adjust_playback_position` - Adjust the playback position within the
currently playing track
2. `skip_to_previous_track` - Skip to the previous track in the user's
queue, if any
3. `skip_to_next_track` - Skip to the next track in the user's queue, if
any
4. `pause_playback` - Pause the currently playing track, if any
5. `resume_playback` - Resume the currently playing track, if any
6. `start_tracks_playback_by_id` - Start playback of a list of tracks
(songs)
7. `get_playback_state` - Get information about the user's current
playback state, including track or episode, and active device
8. `get_currently_playing` - Get information about the user's currently
playing track
9. `get_track_from_id` - Get information about a track
10. `get_recommendations` - Get track (song) recommendations based on
seed artists, genres, and tracks, and multiple target audio stats
11. `get_tracks_audio_features` - Get audio features for a list of
tracks (songs)
----------------------
My favorite feature of this toolkit is
1. Start playing my favorite song
2. Get the song that I'm currently playing
3. Get audio features of that song
4. Ask for recommended songs that are similar to it
5. Jam out
------------