Compare commits

...

2 Commits

9 changed files with 32 additions and 20 deletions

View File

@@ -29,11 +29,11 @@ func GetUserGroups(c *gin.Context) {
userId := c.GetInt("id")
userGroup, _ = model.GetUserGroup(userId, false)
userUsableGroups := service.GetUserUsableGroups(userGroup)
for groupName, ratio := range ratio_setting.GetGroupRatioCopy() {
for groupName, _ := range ratio_setting.GetGroupRatioCopy() {
// UserUsableGroups contains the groups that the user can use
if desc, ok := userUsableGroups[groupName]; ok {
usableGroups[groupName] = map[string]interface{}{
"ratio": ratio,
"ratio": service.GetUserGroupRatio(userGroup, groupName),
"desc": desc,
}
}

View File

@@ -31,7 +31,7 @@ func Playground(c *gin.Context) {
return
}
group := c.GetString("group")
group := common.GetContextKeyString(c, constant.ContextKeyUsingGroup)
modelName := c.GetString("original_model")
userId := c.GetInt("id")

View File

@@ -94,6 +94,7 @@ func Distribute() func(c *gin.Context) {
return
}
usingGroup = playgroundRequest.Group
common.SetContextKey(c, constant.ContextKeyUsingGroup, usingGroup)
}
}
channel, selectGroup, err = service.CacheGetRandomSatisfiedChannel(c, usingGroup, modelRequest.Model, 0)

View File

@@ -52,3 +52,14 @@ func GetUserAutoGroup(userGroup string) []string {
}
return autoGroups
}
// GetUserGroupRatio 获取用户使用某个分组的倍率
// userGroup 用户分组
// group 需要获取倍率的分组
func GetUserGroupRatio(userGroup, group string) float64 {
ratio, ok := ratio_setting.GetGroupGroupRatio(userGroup, group)
if ok {
return ratio
}
return ratio_setting.GetGroupRatio(group)
}

View File

@@ -2100,6 +2100,8 @@
"例如4.99": "e.g.: 4.99",
"例如100000": "e.g.: 100000",
"请填写完整的产品信息": "Please fill in complete product information",
"产品ID已存在": "Product ID already exists"
"产品ID已存在": "Product ID already exists",
"统一的": "The Unified",
"大模型接口网关": "LLM API Gateway"
}
}

View File

@@ -2080,6 +2080,8 @@
"默认区域,如: us-central1": "Région par défaut, ex: us-central1",
"默认折叠侧边栏": "Réduire la barre latérale par défaut",
"默认测试模型": "Modèle de test par défaut",
"默认补全倍率": "Taux de complétion par défaut"
"默认补全倍率": "Taux de complétion par défaut",
"统一的": "La Passerelle",
"大模型接口网关": "API LLM Unifiée"
}
}

View File

@@ -2071,6 +2071,8 @@
"默认区域,如: us-central1": "デフォルトリージョンus-central1",
"默认折叠侧边栏": "サイドバーをデフォルトで折りたたむ",
"默认测试模型": "デフォルトテストモデル",
"默认补全倍率": "デフォルト補完倍率"
"默认补全倍率": "デフォルト補完倍率",
"统一的": "統合型",
"大模型接口网关": "LLM APIゲートウェイ"
}
}

View File

@@ -2089,6 +2089,8 @@
"默认区域,如: us-central1": "Регион по умолчанию, например: us-central1",
"默认折叠侧边栏": "Сворачивать боковую панель по умолчанию",
"默认测试模型": "Модель для тестирования по умолчанию",
"默认补全倍率": "Коэффициент вывода по умолчанию"
"默认补全倍率": "Коэффициент вывода по умолчанию",
"统一的": "Единый",
"大模型接口网关": "Шлюз API LLM"
}
}

View File

@@ -169,19 +169,11 @@ const Home = () => {
<h1
className={`text-4xl md:text-5xl lg:text-6xl xl:text-7xl font-bold text-semi-color-text-0 leading-tight ${isChinese ? 'tracking-wide md:tracking-wider' : ''}`}
>
{i18n.language === 'en' ? (
<>
The Unified
<br />
<span className='shine-text'>LLMs API Gateway</span>
</>
) : (
<>
统一的
<br />
<span className='shine-text'>大模型接口网关</span>
</>
)}
<>
{t('统一的')}
<br />
<span className='shine-text'>{t('大模型接口网关')}</span>
</>
</h1>
<p className='text-base md:text-lg lg:text-xl text-semi-color-text-1 mt-4 md:mt-6 max-w-xl'>
{t('更好的价格,更好的稳定性,只需要将模型基址替换为:')}