Commit graph

109 commits

Author SHA1 Message Date
Eric Gustin
feb83c95ca
Pin poetry to 1.8.5 (#193)
# PR Description
Poetry released v2 with many breaking changes a couple days ago. The
`install-poetry` action that our workflows use default to that v2
version, so many of our workflows are failing. This PR forces that
action to use poetry version 1.8.5 and also uses 1.8.5 for toolkits

A ticket to migrate to 2.0.0 has been filed for future work
2025-01-07 13:21:55 -08:00
Nate Barbettini
fd5b429322
Rename inputs -> input to match Engine (#190)
Tool definitions in the Engine were missing `input` because the field
was renamed.

---------

Co-authored-by: Eric Gustin <eric@arcade-ai.com>
2025-01-03 17:42:58 -08:00
Eric Gustin
890ee96ef4
Rename actor to worker (#174)
# PR Description
This PR renames `actor` to `worker` 

**Does not include deployment related things in
`.github/workflows/release-containers.yml`**
2025-01-03 14:28:04 -08:00
Sterling Dreyer
2cc9aba0f4
Fix For New Schemas (#187)
This is a start but may be incomplete

---------

Co-authored-by: Nate Barbettini <nate@arcade-ai.com>
2025-01-03 13:47:23 -08:00
Nate Barbettini
179837f7fb
CLI quality of life improvements (#189)
Small QOL improvements: graceful messages in error situations
2025-01-03 13:47:11 -08:00
Eric Gustin
f7f5888b21
Stricter jinja version (#186)
# PR Description
Jinja2 versions 3.1.5 or higher resolves security vulnerabilities in
this repo.
2025-01-02 14:09:22 -08:00
Eric Gustin
0ad8dc6e5e
Link to Engine installation documentation (#184)
# PR Description:
If someone tries to run `arcade dev` without the Engine installed they
get the following:


![image](https://github.com/user-attachments/assets/bc4063bb-3fb1-471c-a9bc-77f73a660308)
2024-12-24 10:19:58 -08:00
Eric Gustin
ab889f9f1d
Lint all toolkits (#183)
# 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.
2024-12-20 09:49:45 -08:00
Eric Gustin
7c228a59d5
Update Evals SDK (#175)
# 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.
2024-12-19 10:29:13 -08:00
Eric Gustin
a4b58d9749
Fix /show for Cloud Engine (#177)
# 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.
2024-12-19 10:13:58 -08:00
Eric Gustin
b12ceec4b5
arcade evals Default to localhost (#172)
# 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.
2024-12-17 10:41:32 -08:00
Eric Gustin
d8c8b060af
Update arcade chat Help Menu (#170)
# 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
```
2024-12-16 18:32:03 -08:00
Nate Barbettini
0344bc79cb
Bump arcadepy dependency (#168)
`arcadepy` is now at [0.2.1 on
pypi](https://pypi.org/project/arcadepy/0.2.1/).
The SDK references `arcadepy` but it is locked to the `0.1.x` minor
release.
2024-12-03 07:18:18 -08:00
Eric Gustin
8dbbe23d73
Add arcade new Improvements (#156)
# 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)
2024-12-02 17:44:09 -08:00
Sam Partee
bebfcab1e9
Add lookup_tweet_by_id to X Toolkit (#165)
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>
2024-11-27 17:07:12 -08:00
Wils Dawson
cf6a2969bf
Add Atlassian as a supported provider. (#167) 2024-11-27 11:44:03 -08:00
Wils Dawson
a094ed7fc0
Add Dropbox as an auth provider. (#164)
Related to: CU-86b2dtdj2
2024-11-27 11:04:39 -08:00
Wils Dawson
466ea933cd
Support Discord as an Auth provider (#161)
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!
2024-11-22 15:43:44 -08:00
Eric Gustin
82afd7ec70
Update starlette dep via bumping FastAPI (#158)
Patches vulnerability that is due to starlette version < 0.40.0 by
bumping the fastAPI version to 0.115.3

FastAPI 0.115.3 release notes:
https://github.com/fastapi/fastapi/releases/tag/0.115.3
2024-11-19 09:17:28 -08:00
Eric Gustin
f757e01d42
Create README for PyPi (#154)
# 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
2024-11-13 12:37:34 -08:00
Eric Gustin
1da1231e5b
Add readme and description to PyPi Project Page (#153)
# PR Description
Currently the [Arcade AI PyPi Page](https://pypi.org/project/arcade-ai/)
doesn't have a description. This PR adds that.
2024-11-13 11:00:44 -08:00
Eric Gustin
026d518c6e
Add multi-line chat and help menu (#152)
# 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 `"""`.

![image](https://github.com/user-attachments/assets/f190f487-d8d6-4c1d-ab73-29e811528d16)

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!)
  

![image](https://github.com/user-attachments/assets/265b9977-5621-441a-9b80-5f33f5be5681)
2024-11-13 10:32:20 -08:00
Eric Gustin
c02aee3f14
CLI Improvements (#151)
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.
2024-11-06 16:25:45 -08:00
Eric Gustin
311bfaa26f
Minor QOL improvement for arcade chat (#149) 2024-11-06 09:13:21 -08:00
Nate Barbettini
29ccf19e73
fix: arcade dev waits forever if no toolkits are installed (#147)
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.
2024-11-05 13:37:39 -08:00
Nate Barbettini
39d342bd67
fix: Wait for healthy actor in arcade dev (#142)
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.
2024-11-04 09:39:09 -08:00
Eric Gustin
8dbfed5c52
Fix log that stated the number of tools found in toolkit (#144)
The original log was counting the number of files in the toolkit module.
This PR fixes this such that it counts the number of tools in the
toolkit.
2024-11-04 09:27:43 -08:00
Nate Barbettini
1fdf982238
fix: No output from arcade login when already logged in (#143)
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.
2024-11-01 16:49:31 -07:00
Nate Barbettini
aff7350eec
fix: readline error on Windows (#139)
With this change, `pyreadline3` is automatically installed on OS `win32`
only. Linux/Mac doesn't need it.
2024-11-01 13:15:52 -07:00
Nate Barbettini
8b29407d2d
fix: runtime error when OTEL is not enabled (#138)
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.
2024-11-01 12:38:54 -07:00
Nate Barbettini
3699b16b2d
fix: circular import in arcade.core (#137)
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.
2024-11-01 12:38:44 -07:00
Nate Barbettini
75b9ea8e91
Bump arcadepy version (#126)
Use the latest version of `arcadepy` to pull in bug fixes and added
helper methods
2024-10-25 17:04:04 -07:00
Sam Partee
4d2786935a
Langchain arcade (#125)
Co-authored-by: Eric Gustin <eric@arcade-ai.com>
Co-authored-by: Nate Barbettini <nathanaelb@gmail.com>
Co-authored-by: Nate Barbettini <nate@arcade-ai.com>
2024-10-25 16:59:21 -07:00
Nate Barbettini
036ad54ac6
Remove arcade.core from all examples (#121)
This PR ensures that `arcade.core` does not show up anywhere in "user
space". This is crucial for helping developers understand what objects
are safe to use, and helps maintain a good developer experience.

Specific changes:
- `ToolAuthorizationContext` and `ToolContext` are now visible via
`arcade.sdk`
- `ToolCatalog` is now visible via `arcade.sdk`
- `Toolkit` is now visible via `arcade.sdk`
- `config` is now visible via `arcade.sdk.config`
2024-10-24 17:08:04 -07:00
Eric Gustin
c528b2c7dc
Add pyyaml dependency (#123) 2024-10-24 14:33:53 -07:00
Sterling Dreyer
fc26339d29
Modified Default Env Template (#122) 2024-10-24 12:34:13 -07:00
Eric Gustin
8508a28f54
Config Refactor (#116)
# PR Description
1. Removes `arcade config` CLI command and it's helper function.
2. Upon `arcade login`, if the user does not have an `arcade.env` file,
then a templated environment file is created for the user.
3. Removed `EngineConfig` and all references to it. Since there is no
longer an `EngineConfig`, this PR refactors the CLI to compute the
engine URL based on the command-line flags that were provided.
4. Renamed `arcade.toml` to `credentials.yaml`. If a user is using
`arcade.toml`, then we will display a deprecation message and then
automatically migrate their `arcade.toml` to `credentials.yaml`. NOTE:
Eventually this auto-migration support should be removed.
5. `arcade.env` is now an optional file
6. Make `arcade show` default to `https://api.arcade-ai.com/v1` instead
of localhost.
-------




## Ensuring engine url is still computed correctly:
I used the following matrix to ensure that the behavior has not changed
after the refactor. This matrix is tested in `test_utils.py`

DEFAULT_HOST = "api.arcade-ai.com"  
DEFAULT_PORT = None  
DEFAULT_FORCE_TLS = False  
DEFAULT_FORCE_NO_TLS = False  


| Command Line Arguments | Host | Port | Force TLS | Force No TLS |
Main's URL | This PR's URL |

|----------------------------------------|-----------------|---------------|-----------|--------------|-----------------------------------|-----------------------------------|
| | DEFAULT_HOST | DEFAULT_PORT | False | False |
https://api.arcade-ai.com/v1 | https://api.arcade-ai.com/v1 |
| --host localhost | localhost | DEFAULT_PORT | False | False |
http://localhost:9099/v1 | http://localhost:9099/v1 |
| -p 9099 | DEFAULT_HOST | 9099 | False | False |
https://api.arcade-ai.com:9099/v1 | https://api.arcade-ai.com:9099/v1 |
| --host localhost -p 9099 | localhost | 9099 | False | False |
http://localhost:9099/v1 | http://localhost:9099/v1 |
| --tls | DEFAULT_HOST | DEFAULT_PORT | True | False |
https://api.arcade-ai.com/v1 | https://api.arcade-ai.com/v1 |
| --host localhost --tls | localhost | DEFAULT_PORT | True | False |
https://localhost:9099/v1 | https://localhost:9099/v1 |
| -p 9099 --tls | DEFAULT_HOST | 9099 | True | False |
https://api.arcade-ai.com:9099/v1 | https://api.arcade-ai.com:9099/v1 |
| --host localhost -p 9099 --tls | localhost | 9099 | True | False |
https://localhost:9099/v1 | https://localhost:9099/v1 |
| --no-tls | DEFAULT_HOST | DEFAULT_PORT | False | True |
http://api.arcade-ai.com/v1 | http://api.arcade-ai.com/v1 |
| --host localhost --no-tls | localhost | DEFAULT_PORT | False | True |
http://localhost:9099/v1 | http://localhost:9099/v1 |
| -p 9099 --no-tls | DEFAULT_HOST | 9099 | False | True |
http://api.arcade-ai.com:9099/v1 | http://api.arcade-ai.com:9099/v1 |
| --host localhost -p 9099 --no-tls | localhost | 9099 | False | True |
http://localhost:9099/v1 | http://localhost:9099/v1 |
| --tls --no-tls | DEFAULT_HOST | DEFAULT_PORT | True | True |
http://api.arcade-ai.com/v1 | http://api.arcade-ai.com/v1 |
| --host localhost --tls --no-tls | localhost | DEFAULT_PORT | True |
True | http://localhost:9099/v1 | http://localhost:9099/v1 |
| -p 9099 --tls --no-tls | DEFAULT_HOST | 9099 | True | True |
http://api.arcade-ai.com:9099/v1 | http://api.arcade-ai.com:9099/v1 |
| --host localhost -p 9099 --tls --no-tls| localhost | 9099 | True |
True | http://localhost:9099/v1 | http://localhost:9099/v1 |
| --host arandomhost.com | arandomhost.com | DEFAULT_PORT | False |
False | https://arandomhost.com/v1 | https://arandomhost.com/v1 |
2024-10-24 11:34:33 -07:00
Nate Barbettini
10030c6a12
Fix iteration when calling client.tools.list (#120)
**Blocked** until this is merged **and** Stainless clients are re-built:
https://github.com/ArcadeAI/Engine/pull/148
TODO: Update arcadepy version dependency.
2024-10-24 09:39:20 -07:00
Eric Gustin
ce0616a471
Fix issues in arcade show (#117)
# PR Description
1. `arcade show` only supported lowercase args for toolkit and tools.
This PR allows the user to use capitalization and the tool/toolkit will
still be displayed.
2. `arcade show -T` is now for showing a toolkit and `arcade show -t` is
now for showing a tool.
2024-10-23 15:33:19 -07:00
Sterling Dreyer
80b7d968ff
Search for etc paths (#118)
Depends on: https://github.com/ArcadeAI/arcade-ai/pull/116
2024-10-23 15:31:37 -07:00
Nate Barbettini
9d00295e33
Replace arcade.client with arcadepy (#119)
Closes: https://app.clickup.com/t/86b2k2962

---------

Co-authored-by: sdreyer <sterling@arcade-ai.com>
2024-10-23 15:29:02 -07:00
Nate Barbettini
1c6e3f4495
arcade chat: Auto open browser for auth links (#112)
Fixes two points of feedback:
- In terminals that don't support links, we need to print the whole URL
as a backup
- Just open the browser dammit! -- Wils

### Demo


https://github.com/user-attachments/assets/91ced5ef-43d3-45a4-8af7-beb1a7bcde8d
2024-10-17 15:18:26 -07:00
Sam Partee
8a1114ab62
Fix arcade-ai versions in arcade new cmd` (#111)
fix for version:
Dynamic Version Retrieval: Replaces the hardcoded version import with
dynamic retrieval using importlib.metadata.version. This ensures that
__version__ in __init__.py accurately reflects the installed version of
arcade-ai.

fix to ``arcade-new``: Changes the default dependency specification for
arcade-ai from ^{VERSION} to ~{VERSION} in DEFAULT_VERSIONS in
``new.py``. This adjustment allows for patch version updates while
maintaining compatibility, enhancing stability.

---------

Co-authored-by: Eric Gustin <eric@arcade-ai.com>
2024-10-17 13:51:16 -07:00
Nate Barbettini
c81da86460
Fix nits in CLI (#108)
Fixes:
- [Opening browser doesn't work in
ssh](https://app.clickup.com/t/86b2h46f7)
- ["bright black" color text in `arcade chat -d` is invisible in
iTerm](https://app.clickup.com/t/86b2h494v)
- [Colors and styles are inconsistent in non-zsh
shells](https://app.clickup.com/t/86b2h49kb)
2024-10-15 18:13:44 -07:00
Sterling Dreyer
b95e26e5ec
Fix missing type packages (#107) 2024-10-14 20:38:27 -07:00
Eric Gustin
74a47f1062
Improve arcade new (#104)
# PR Description
This PR improves the CLI command `arcade new` in multiple ways.
1. When prompting the developer if they want to create a test/evals
folder, the default was printed twice. This is now fixed.
2. Whether to generate a test/eval directory, the user must enter "yes".
This PR relaxes this to accept other variations.
3. Creates an eval suite instead of an empty folder.
4. Prevents a developer from overwriting an existing toolkit.
2024-10-11 16:22:10 -07:00
Sam Partee
ff092ac303
Remove client.chat resource (#105)
This was always temporary, but we are finally removing the chat resource
from the ``Arcade`` and ``AsyncArcade`` clients.
2024-10-10 18:03:30 -07:00
Sam Partee
6b716d6dde
Add `GET /v1/tools/list` (#100)
Add retrieving the list of available tool definitions
that can be called. 

essential to working with frameworks like langchain/graph
2024-10-09 21:02:23 -07:00
Sam Partee
63cabe8f1f
Google Toolkit (Drive, Docs) (#97)
**New Tools Added**
- `docs.py`: Provides tools for Google Docs functionalities, including
creating documents and inserting text.
- `drive.py`: Introduces tools for Google Drive operations, such as
listing documents.

This PR also focuses on simplifying the error handling logic in the Google
toolkit, specifically within the Calendar and Gmail tools. The primary
change involves removing redundant `try-except` blocks that were
catching `HttpError` and general exceptions, and re-raising them as
`ToolExecutionError`. By removing these blocks, we allow exceptions to
propagate naturally, and be handled by the ``ToolExecutor``

---------

Co-authored-by: Eric Gustin <eric@arcade-ai.com>
2024-10-08 17:04:16 -07:00
Sam Partee
68a4caff98
CLI Engine Env passing and Tool Executor cleanup (#95)
This PR introduces the following changes:

- **Engine Environment Configuration**: Adds support for specifying an
environment variables file for the engine via the `arcade dev` CLI
command.
- **Configuration File Handling**: Refactors configuration file handling
in the CLI launcher to generalize logic for locating configuration
files.
- **Tool Execution Logging**: Enhances logging in `BaseActor` to include
execution duration and adjusts logging levels for better visibility.
- **Enhanced Tool Exception Handling**: Improves exception handling in
`ToolExecutor` and updates the `@tool` decorator to ensure proper
propagation and handling of exceptions raised during tool execution.
2024-10-07 17:49:34 -07:00