import * as Popover from '@radix-ui/react-popover' import { ArrowDown, ArrowRightLeft, ArrowUp, Coins, Cpu, Info, } from 'lucide-react' import { ResponseUsage } from '../../types/llm/response' type LLMResponseInfoProps = { usage?: ResponseUsage estimatedPrice: number | null model?: string } export default function LLMResponseInfoPopover({ usage, estimatedPrice, model, }: LLMResponseInfoProps) { return ( {usage ? (
LLM Response Information
Token Count
Input: {usage.prompt_tokens}
Output: {usage.completion_tokens}
Total: {usage.total_tokens}
Estimated Price: {estimatedPrice === null ? 'Not available' : `$${estimatedPrice.toFixed(4)}`}
Model: {model ?? 'Not available'}
) : (
Usage statistics are not available for this model
)}
) }