module Web.View.AgentRegistrations.Show where import IHP.ViewPrelude import Web.View.AgentRegistrations.Index (trustBadge, statusBadge) import Text.Printf (printf) data ShowView = ShowView { agent :: !AgentRegistration , policies :: ![ModelRoutingPolicy] , recentProposals :: ![AgentProposal] , mPerformance :: !(Maybe AgentPerformanceRecord) } instance View ShowView where html ShowView { .. } = [hsx|
{agent.slug}
Provider
{agent.provider}
Model
{agent.modelName}
Description
{fromMaybe "—" agent.description}
| Task Type | Priority | Active |
|---|
| Type | Status | Tokens In/Out | Created |
|---|
Mean confidence: —
|] renderMeanConfidence (Just c) = [hsx|Mean confidence: {printf "%.2f" c :: String}
|] renderPolicyRow :: ModelRoutingPolicy -> Html renderPolicyRow p = [hsx|No routing policies. Add one.
|] noProposalsMsg :: Html noProposalsMsg = [hsx|No proposals yet.
|] renderProposalRow :: AgentProposal -> Html renderProposalRow p = [hsx|{show p.proposalsGenerated}
Generated
{show p.proposalsAccepted}
Accepted
{show p.proposalsRejected}
Rejected
{show acceptPct}%
Acceptance rate