mirror of
https://github.com/hanzoai/insights.git
synced 2026-11-02 14:32:45 +00:00
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.
41 lines
1.5 KiB
TypeScript
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>
|
|
)
|
|
})}
|
|
</>
|
|
)
|
|
}
|