Skip to main content

111 labeled eval cases, deterministic checks, and scoring for financial trading agents

Project description

finagent-evals

111 labeled eval cases, deterministic check functions, and weighted scoring for financial trading agents.

Built from the Ghostfolio Trading Agent eval suite and published as a standalone package so anyone building financial AI agents can benchmark against a curated, production-tested dataset.

Features

  • 111 eval cases across 3 layers: golden (34), scenarios (47), dataset (30)
  • Deterministic checks -- no LLM calls, pure Python assertions
  • 7 check dimensions: tool selection, tool execution, source citation, content validation, negative validation, ground truth, structural
  • Weighted scoring with 6 dimensions: intent, tools, content, safety, confidence, verification
  • Mock infrastructure: Ghostfolio client, market data (OHLCV), seed portfolio
  • Authoritative sources: 9 bundled IRC/IRS tax references for compliance checks

Install

pip install finagent-evals

Quick Start

from finagent_evals import GOLDEN_CASES, get_all_cases, run_golden_checks

# Browse cases
print(len(GOLDEN_CASES))    # 34
print(len(get_all_cases()))  # 111

# Run checks against your agent's output
case = GOLDEN_CASES[0]
result = {
    "response": {"summary": "Your portfolio has AAPL and GOOG..."},
    "tools_called": ["get_portfolio_snapshot"],
    "tool_errors": [],
    "react_step": 1,
    "latency_seconds": 2.0,
}
checks = run_golden_checks(case, result)
print(checks["passed"])  # True/False

Eval Case Format

Each case is a dict with:

{
    "id": "gs-001",
    "input": "Show me my portfolio",
    "expected_tools": ["get_portfolio_snapshot"],
    "expected_output_contains": ["portfolio"],
    "expected_output_contains_any": ["position", "holding", "value"],
    "should_not_contain": ["I don't know", "unable"],
    "ground_truth_contains": ["AAPL", "GOOG"],
    "max_react_steps": 2,
    "max_latency_seconds": 10,
    "category": "portfolio_overview",
    "case_type": "happy_path",
}

Check Functions

from finagent_evals import (
    check_tools,          # required tools present
    check_tools_any,      # at least one of list
    check_must_contain,   # all terms in response
    check_contains_any,   # any term in response
    check_must_not_contain,  # no forbidden terms
    check_ground_truth,   # mock-data values present
    check_structural,     # steps + latency in budget
    check_authoritative_sources,  # IRC/IRS citations
)

Scoring

from finagent_evals import (
    score_intent, score_tools, score_content,
    score_safety, score_ground_truth,
    aggregate_results,
    WEIGHT_INTENT,  # 0.20
    WEIGHT_TOOLS,   # 0.25
    WEIGHT_CONTENT, # 0.15
    WEIGHT_SAFETY,  # 0.15
)

Mock Infrastructure

from finagent_evals import MockGhostfolioClient, MOCK_LAST_CLOSE, mock_fetch_with_retry

client = MockGhostfolioClient()
holdings = client.get_holdings()  # 2 positions: AAPL, GOOG
prices = MOCK_LAST_CLOSE          # {"AAPL": 187.50, "TSLA": 248.00, ...}

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

finagent_evals-0.1.0.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

finagent_evals-0.1.0-py3-none-any.whl (34.9 kB view details)

Uploaded Python 3

File details

Details for the file finagent_evals-0.1.0.tar.gz.

File metadata

  • Download URL: finagent_evals-0.1.0.tar.gz
  • Upload date:
  • Size: 31.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for finagent_evals-0.1.0.tar.gz
Algorithm Hash digest
SHA256 01b42a181a21d9400a87148f58040942f40829531d24f0dae2a77ccd9dd5ef2f
MD5 07878c3b5a0cc2f3784ba25c32cfb137
BLAKE2b-256 6fd88ae2a7e7ce25618faa1cd5123d8f42afe00837e211ca9c6750b1ddf4e494

See more details on using hashes here.

File details

Details for the file finagent_evals-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: finagent_evals-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 34.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for finagent_evals-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5fc4066d0c095f07bec0c8fc1a36437fb88d8c105ecb9eac2c50c5ccb9cf0ac
MD5 f0565e62cf2ac3244707d26329da9d9a
BLAKE2b-256 b86a91d198a2e3681b55c8ab82266c65c7500d5c8db395f26651854063cc8c45

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page