mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-09-16 14:57:15 +00:00
fix(models): flag models without pricing
This commit is contained in:
@@ -4,7 +4,7 @@ import {
|
||||
TooltipContent,
|
||||
TooltipTrigger,
|
||||
} from '@/components/ui/tooltip';
|
||||
import { Coins } from 'lucide-react';
|
||||
import { Coins, TriangleAlert } from 'lucide-react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import ModelAvailabilityIndicator from './ModelAvailabilityIndicator';
|
||||
|
||||
@@ -42,46 +42,57 @@ export default function LangBotModelMetadata({
|
||||
|
||||
return (
|
||||
<span className="ml-auto inline-flex shrink-0 items-center gap-2 pl-3">
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<span
|
||||
className="inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground"
|
||||
onMouseDown={(event) => event.preventDefault()}
|
||||
>
|
||||
<Coins className="size-3" />
|
||||
{hasPricing
|
||||
? compact
|
||||
? t('models.pricing.compact', { input, output })
|
||||
: t('models.pricing.inline', { input, output })
|
||||
: compact
|
||||
? '—'
|
||||
: t('models.pricing.unavailable')}
|
||||
</span>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="top" className="max-w-64">
|
||||
{hasPricing ? (
|
||||
<div className="space-y-0.5">
|
||||
<p>{t('models.pricing.title')}</p>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{t('models.pricing.input', {
|
||||
credits: input,
|
||||
})}
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{t('models.pricing.output', {
|
||||
credits: output,
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
{hasPricing ? (
|
||||
<>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<span
|
||||
className="inline-flex items-center gap-1 text-xs tabular-nums text-muted-foreground"
|
||||
onMouseDown={(event) => event.preventDefault()}
|
||||
>
|
||||
<Coins className="size-3" />
|
||||
{compact
|
||||
? t('models.pricing.compact', { input, output })
|
||||
: t('models.pricing.inline', { input, output })}
|
||||
</span>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="top" className="max-w-64">
|
||||
<div className="space-y-0.5">
|
||||
<p>{t('models.pricing.title')}</p>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{t('models.pricing.input', {
|
||||
credits: input,
|
||||
})}
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{t('models.pricing.output', {
|
||||
credits: output,
|
||||
})}
|
||||
</p>
|
||||
</div>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
<ModelAvailabilityIndicator
|
||||
availability={metadata?.availability}
|
||||
show={loaded}
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<span
|
||||
className="inline-flex size-4 shrink-0 items-center justify-center"
|
||||
aria-label={t('models.pricing.unavailable')}
|
||||
onMouseDown={(event) => event.preventDefault()}
|
||||
>
|
||||
<TriangleAlert className="size-3.5 text-amber-500" />
|
||||
</span>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="top" className="max-w-64">
|
||||
<p>{t('models.pricing.unavailable')}</p>
|
||||
)}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
<ModelAvailabilityIndicator
|
||||
availability={metadata?.availability}
|
||||
show={loaded}
|
||||
/>
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
)}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ const enUS = {
|
||||
title: 'Credits per 1M tokens',
|
||||
input: 'Input: {{credits}} credits',
|
||||
output: 'Output: {{credits}} credits',
|
||||
unavailable: 'No current price',
|
||||
unavailable: 'No price found. The model may have been removed.',
|
||||
},
|
||||
langbotModels: 'LangBot Models',
|
||||
spaceTrialTooltip:
|
||||
|
||||
@@ -318,7 +318,8 @@ const esES = {
|
||||
title: 'Créditos por 1 M de tokens',
|
||||
input: 'Entrada: {{credits}} créditos',
|
||||
output: 'Salida: {{credits}} créditos',
|
||||
unavailable: 'Sin precio actual',
|
||||
unavailable:
|
||||
'No se encontró el precio. Es posible que el modelo haya sido retirado.',
|
||||
},
|
||||
langbotModels: 'Modelos LangBot',
|
||||
spaceTrialTooltip:
|
||||
|
||||
@@ -321,7 +321,7 @@ const jaJP = {
|
||||
title: '100万トークンあたりのクレジット',
|
||||
input: '入力:{{credits}} クレジット',
|
||||
output: '出力:{{credits}} クレジット',
|
||||
unavailable: '現在の価格なし',
|
||||
unavailable: '価格が見つかりません。モデルが削除された可能性があります。',
|
||||
},
|
||||
langbotModels: 'LangBot モデル',
|
||||
spaceTrialTooltip:
|
||||
|
||||
@@ -315,7 +315,7 @@ const ruRU = {
|
||||
title: 'Кредиты за 1 млн токенов',
|
||||
input: 'Ввод: {{credits}} кредитов',
|
||||
output: 'Вывод: {{credits}} кредитов',
|
||||
unavailable: 'Нет актуальной цены',
|
||||
unavailable: 'Цена не найдена. Возможно, модель была удалена.',
|
||||
},
|
||||
langbotModels: 'Модели LangBot',
|
||||
spaceTrialTooltip:
|
||||
|
||||
@@ -304,7 +304,7 @@ const thTH = {
|
||||
title: 'เครดิตต่อ 1 ล้านโทเค็น',
|
||||
input: 'อินพุต: {{credits}} เครดิต',
|
||||
output: 'เอาต์พุต: {{credits}} เครดิต',
|
||||
unavailable: 'ไม่มีราคาปัจจุบัน',
|
||||
unavailable: 'ไม่พบราคา โมเดลอาจถูกนำออกแล้ว',
|
||||
},
|
||||
langbotModels: 'โมเดล LangBot',
|
||||
spaceTrialTooltip:
|
||||
|
||||
@@ -312,7 +312,7 @@ const viVN = {
|
||||
title: 'Tín dụng trên 1 triệu token',
|
||||
input: 'Đầu vào: {{credits}} tín dụng',
|
||||
output: 'Đầu ra: {{credits}} tín dụng',
|
||||
unavailable: 'Chưa có giá hiện tại',
|
||||
unavailable: 'Không tìm thấy giá. Mô hình có thể đã bị gỡ.',
|
||||
},
|
||||
langbotModels: 'Mô hình LangBot',
|
||||
spaceTrialTooltip:
|
||||
|
||||
@@ -302,7 +302,7 @@ const zhHans = {
|
||||
title: '每 1M tokens 消耗积分',
|
||||
input: '输入:{{credits}} 积分',
|
||||
output: '输出:{{credits}} 积分',
|
||||
unavailable: '暂无价格',
|
||||
unavailable: '未查询到价格,模型可能已被下架',
|
||||
},
|
||||
langbotModels: 'LangBot 模型',
|
||||
spaceTrialTooltip:
|
||||
|
||||
@@ -293,7 +293,7 @@ const zhHant = {
|
||||
title: '每 1M tokens 消耗積分',
|
||||
input: '輸入:{{credits}} 積分',
|
||||
output: '輸出:{{credits}} 積分',
|
||||
unavailable: '暫無價格',
|
||||
unavailable: '未查詢到價格,模型可能已被下架',
|
||||
},
|
||||
langbotModels: 'LangBot 模型',
|
||||
spaceTrialTooltip:
|
||||
|
||||
Reference in New Issue
Block a user