Commit graph

91 commits

Author SHA1 Message Date
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
Eric Gustin
7f13eb5efb
Fix arcade chat Auth Polling (#96)
# PR Description
When a tool call required authorization, `arcade chat` would hit rate
limits extremely quickly when waiting to authorize with a given link.
This PR introduces using long polling when sending a GET request to
Arcade API `/auth/status`. The `/auth/status` endpoint supports the
`wait` query parameter, where if present, will not respond until either
auth status becomes `completed` or `timeout` is reached. If the
`timeout` is reached, `arcade chat` catches the 408 response and tries
again. For `arcade chat` we set the `wait` query param to 60 seconds.
2024-10-07 17:24:05 -07:00
Sterling Dreyer
990c6243ca
Enable Otel On Actor (#93) 2024-10-05 13:40:02 -07:00
Nate Barbettini
56fc83bf3e
Fix Github.CountStargazers and add tests (#92)
## Problem
I found a bug with `Github.CountStargazers` where a stargazer count of
`0` was interpreted as a null result. In other words, 0 wasn't passed
back to the Engine correctly.
Separately, the tool function was also not authorized correctly.

## Fix
- Don't use a falsy comparison when evaluating `result` inside the
`ToolOutputFactory`
- Add unit tests for `ToolOutputFactory` to give us confidence in the
business logic
- Added `ToolContext` to pass in the authorization token correctly.

Before
```
User (nate@arcade-ai.com): 
how many stars does the ArcadeAI/Docs repo have on github?

Assistant (gpt-4o): 
I successfully checked the repository, but unfortunately, I cannot provide the number of stars for the ArcadeAI/Docs repository. Please try checking directly on GitHub for the most accurate information.                                                                                        
Called tool 'Github_CountStargazers'
Parameters:{"owner":"ArcadeAI","name":"Docs"}
'Github_CountStargazers' tool returned:Github.CountStargazers called successfully
```

After
```
User (nate@arcade-ai.com): 
how many stars does the ArcadeAI/Docs repo have on github?

Assistant (gpt-4o): 
The ArcadeAI/Docs repository on GitHub has 0 stars.                                                                                                                                                                 
Called tool 'Github_CountStargazers'
Parameters:{"owner":"ArcadeAI","name":"Docs"}
'Github_CountStargazers' tool returned:0
2024-10-04 16:09:08 -07:00
Sam Partee
b52f6daa6f
Eval Framework Improvements (#86)
This PR introduces enhancements and fixes to the Evaluation Framework to
improve accuracy, robustness, and performance.

## Key Improvements

- **Refactored Evaluation Loading**: Extracted evaluation file loading
and suite loading logic into utility functions `get_eval_files` and
`load_eval_suites` in `arcade/cli/utils.py`.
  - **Benefit**: Enhances code modularity and maintainability.

- **Asynchronous Execution of Evaluations**: Modified the evaluations to
run asynchronously using `asyncio`.
- **Benefit**: Significantly reduces total execution time when running
multiple evaluations.

- **Improved Error Handling**: Wrapped critic evaluations in try-except
blocks to handle exceptions gracefully.
- **Benefit**: Ensures that a single failing critic doesn't halt the
entire evaluation process.

## Other Changes

- **Case-Insensitive Tool Name Comparison**: Made tool name comparisons
case-insensitive to improve robustness against casing differences.

- **Refactored Cost Matrix Creation**: Revised cost matrix creation to
handle varying numbers of expected and actual tool calls properly,
ensuring accurate assignment and scoring.

- **Type Casting in `BinaryCritic`**: Added type casting for actual
values to match the expected value's type before comparison, improving
accuracy in evaluations.

- **Removed Synchronous Code Paths**: Simplified the codebase by
removing synchronous evaluation methods, focusing on asynchronous
execution.

- **General Code Cleanup**: Removed unused imports and performed general
code cleanup to enhance readability and maintainability.


## Example

For the google calendar and gmail tools eval set you can run

```go
> arcade evals . -c 8 --models gpt-4o,gpt-4o-mini,gpt-4,gpt-4-turbo

Running evaluations in calendar_eval_suite
Running evaluations in gmail_eval_suite
Model: gpt-4o
PASSED Create calendar event -- Score: 1.00
FAILED List calendar events -- Score: 0.86
PASSED Update a calendar event -- Score: 1.00
PASSED Delete a calendar event -- Score: 1.00
Model: gpt-4o-mini
FAILED Create calendar event -- Score: 0.84
FAILED List calendar events -- Score: 0.86
PASSED Update a calendar event -- Score: 1.00
PASSED Delete a calendar event -- Score: 1.00
Model: gpt-4
PASSED Create calendar event -- Score: 1.00
FAILED List calendar events -- Score: 0.86
PASSED Update a calendar event -- Score: 1.00
PASSED Delete a calendar event -- Score: 1.00
Model: gpt-4-turbo
PASSED Create calendar event -- Score: 1.00
FAILED List calendar events -- Score: 0.87
PASSED Update a calendar event -- Score: 1.00
PASSED Delete a calendar event -- Score: 1.00
Model: gpt-4o
PASSED Send email to user with clear username -- Score: 1.00
Model: gpt-4o-mini
PASSED Send email to user with clear username -- Score: 1.00
Model: gpt-4
PASSED Send email to user with clear username -- Score: 1.00
Model: gpt-4-turbo
PASSED Send email to user with clear username -- Score: 1.00
Summary -- Total: 20 -- Passed: 15 -- Failed: 5
```
2024-10-04 12:09:58 -07:00
Sam Partee
f3feb85239
Fix small bugs in pyproject.tomls (#88)
```
authors = ["Arcade AI <dev@arcade-ai.com>"]
```
vs
```
authors = ["Arcade AI <dev@arcade-ai.com"]
```

There is also now a ``make`` command for ``make install-toolkits``
2024-10-04 12:08:03 -07:00
Sterling Dreyer
2625be80bd
Resend Chat request with authentication (#87)
Currently with arcade chat, when we send a request that requires tool
authentication, it sends the message then, waits for authentication,
then resends the current chat history. However we resend the
authntication link as the latest message instead of resending the
message that prompted the authentication link.

OpenAI ignores this and continues, however Anthropic errors because it
sees the history as

-User message {Get me sams last 5 tweets}
-Assistant message {Please go to this URL and authorize the action: }

instead of 
-User message {Get me sams last 5 tweets}
-Assistant message {Please go to this URL and authorize the action: }
-User message {Get me sams last 5 tweets}

Having an assistant message as the latest message in a request is
invalid for anthropic
2024-10-04 11:00:53 -07:00
Nate Barbettini
799d376ae5
SDK: Generic OAuth 2.0 connector (#81)
- Implements https://app.clickup.com/t/86b1whxb3 on the SDK side
- - Corresponding Engine PR:
https://github.com/ArcadeAI/Engine/pull/113/files?w=1
- Updates existing toolkits with new syntax.
2024-10-03 16:40:02 -07:00
Eric Gustin
7e352fbe91
Add Github Toolkit (#75)
### Adds the following tools to the Github Toolkit:

    1.	CreateIssueComment
	2.	SetStarred
	3.	CountStargazers
	4.	ListOrgRepositories
	5.	GetRepository
	6.	ListRepositoryActivities
	7.	ListReviewCommentsInARepository
	8.	ListPullRequests
	9.	GetPullRequest
	10.	UpdatePullRequest
	11.	ListPullRequestCommits
	12.	CreateReplyForReviewComment
	13.	ListReviewCommentsOnPullRequest
	14.	CreateReviewComment



Adds evals for all of these tools and unit tests.

---------

Co-authored-by: Sam Partee <sam@arcade-ai.com>
2024-10-02 10:40:17 -07:00
Eric Gustin
bf53439b55
Add Google Calendar Tools (#71)
This PR adds four new tools to the Google ToolKit
* `create_event`
* `list_events`
* `update_event`
* `delete_event`


I also improved an error log when tools are being registered by the
actor.


This PR also sneaks in an eval for gmail


Here is a sample conversation that shows the tools and their
capabilities and limitiations:

![image](https://github.com/user-attachments/assets/a70e97d7-2c4e-4f6e-aebd-1fcaaf6c36b9)
2024-10-02 10:24:11 -07:00
Sam Partee
52d82a2789
Refactor Docker Build Process (#78)
This PR improves the Docker build process by shifting from building the
project within the Docker image to using pre-built wheels. The main
changes are:

1. **Updated Makefile:**
- **`VERSION` Variable:** Set to `0.1.0.dev0` to reflect the new default
development version.
   - **`docker` Target:**
- Added steps to build the Arcade and toolkit wheels before building the
Docker image.
- Exports the required extras (`fastapi`, `evals`) to a
`requirements.txt` file.
   - **`full-dist` Target:**
     - Builds distributions for the main project and all toolkits.
     - Copies all the built wheels to a centralized `./dist` directory.
   - **`clean-dist` Target:**
- Cleans build artifacts from `./dist`, `arcade/dist`, and
`toolkits/*/dist` directories.

2. **Modified Dockerfile:**
- **Copy Pre-built Wheels:** Adjusted to copy wheels and the
`requirements.txt` from the `./dist` directory into the Docker image.
   - **Installation Process:**
     - Installs the Arcade wheel with the necessary extras.
- Installs toolkits from the copied wheel files, eliminating the need to
build them inside the Docker image.
- **Simplification:** Removed unnecessary commands, such as installing
build tools and copying the entire codebase, to streamline the
Dockerfile.

3. **Toolkits `pyproject.toml` Updates:**
- Changed the `arcade-ai` dependency version from `^0.1.0` to `0.1.*` in
all toolkit `pyproject.toml` files to ensure compatibility with the new
versioning scheme.

4. **Docker Makefile Adjustments:**
- Set the `VERSION` variable to `0.1.0.dev0` to align with the main
Makefile.
- Ensures consistent versioning across Docker-related build processes.

**Benefits:**

- **Efficiency:** Building wheels outside the Docker context reduces the
Docker image build time and resource consumption. overall docker image
size reduced by **1Gb**!!!
- **Reliability:** Using pre-built wheels ensures consistency across
different environments and simplifies dependency management.
- **Maintainability:** The Dockerfile and Makefiles are cleaner and more
straightforward, making them easier to understand and maintain.


**Notes:**

- Developers should run `make docker` to build and run the Docker
container using the new process.
- Ensure that any CI/CD pipelines are updated to accommodate these
changes in the build process. @sdreyer
2024-10-01 19:05:13 -07:00
Sam Partee
ef72e6c5aa
Merge of arcade up and dev (#77)
Combination of these PRs:
https://github.com/ArcadeAI/arcade-ai/pull/74
https://github.com/ArcadeAI/arcade-ai/pull/76
2024-10-01 12:44:27 -07:00
Eric Gustin
aabceae135
Improve ToolOutputError message (#73)
Before this PR error message:

![image](https://github.com/user-attachments/assets/2d36c05e-006a-4fc5-8265-d2371f9142e4)

Updated error message: 

![image](https://github.com/user-attachments/assets/f7ae7a81-f9b2-4471-9c24-8b02c8009065)
2024-09-27 21:40:57 -07:00
Eric Gustin
5a32685b19
arcade chat catch OpenAIErrors (#69)
Instead of `arcade chat` crashing, we just prompt the user again


![image](https://github.com/user-attachments/assets/34aaed14-13af-4ab0-aae2-9734b34cf7ba)
2024-09-25 15:55:35 -07:00
Eric Gustin
9eb9f77a92
Poll for auth completion in arcade chat (#66)
This PR re-organizes arcade chat implementation and also adds polling
for auth response to complete (if any)


### arcade chat streaming with auth:
![Screenshot 2024-09-25 at 11 28
45 AM](https://github.com/user-attachments/assets/c351fce7-060a-4060-b215-6b5d05028216)

### arcade chat without streaming with auth:
![Screenshot 2024-09-25 at 11 33
08 AM](https://github.com/user-attachments/assets/29a6c5ad-857c-47e6-92d9-52ec87ff88c9)

---------

Co-authored-by: Nate Barbettini <nathanaelb@gmail.com>
2024-09-25 13:43:04 -07:00
Nate Barbettini
5b9438da82
Gracefully handle toolkit load errors (#67) 2024-09-25 12:46:18 -07:00
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
Sam Partee
7d9354b4b4
Address alpha release tweaks and bugs (#62)
# Address Alpha Release Tweaks and Bugs

This PR addresses several issues and tweaks identified during the alpha
release:

- **Ensure `~/.arcade` directory exists before writing the config file**
In `arcade/cli/authn.py`, added code to create the `~/.arcade` directory
if it doesn't exist. This prevents errors when writing the configuration
file during the login process.

- **Fix retry logic in process management**  
In `arcade/cli/launcher.py`, corrected an off-by-one error in the retry
logic within the `_manage_processes` function. This ensures that the
process management behaves as expected when retries are exhausted.

- **Allow passing environment variables to the engine process**
(technically this option isn't exposed yet)
Updated the `start_servers`, `_manage_processes`, and `_start_process`
functions in `arcade/cli/launcher.py` to accept an `engine_env`
parameter. This allows custom environment variables to be set for the
engine process. Also, set `GIN_MODE` to `"release"` by default.

- **Handle cases with no critics in evaluations**  
Modified the `EvalCase` class in `arcade/sdk/eval/eval.py` to handle
scenarios where no critics are provided. This avoids potential errors
during the evaluation process when critics are absent. Should add a test
for this.

- **Adjust dependencies in `pyproject.toml`**  
- Moved `uvicorn` to be an optional dependency and included it in the
`fastapi` extra.
- Removed unnecessary development dependencies (`mkdocs`,
`mkdocs-material`, `mkdocstrings`).
  - Ensured that `uvicorn` is updated to version `^0.30.0`.

---------

Co-authored-by: Nate Barbettini <nate@arcade-ai.com>
2024-09-25 07:35:25 -07:00
Nate Barbettini
5cf451802d
Fix extras in pyproject.toml (#58)
Extras were not being installed by pip correctly. Our syntax in
pyproject.toml was incorrect:
https://python-poetry.org/docs/pyproject/#extras

Tested in a new conda environment and working.
2024-09-24 18:02:56 -07:00