Skip to content

Commit

Permalink
Merge branch 'feat/model-provider-based-on-runtime' into deploy/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
zxhlyh committed Jan 2, 2024
2 parents de068f0 + 9e9f910 commit 669cb65
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import PriorityUseTip from './priority-use-tip'
import { InfoCircle } from '@/app/components/base/icons/src/vender/line/general'
import Button from '@/app/components/base/button'
import TooltipPlus from '@/app/components/base/tooltip-plus'

type QuotaPanelProps = {
provider: ModelProvider
Expand All @@ -32,12 +33,19 @@ const QuotaPanel: FC<QuotaPanelProps> = ({
const priorityUseType = provider.preferred_provider_type
const systemConfig = provider.system_configuration
const currentQuota = systemConfig.enabled && systemConfig.quota_configurations.find(item => item.quota_type === systemConfig.current_quota_type)
const openaiOrAnthropic = ['openai', 'anthropic'].includes(provider.provider)

return (
<div className='group relative shrink-0 min-w-[112px] px-3 py-2 rounded-lg bg-white/[0.3] border-[0.5px] border-black/5'>
<div className='flex items-center mb-2 h-4 text-xs font-medium text-gray-500'>
{t('common.modelProvider.quota')}
<InfoCircle className='ml-0.5 w-3 h-3 text-gray-400' />
<TooltipPlus popupContent={
openaiOrAnthropic
? t('common.modelProvider.card.tip')
: t('common.modelProvider.quotaTip')
}>
<InfoCircle className='ml-0.5 w-3 h-3 text-gray-400' />
</TooltipPlus>
</div>
{
currentQuota && (
Expand Down
1 change: 1 addition & 0 deletions web/i18n/lang/common.en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ const translation = {
priorityUsing: 'Prioritize using',
deprecated: 'Deprecated',
confirmDelete: 'confirm deletion?',
quotaTip: 'Remaining available free tokens',
},
dataSource: {
add: 'Add a data source',
Expand Down
1 change: 1 addition & 0 deletions web/i18n/lang/common.zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ const translation = {
priorityUsing: '优先使用',
deprecated: '已弃用',
confirmDelete: '确认删除?',
quotaTip: '剩余免费额度',
},
dataSource: {
add: '添加数据源',
Expand Down

0 comments on commit 669cb65

Please sign in to comment.