Commit graph

30 commits

Author SHA1 Message Date
Sam Partee
db948125d5
Tool Evalulation SDK (#35)
1. New Eval SDK (`arcade/sdk/eval.py`):
- Introduces `EvalSuite`, `EvalCase`, and `EvalRubric` classes for
structured evaluation.
- Implements various Critic classes (Binary, Numeric, Similarity) for
flexible scoring.
- Adds a `tool_eval` decorator for easy integration with existing tools.

2. CLI Integration (`arcade/cli/main.py` and `arcade/cli/utils.py`):
   - Adds an `evals` command to run evaluation suites from the CLI.
   - Implements result display functionality for evaluation outcomes.

3. Toolkit Updates:
- Adds evaluation scripts for Gmail
([toolkits/gmail/evals/eval_gmail_tools.py](file:///Users/spartee/Dropbox/Arcade/platform/Team/arcade-ai/toolkits/gmail/evals/eval_gmail_tools.py#1%2C1-1%2C1))
and Slack
([toolkits/slack/evals/eval_slack_messaging.py](file:///Users/spartee/Dropbox/Arcade/platform/Team/arcade-ai/toolkits/slack/evals/eval_slack_messaging.py#1%2C1-1%2C1))
toolkits.
- Demonstrates practical usage of the Eval SDK with real-world
scenarios.

4. Miscellaneous:
- Updates `arcade/cli/new.py` to optionally generate an `evals`
directory for new toolkits.

---------

Co-authored-by: Nate Barbettini <nate@arcade-ai.com>
2024-09-19 03:36:44 -07:00
Sam Partee
d12542db55
Tool auth (#30)
Note - This Engine PR must go first:
https://github.com/ArcadeAI/Engine/pull/65

In this PR:
- Add `client.tool.authorize` to authorize a tool by name by @Spartee 
- Refactored client.auth methods to always pass around scopes (as needed
by the above Engine PR) by @nbarbettini
- Reduced the scopes needed in the Slack toolkit, which was blocked by
this until now! @nbarbettini

---------

Co-authored-by: Nate Barbettini <nate@arcade-ai.com>
2024-09-09 15:00:17 -07:00
Nate Barbettini
408f2e6300
gmail: search_emails_by_header tool (#28)
Adds a new gmail tool to search email, plus some cleanup.
2024-08-30 15:29:02 -07:00
Nate Barbettini
950e075750
arcade login in CLI (#25)
Working now:
- `arcade login` works against the Cloud
- `arcade logout` deletes your local credentials

---------

Co-authored-by: Sam Partee <sam@arcade-ai.com>
2024-08-30 11:20:00 -07:00
Sam Partee
aee706e118
Developer Makefile and Docker steps (#26)
Simpler docker build for the Actor and makefile
2024-08-29 21:24:46 -07:00
Sam Partee
1c1403d1dd
Arcade Client Implementation: Sync and Async (#22)
This PR introduces both synchronous and asynchronous Arcade client
implementations, providing a robust interface for interacting with the
Arcade API.

## Key Features

1. Synchronous (`SyncArcade`) and Asynchronous (`AsyncArcade`) clients
2. Authentication and Tool resources
3. OpenAI chat completions integration
4. Comprehensive error handling

## Client Methods

Both `SyncArcade` and `AsyncArcade` offer:

- `auth.authorize()`: Initiate authorization
- `auth.poll_authorization()`: Check authorization status
- `tool.run()`: Execute a tool
- `tool.get()`: Retrieve tool specification
- `chat.create()`: Create chat completions

## Usage Examples

### Synchronous Authorization

```python
from arcade.client import AuthProvider, SyncArcade

client = SyncArcade(base_url="https://api.arcade.com", api_key="your_api_key")
auth_response = client.auth.authorize(
    provider=AuthProvider.google,
    scopes=["https://www.googleapis.com/auth/gmail.readonly"],
    user_id="user123"
)
print(f"Authorize at: {auth_response.auth_url}")
```

### Asynchronous Authorization

```python
import asyncio
from arcade.client import AuthProvider, AsyncArcade

async def authorize():
    client = AsyncArcade(base_url="https://api.arcade.com", api_key="your_api_key")
    auth_response = await client.auth.authorize(
        provider=AuthProvider.slack_user,
        scopes=["chat:write", "im:write"],
        user_id="user456"
    )
    print(f"Authorize at: {auth_response.auth_url}")

asyncio.run(authorize())
```

This implementation provides a flexible and powerful way to interact
with Arcade services, supporting both synchronous and asynchronous
workflows.
2024-08-28 17:24:43 -07:00
Nate Barbettini
07d9cca2ab
API key auth for Actors (#23)
Protects Actors by requiring the Engine to send a token signed with the
Arcade API key.

Also, updates the FastAPI example so the Arcade API key is sent to the
Engine in a chat request.
2024-08-28 17:15:24 -07:00
Nate Barbettini
ab703b75ef
Retryable errors (#20)
Co-authored-by: Sterling Dreyer <sdreyer@ucsc.edu>
2024-08-22 16:17:15 -07:00
Nate Barbettini
acba912816
Start Slack toolkit (#17)
- Start a Slack toolkit with a few tools
- Update Google auth
- Show user's email in `arcade chat`
2024-08-22 16:12:42 -07:00
Nate Barbettini
3154298572
GitHub toolkit (#16)
the changes needed in the SDK to handle tool auth,
 and multiple tool auth providers.
2024-08-21 19:22:46 -07:00
Sam Partee
35baaf0dc8
Pass ToolContext and CLI cleanup (#13)
Added
-  `arcade dev` - serves a simple fastapi actor
- `arcade config` - show/edit/change config in `~/.arcade`
- `arcade chat` - chat with LLM without toolcalls

Changed:
- `arcade show`, `arcade run` - can now use all installed toolkits

---------

Co-authored-by: Nate Barbettini <nate@arcade-ai.com>
2024-08-13 15:40:08 -07:00
Nate Barbettini
554f47cfd7
Spike FlaskActor and cleanup of BaseActor (#12)
Cleanup and refactor of actor abstraction and
related classes/methods


[ committed by @Spartee ]
[ Authored by @nbarbettini ]
2024-08-05 13:26:56 -07:00
Nate Barbettini
14998a43e3
Add ToolContext and OAuth tool support (#10)
- Adds initial `ToolContext` to tool invocations
- This unlocks the ability to call authenticated tools (e.g. Gmail),
which works in this branch against Nate's dev engine
2024-08-02 11:25:08 -07:00
Nate Barbettini
1b67cee667
JWT auth for Engine->Actor communication (#11)
Implements:
https://app.clickup.com/9014390315/v/dc/8cmtbhb-2714/8cmtbhb-5974

Todo:
- [x] Initial demo
- [x] Get API key config from `arcade.config`
- [x] Get engine URL from config
- [x] Final cleanup
- [ ] Enforce auth for all requests (waiting for engine)
2024-08-01 09:14:37 -07:00
Sam Partee
41cc749a6e
Cleanup Examples (#9) 2024-07-26 00:23:25 -07:00
Sam Partee
90f1146968
Cleanup examples and README (#8)
As the title states.

Also added in a prompt/execute capabiltiy into the CLI for the ``arcade
run`` command

Committed by @nbarbettini 
Original work by @Spartee
2024-07-24 09:10:31 -07:00
Sam Partee
8964111023
Refactor into library approach (#7)
This PR makes a few sweeping changes to the actor, cli, and overall
structure of the project.

- CLI commands skeleton 
- ``arcade run``, ``arcade show``, and ``arcade new``
- Working package mangement solution (``arcade_`` packages)
- Actor approach for using frameworks other than FastAPI
- Client for calling Engine within ``arcade/core``
- beginning of the config interface.

---------

Co-authored-by: Nate Barbettini <nate@arcade-ai.com>
2024-07-23 16:26:54 -07:00
Sam Partee
28fe56cfc1
MyPy Compliant (#5)
MyPy compliance for the whole codebase

- systematic way of executing tools (`executor.py`)
- support for using pydantic models in tool inputs and outputs
- mypy compliance (most of the changes)
- removal of unused code (from previous iterations)

Co-authored-by: Nate Barbettini <nate@arcade-ai.com>
2024-07-16 17:01:38 -07:00
Sam Partee
7f3abfd1f9
Tool SDK, Schemas (#2)
Co-authored-by: Nate Barbettini <nathanaelb@gmail.com>
2024-07-14 23:37:46 -07:00
Sam Partee
a5decd4483 Minor Cleanup 2024-06-04 09:05:18 -07:00
Sam Partee
5a3c28ab5e checin 2024-05-15 18:15:33 -07:00
Sam Partee
16c8156f98 multiple branch example 2024-05-14 21:47:10 -07:00
Sam Partee
2e4542c260 checkin 2024-05-10 19:05:15 -07:00
Sam Partee
6272a426f1 4 simple flows working 2024-05-08 21:25:23 -07:00
Sam Partee
ea708d62f0 Working product example 2024-05-03 18:59:59 -07:00
Sam Partee
8b3d977bcd Working pre-specified flow 2024-05-02 19:40:05 -07:00
Sam Partee
2e5e5ef7c8 more tools in sql example 2024-05-01 23:53:53 -07:00
Sam Partee
41b783ef2e Sql chat example 2024-04-29 21:28:58 -07:00
Sam Partee
9ba728f755 Working read email call 2024-04-25 18:20:31 -07:00
Sam Partee
56531cbd18 initial commit 2024-04-22 14:13:09 -07:00