Skip to content
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
fb35d7b
Add --failed-only and --output flags to evals command
Nov 5, 2025
c11a908
Add tests for display_eval_results with --failed-only and --output flags
Nov 5, 2025
19199e7
Add additional test cases for better coverage of display_eval_results
Nov 5, 2025
22d0ecb
Extract filtering logic to testable function and add tests
Nov 5, 2025
9bbb691
Merge branch 'main' into francisco/arcade-cli/updating-evals-to-show-…
jottakka Nov 14, 2025
c293f18
Merge branch 'main' into francisco/arcade-cli/updating-evals-to-show-…
Nov 17, 2025
d593a4a
Adding MCP Servers supports to Arcade Evals
Nov 18, 2025
eda0260
Updating loading from mcp server
Nov 20, 2025
aa1fff9
Merge branch 'main' into francisco/updating-arcade-evails
Nov 26, 2025
2d889f6
Updating to accept headers
Nov 26, 2025
de2df04
fixing linting
Nov 26, 2025
8c5a096
Merge branch 'main' into francisco/arcade-cli/updating-evals-to-show-…
Nov 28, 2025
049f965
added session support for the http loader
torresmateo Nov 28, 2025
3998b39
removed debug print
torresmateo Nov 28, 2025
56399e2
handled unsupported protocol for http tool loader
torresmateo Nov 28, 2025
477ccbe
Open API issue
Nov 28, 2025
5f28a55
Updating strict mode
Nov 28, 2025
bf7678e
Updating strict mode
Nov 28, 2025
baad441
Merge branch 'main' into francisco/arcade-cli/updating-evals-to-show-…
Dec 9, 2025
d28b572
Merge branch 'main' into francisco/updating-arcade-evails
Dec 9, 2025
627bcee
Merge branch 'francisco/arcade-cli/updating-evals-to-show-only-failed…
Dec 9, 2025
4a8c6a5
Merge branch 'main' into francisco/updating-arcade-evails
Dec 13, 2025
dd25223
Merge branch 'main' into francisco/updating-arcade-evails
Dec 15, 2025
823e39d
Merge branch 'main' into francisco/updating-arcade-evails
Dec 16, 2025
6b0a725
updating eval suit to contain all tool sources
Dec 16, 2025
ccfae39
Adding anthropic support
Dec 16, 2025
6318e4a
Adding fuzzy weights
Dec 17, 2025
0ccf790
fix cursor reported bug
Dec 17, 2025
73dc94c
Delete libs/arcade-evals/arcade_evals/_experimental/__init__.py
jottakka Dec 17, 2025
39b7f91
Adding capture mode and smashing some bugs after reviews
jottakka Dec 17, 2025
8b6e17d
fixing output formating when capture mode
jottakka Dec 17, 2025
bbbdbf8
added options to export result to md, txt and html
jottakka Dec 18, 2025
702e2eb
fixing bugs
jottakka Dec 18, 2025
dd1e335
fixes after cursor bot review
jottakka Dec 18, 2025
e4beb77
some updates
jottakka Dec 18, 2025
81006fc
Adding compare mode
jottakka Dec 19, 2025
de0f8e6
Updating evals for multiple models/providers/tracks
jottakka Dec 23, 2025
af916e9
removing self implemented loader and adding flag to override arcade url
jottakka Dec 24, 2025
f38ebbb
Add locks for loading tools from mcp servers only once and avoid conc…
jottakka Dec 25, 2025
aaca430
Add locks for loading tools from mcp servers only once and avoid conc…
jottakka Dec 25, 2025
27ae785
Add locks for loading tools from mcp servers only once and avoid conc…
jottakka Dec 25, 2025
1f3cb55
Fixing html template
jottakka Dec 25, 2025
b5e04aa
Add locks for loading tools from mcp servers only once and avoid conc…
jottakka Dec 25, 2025
ead5b13
Add locks for loading tools from mcp servers only once and avoid conc…
jottakka Dec 25, 2025
a234574
Add locks for loading tools from mcp servers only once and avoid conc…
jottakka Dec 25, 2025
22d9943
Add locks for loading tools from mcp servers only once and avoid conc…
jottakka Dec 25, 2025
b26135c
Fix CLI help tests: strip ANSI codes before assertions
jottakka Dec 25, 2025
b460ac2
adressing some changes after code review
jottakka Dec 29, 2025
e0acb78
updating after erics review
jottakka Jan 4, 2026
524c77d
adding examples
jottakka Jan 5, 2026
5c074d3
fixing ci failing
jottakka Jan 5, 2026
716787d
minor changes
jottakka Jan 5, 2026
435e191
minor fix
jottakka Jan 5, 2026
8c0d677
updates after erics review
jottakka Jan 7, 2026
b9847ad
Merge branch 'main' into francisco/updating-arcade-evails
jottakka Jan 7, 2026
ff8acf9
fixing some linting
jottakka Jan 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 126 additions & 26 deletions libs/arcade-cli/arcade_cli/display.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import TYPE_CHECKING, Any
from pathlib import Path
from typing import TYPE_CHECKING, Any, Optional

from arcade_core.schema import ToolDefinition
from rich.console import Console
Expand Down Expand Up @@ -323,14 +324,14 @@ def display_tool_messages(tool_messages: list[dict]) -> None:
)


