Skip to main content

forgesight-eval

Run-correlated eval scores and human feedback for ForgeSight. Quality joins cost and structure on the same run_id, on the same pipeline, in the same backends — Langfuse scores, Phoenix evaluations, any OTLP sink — for two function calls.

pip install forgesight-eval
from forgesight import telemetry
from forgesight_eval import record_evaluation, record_feedback

with telemetry.agent_run("rag-answerer", metadata={"prompt_version": "v7"}) as run:
    answer = await answer_question(...)
    # an automated eval (LLM-as-judge / Ragas / DeepEval) → one call, correlated to the live run
    record_evaluation("faithfulness", score=0.91, label="pass",
                      explanation="All claims grounded.", evaluator="ragas")

# hours later, from a webhook — post-hoc human feedback, by run_id:
def on_thumbs_down(run_id: str, comment: str) -> None:
    record_feedback("user_satisfaction", run_id=run_id, label="thumbs_down",
                    score=0.0, comment=comment, source="human")

How it works

  • record_evaluation attaches to the current run (ambient context) — a real-time eval nests as a child span under the run's open trace. record_feedback attaches to a past run by run_id — a standalone record carrying the id so the backend re-associates it.
  • Both emit the OTel gen_ai.evaluation.* attributes (name / score.value / score.label / explanation) plus forgesight.evaluation.* extensions (source, realtime, evaluator), and publish an EVALUATION_RECORDED lifecycle event. Backends that speak the convention (Langfuse, Phoenix) display them as scores/evaluations with no per-backend code (P4).
  • Non-blocking (P6): both build a record and enqueue — no network I/O on the agent or the webhook. Secure by default (P7): explanation / comment text is gated by capture_explanation and the global content-capture switch.

Configuration

modules:
  eval:
    enabled: true              # master switch (default false — install ≠ active)
    emit_as: "span"            # span | event
    capture_explanation: true  # still gated by the global content-capture switch (P7)
    score_schema:              # optional — validates score/label at the call site
      faithfulness:      { type: "numeric", min: 0.0, max: 1.0 }
      user_satisfaction: { type: "categorical", labels: ["thumbs_up", "thumbs_down"] }

At least one of score / label must be set. Schema'd dimensions are validated (numeric range, categorical membership); un-schema'd dimensions are accepted unvalidated (open set).

Out of scope

Running the evaluations (judges/metrics live in the agent or a library — this is the transport), a dashboard, and score storage/aggregation (the backend's job).

License

Apache-2.0

Metadata

Release files for forgesight-eval 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for forgesight-eval 0.1.1
File Size Uploaded
forgesight_eval-0.1.1.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for forgesight-eval 0.1.1
File Interpreter ABI Platform
forgesight_eval-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / forgesight_eval-0.1.1.tar.gz

Download URL forgesight_eval-0.1.1.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
716abd0ff7cbd3c598d25fdec4ccf90cb5c0ed0f6905c8e772a87d4ead48d3ae
BLAKE2b-256 checksum
How to use checksums
1cb685f65b0c281abd5643fca5c215936433d26182e3b6694b7e6c6899310b50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / forgesight_eval-0.1.1-py3-none-any.whl

Download URL forgesight_eval-0.1.1-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
540e37999b59b927acefccdf401d0c22fe1a861d9ee4ce80b20f595135771d29
BLAKE2b-256 checksum
How to use checksums
88e05bda2e9f06fd76dc6ddf9dff433c81a23cb143667b706729bc9cb5d81e4d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page