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