### Overview Major restructuring from monolithic `arcade-ai` package to modular library architecture with standardized uv-based dependency management.  ### New Package Structure - **`arcade-tdk`** - Lightweight toolkit development kit (core decorators, auth) - **`arcade-core`** - Core execution engine and catalog functionality - **`arcade-serve`** - FastAPI/MCP server components - **`arcade-ai`** - Meta package that includes CLI functionality. Optionally include evals via the `evals` extra. Optionally include all packages via the `all` extra. ### Key Benefits - **Lighter Dependencies**: Toolkits now depend only on `arcade-tdk` (~2 deps) vs full `arcade-ai` (~30+ deps) - **Faster Builds**: uv provides 10-100x faster dependency resolution and installation - **Better Modularity**: Clear separation of concerns, consumers import only what they need - **Standard Tooling**: Eliminates custom poetry scripts, uses standard Python packaging ### Migration Impact - All 20 toolkits converted from poetry → uv with `arcade-tdk` dependencies plus `arcade-ai[evals]` and `arcade-serve` dev dependencies. When developing locally, devs should install toolkits via `make install-local`. - Modern Python 3.10+ type hints throughout - Standardized build system with hatchling backend - Enhanced Makefile with robust toolkit management commands - Removed `arcade dev` CLI command - Reduce the number of files created by `arcade new` and add an option to not generate a tests and evals folder. This foundation enables faster development cycles and cleaner dependency chains for the growing toolkit ecosystem. ### Todo After this PR is merged - [ ] Post-merge workflow(s) (release & publish containers, etc) - [ ] Release order plan. @EricGustin suggests releasing in the following order: 1. `arcade-core` version 0.1.0 2. `arcade-serve` version 0.1.0 and `arcade-tdk` version 0.1.0 3. `arcade-ai` version 2.0.0 4. Patch release for all toolkits (all changes in toolkits are internal refactors) - [ ] [Update docs](https://github.com/ArcadeAI/docs/pull/318) --------- Co-authored-by: Eric Gustin <eric@arcade.dev> Co-authored-by: Eric Gustin <34000337+EricGustin@users.noreply.github.com>
158 lines
5.1 KiB
Python
158 lines
5.1 KiB
Python
from arcade_evals import (
|
|
BinaryCritic,
|
|
EvalRubric,
|
|
EvalSuite,
|
|
ExpectedToolCall,
|
|
tool_eval,
|
|
)
|
|
from arcade_tdk import ToolCatalog
|
|
|
|
import arcade_github
|
|
from arcade_github.tools.models import SortDirection
|
|
from arcade_github.tools.repositories import (
|
|
count_stargazers,
|
|
get_repository,
|
|
list_org_repositories,
|
|
list_repository_activities,
|
|
list_review_comments_in_a_repository,
|
|
)
|
|
|
|
# Evaluation rubric
|
|
rubric = EvalRubric(
|
|
fail_threshold=0.9,
|
|
warn_threshold=0.95,
|
|
)
|
|
|
|
catalog = ToolCatalog()
|
|
# Register the GitHub tools
|
|
catalog.add_module(arcade_github)
|
|
|
|
|
|
@tool_eval()
|
|
def github_repositories_eval_suite() -> EvalSuite:
|
|
"""Evaluation suite for GitHub Repositories tools."""
|
|
suite = EvalSuite(
|
|
name="GitHub Repositories Tools Evaluation Suite",
|
|
system_message="You are an AI assistant that helps users interact with GitHub repositories using the provided tools.",
|
|
catalog=catalog,
|
|
rubric=rubric,
|
|
)
|
|
|
|
# Count Stargazers
|
|
suite.add_case(
|
|
name="Count stargazers of a repository",
|
|
user_message="How many stargazers does the ArcadeAI/test repo have?",
|
|
expected_tool_calls=[
|
|
ExpectedToolCall(
|
|
func=count_stargazers,
|
|
args={
|
|
"owner": "ArcadeAI",
|
|
"name": "test",
|
|
},
|
|
)
|
|
],
|
|
critics=[
|
|
BinaryCritic(critic_field="owner", weight=0.5),
|
|
BinaryCritic(critic_field="name", weight=0.5),
|
|
],
|
|
)
|
|
|
|
# List an Organization's Repositories
|
|
suite.add_case(
|
|
name="List repositories in an organization",
|
|
user_message="List all repos in the ArcadeAI org, sorted by creation date in descending order.",
|
|
expected_tool_calls=[
|
|
ExpectedToolCall(
|
|
func=list_org_repositories,
|
|
args={
|
|
"org": "ArcadeAI",
|
|
"repo_type": "all",
|
|
"sort": "created",
|
|
"sort_direction": SortDirection.DESC,
|
|
},
|
|
)
|
|
],
|
|
critics=[
|
|
BinaryCritic(critic_field="org", weight=0.1),
|
|
BinaryCritic(critic_field="repo_type", weight=0.1),
|
|
BinaryCritic(critic_field="sort", weight=0.1),
|
|
BinaryCritic(critic_field="sort_direction", weight=0.1),
|
|
],
|
|
)
|
|
|
|
# Get Repository
|
|
suite.add_case(
|
|
name="Get details of a repository",
|
|
user_message="Tell me about the test repo owned by ArcadeAI.",
|
|
expected_tool_calls=[
|
|
ExpectedToolCall(
|
|
func=get_repository,
|
|
args={
|
|
"owner": "ArcadeAI",
|
|
"repo": "test",
|
|
"include_extra_data": False,
|
|
},
|
|
)
|
|
],
|
|
critics=[
|
|
BinaryCritic(critic_field="owner", weight=0.3),
|
|
BinaryCritic(critic_field="repo", weight=0.3),
|
|
],
|
|
)
|
|
|
|
# List Repository Activities
|
|
suite.add_case(
|
|
name="List activities in a repository",
|
|
user_message="List all PR merges in the 'ArcadeAI/test' repository that were performed by TestUser in the last month",
|
|
expected_tool_calls=[
|
|
ExpectedToolCall(
|
|
func=list_repository_activities,
|
|
args={
|
|
"owner": "ArcadeAI",
|
|
"repo": "test",
|
|
"direction": SortDirection.DESC,
|
|
"per_page": 30,
|
|
"actor": "TestUser",
|
|
"time_period": "month",
|
|
"activity_type": "pr_merge",
|
|
"include_extra_data": False,
|
|
},
|
|
)
|
|
],
|
|
critics=[
|
|
BinaryCritic(critic_field="owner", weight=0.1),
|
|
BinaryCritic(critic_field="repo", weight=0.1),
|
|
BinaryCritic(critic_field="direction", weight=0.1),
|
|
BinaryCritic(critic_field="actor", weight=0.1),
|
|
BinaryCritic(critic_field="time_period", weight=0.1),
|
|
BinaryCritic(critic_field="activity_type", weight=0.1),
|
|
],
|
|
)
|
|
|
|
# List Review Comments in a Repository
|
|
suite.add_case(
|
|
name="List review comments in a repository",
|
|
user_message="List all review comments in the 'ArcadeAI/test' repository, sorted by creation date in descending order.",
|
|
expected_tool_calls=[
|
|
ExpectedToolCall(
|
|
func=list_review_comments_in_a_repository,
|
|
args={
|
|
"owner": "ArcadeAI",
|
|
"repo": "test",
|
|
"sort": "created",
|
|
"direction": SortDirection.DESC,
|
|
"per_page": 30,
|
|
"page": 1,
|
|
"include_extra_data": False,
|
|
},
|
|
)
|
|
],
|
|
critics=[
|
|
BinaryCritic(critic_field="owner", weight=0.2),
|
|
BinaryCritic(critic_field="repo", weight=0.2),
|
|
BinaryCritic(critic_field="sort", weight=0.1),
|
|
BinaryCritic(critic_field="direction", weight=0.1),
|
|
],
|
|
)
|
|
|
|
return suite
|