Files
insights/products/ai_observability/frontend/LLMASessionEvaluationsDisplay.tsx
zeekay bc4ddf332b chore: rebase the tree onto upstream master fa1a9a60
Mechanically re-derived: bin/debrand runs over a fresh import of
posthog/posthog@fa1a9a60d4 (2026-08-06).
The pipeline (.hanzo/workflows), the Dockerfiles and bin/docker*
entrypoints, compose files, LLM.md and the squashed initial migration
are restored from the shipped tree, same as the previous import.

The prune's import-closure guard kept 21 products the new core now
imports; dropping them is a refactor now, recorded rather than forced.
2026-08-06 01:25:36 -07:00

41 lines
1.5 KiB
TypeScript

import { useValues } from 'kea'
import { Tag, Tooltip } from '@hanzo/elements'
import { aiObservabilitySessionEvaluationsLogic } from './aiObservabilitySessionEvaluationsLogic'
import { EvalTooltipContent, getEvalBadgeProps, getEvalSummaries } from './components/EvalResultBadges'
interface LLMASessionEvaluationsDisplayProps {
sessionId: string
}
export function LLMASessionEvaluationsDisplay({ sessionId }: LLMASessionEvaluationsDisplayProps): JSX.Element | null {
const { sessionEvaluations } = useValues(aiObservabilitySessionEvaluationsLogic({ sessionId }))
// A session that resumes after being evaluated can be graded again; collapse to the newest
// verdict per evaluation so a stale tag never sits beside a fresh one. Same helper the trace
// and generation surfaces use, so the tooltip and badge read identically everywhere.
const summaries = getEvalSummaries(sessionEvaluations)
if (summaries.length === 0) {
return null
}
return (
<>
{summaries.map((summary) => {
const { type, icon, label } = getEvalBadgeProps(summary.latestRun)
return (
<Tooltip key={summary.latestRun.evaluation_id} title={<EvalTooltipContent {...summary} />}>
<span>
<Tag type={type} icon={icon} size="medium">
{label}
</Tag>
</span>
</Tooltip>
)
})}
</>
)
}