def display_eval_results(results: list[list[dict[str, Any]]], show_details: bool = False) -> None:
"""
Display evaluation results in a format inspired by pytest's output.

Args:
results: List of dictionaries containing evaluation results for each model.
show_details: Whether to show detailed results for each case.
"""
def _display_results_to_console(
output_console: Console,
results: list[list[dict[str, Any]]],
show_details: bool = False,
failed_only: bool = False,
original_counts: Optional[tuple[int, int, int, int]] = None,
) -> None:
"""Display evaluation results to a Rich console."""
total_passed = 0
total_failed = 0
total_warned = 0
Expand All @@ -343,9 +344,9 @@ def display_eval_results(results: list[list[dict[str, Any]]], show_details: bool
cases = model_results.get("cases", [])
total_cases += len(cases)

console.print(f"[bold]Model:[/bold] [bold magenta]{model}[/bold magenta]")
output_console.print(f"[bold]Model:[/bold] [bold magenta]{model}[/bold magenta]")
if show_details:
console.print(f"[bold magenta]{rubric}[/bold magenta]")
output_console.print(f"[bold magenta]{rubric}[/bold magenta]")

for case in cases:
evaluation = case["evaluation"]
Expand All @@ -365,24 +366,123 @@ def display_eval_results(results: list[list[dict[str, Any]]], show_details: bool

# Display one-line summary for each case with score as a percentage
score_percentage = evaluation.score * 100
console.print(f"{status} {case['name']} -- Score: {score_percentage:.2f}%")
output_console.print(f"{status} {case['name']} -- Score: {score_percentage:.2f}%")

if show_details:
# Show detailed information for each case
console.print(f"[bold]User Input:[/bold] {case['input']}\n")
console.print("[bold]Details:[/bold]")
console.print(_format_evaluation(evaluation))
console.print("-" * 80)

# Summary
summary = (
f"[bold]Summary -- [/bold]Total: {total_cases} -- [green]Passed: {total_passed}[/green]"
)
if total_warned > 0:
summary += f" -- [yellow]Warnings: {total_warned}[/yellow]"
if total_failed > 0:
summary += f" -- [red]Failed: {total_failed}[/red]"
console.print(summary + "\n")
output_console.print(f"[bold]User Input:[/bold] {case['input']}\n")
output_console.print("[bold]Details:[/bold]")
output_console.print(_format_evaluation(evaluation))
output_console.print("-" * 80)

output_console.print("")

# Summary - use original counts if filtering, otherwise use current counts
if failed_only and original_counts:
# Unpack original counts
orig_total, orig_passed, orig_failed, orig_warned = original_counts

# Show disclaimer before summary
output_console.print(
f"[bold yellow]Note: Showing only {total_cases} failed evaluation(s) (--failed-only)[/bold yellow]"
)

# Build summary with original counts
summary = (
f"[bold]Summary -- [/bold]Total: {orig_total} -- [green]Passed: {orig_passed}[/green]"
)
if orig_warned > 0:
summary += f" -- [yellow]Warnings: {orig_warned}[/yellow]"
if orig_failed > 0:
summary += f" -- [red]Failed: {orig_failed}[/red]"
else:
# Normal summary with current counts
summary = (
f"[bold]Summary -- [/bold]Total: {total_cases} -- [green]Passed: {total_passed}[/green]"
)
if total_warned > 0:
summary += f" -- [yellow]Warnings: {total_warned}[/yellow]"
if total_failed > 0:
summary += f" -- [red]Failed: {total_failed}[/red]"

output_console.print(summary + "\n")


def display_eval_results(
results: list[list[dict[str, Any]]],
show_details: bool = False,
output_file: Optional[str] = None,
failed_only: bool = False,
original_counts: Optional[tuple[int, int, int, int]] = None,
output_formats: list[str] | None = None,
include_context: bool = False,
) -> None:
"""
Display evaluation results in a format inspired by pytest's output.

Args:
results: List of dictionaries containing evaluation results for each model.
show_details: Whether to show detailed results for each case.
output_file: Optional file path to write results to.
failed_only: Whether only failed cases are being displayed (adds disclaimer).
original_counts: Optional tuple of (total_cases, total_passed, total_failed, total_warned)
from before filtering. Used when failed_only is True.
output_formats: List of output formats for file output (e.g., ['txt', 'md', 'html']).
include_context: Whether to include system_message and additional_messages.
"""
# Always display to terminal with Rich formatting
try:
_display_results_to_console(console, results, show_details, failed_only, original_counts)
except Exception as e:
console.print(f"[red]Error displaying results to console: {type(e).__name__}: {e}[/red]")

# Also write to file(s) if requested using the specified formatter(s)
if output_file and output_formats:
from arcade_cli.formatters import get_formatter

# Get base path without extension
base_path = Path(output_file)
base_name = base_path.stem
parent_dir = base_path.parent

try:
parent_dir.mkdir(parents=True, exist_ok=True)
except PermissionError:
console.print(f"[red]Error: Permission denied creating directory {parent_dir}[/red]")
return
except OSError as e:
console.print(f"[red]Error creating directory: {e}[/red]")
return

for fmt in output_formats:
# Define output_path early so it's available in exception handlers
output_path = parent_dir / f"{base_name}.{fmt}"
try:
formatter = get_formatter(fmt)
formatted_output = formatter.format(
results,
show_details=show_details,
failed_only=failed_only,
original_counts=original_counts,
include_context=include_context,
)

# Build output path with proper extension
output_path = parent_dir / f"{base_name}.{formatter.file_extension}"

with open(output_path, "w", encoding="utf-8") as f:
f.write(formatted_output)

console.print(f"[green]✓ Results written to {output_path}[/green]")

except PermissionError:
console.print(f"[red]Error: Permission denied writing to {output_path}[/red]")
except OSError as e:
console.print(f"[red]Error writing file: {e}[/red]")
except Exception as e:
console.print(
f"[red]Error formatting results ({fmt}): {type(e).__name__}: {e}[/red]"
)


def _format_evaluation(evaluation: "EvaluationResult") -> str:
Expand Down
Loading