docs(examples): add Langfuse trace evaluation walkthrough - #308
docs(examples): add Langfuse trace evaluation walkthrough#308Chang Liu (changliu2) wants to merge 2 commits into
Conversation
Add a judge-only customer example that converts existing Langfuse traces into ASSERT conversations, inspects reconstructed tool evidence, and evaluates explicit permissible and impermissible behaviors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Jake Present (jakepresent)
left a comment
There was a problem hiding this comment.
The deterministic fixture passes, but the converter drops real conversation turns in a supported/default input shape.
trace_to_spans() tracks seen (role, content) counts across the whole Langfuse session, while each trace recomputes occurrence counts from zero (langfuse_to_assert.py:581-592, shared at :659-677). If a Langfuse session stores one user message per trace and the user sends the same text twice, such as two separate “yes” messages, the second trace’s user turn is treated as already seen and omitted. I reproduced this with two traces in one session, each containing only its current [{role: user, content: yes}] input: the emitted transcript roles are user, assistant, assistant instead of user, assistant, user, assistant. The README explicitly says each user message can be one Langfuse trace, so this corrupts the judge input on the advertised path.
The checked-in verifier only covers fixture traces that replay growing history, and it is not run by any current required check; this PR’s check rollup is CodeQL-only. Please fix the cross-trace deduplication and add the repeated-identical-turn case to an automated test surface that CI executes. The existing fixture verification itself is green: 20 traces become 8 conversations with the expected taxonomy.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Fixed in |
Summary
Customer flow
behavior_categories[].permissibleflags.Validation
python examples/langfuse_trace_evaluation/verify.pyScope boundary
The deterministic file-export flow is covered here. Direct API mode uses Langfuse's public v1 trace list/detail endpoints and may require an SDK export on deployments that no longer expose that response shape. Publishing ASSERT judgments back to the original Langfuse sessions is not part of this PR.