ForgeSight eval — run-correlated eval scores + human feedback on the telemetry pipeline.
Project description
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_evaluationattaches to the current run (ambient context) — a real-time eval nests as a child span under the run's open trace.record_feedbackattaches to a past run byrun_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) plusforgesight.evaluation.*extensions (source,realtime,evaluator), and publish anEVALUATION_RECORDEDlifecycle 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/commenttext is gated bycapture_explanationand 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forgesight_eval-0.1.1.tar.gz.
File metadata
- Download URL: forgesight_eval-0.1.1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
716abd0ff7cbd3c598d25fdec4ccf90cb5c0ed0f6905c8e772a87d4ead48d3ae
|
|
| MD5 |
a06bd83a4a6f0c8f3e5a24861abf0888
|
|
| BLAKE2b-256 |
1cb685f65b0c281abd5643fca5c215936433d26182e3b6694b7e6c6899310b50
|
File details
Details for the file forgesight_eval-0.1.1-py3-none-any.whl.
File metadata
- Download URL: forgesight_eval-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
540e37999b59b927acefccdf401d0c22fe1a861d9ee4ce80b20f595135771d29
|
|
| MD5 |
445c1a5bb0a6fc54fd7556424153ccda
|
|
| BLAKE2b-256 |
88e05bda2e9f06fd76dc6ddf9dff433c81a23cb143667b706729bc9cb5d81e4d
|