Compare commits

...

11 Commits

Author SHA1 Message Date
hanans426
2df135a118 Merge 664f7ba676 into fdd7bf41c0 2024-10-09 06:25:58 +00:00
aliyun-computenest
664f7ba676 Init computenest project.
on-behalf-of: @org aliyun-computenest@alibaba-inc.com
2024-10-09 14:25:53 +08:00
hanans426
a4c6ac8cf2 Update README.en.md 2024-09-29 09:57:46 +08:00
hanans426
9fab3d00b4 Update README.md 2024-09-29 09:56:36 +08:00
hanans426
0a49508f0f Update README.md 2024-09-29 09:54:24 +08:00
herui.gh
dc2cf8297a add Deployment on Aliyun in readme 2024-09-27 14:12:44 +08:00
抒情熊
fdd7bf41c0 feat: support multipart/form-data format request (#1690)
Some checks failed
CI / Unit tests (push) Has been cancelled
CI / commit_lint (push) Has been cancelled
* "add parser multipart/form-data"

* chore: fix impl

* chore: update impl

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
2024-09-22 17:32:47 +08:00
徐瑞东
29389ed44f fix: modify the type of token models to be text (#1761)
* fix: modify the type of token models to be text

* chore: update receiver name

---------

Co-authored-by: JustSong <songquanpeng@foxmail.com>
2024-09-22 16:51:16 +08:00
byte911
88acc5a614 fix: return the usage info if not null (#1792)
Usage is missing.
2024-09-22 16:41:10 +08:00
TimeTrapzz
a21681096a feat: add siliconflow usage (#1798) 2024-09-22 16:31:26 +08:00
lihangfu
32f90a79a8 feat: support SparkDesk-v3.1-128K (#1732)
* feat: 支持SparkDesk-v3.1-128K以及hunyuan-vision

* feat: 支持SparkDesk-v3.1-128K以及hunyuan-vision

---------

Co-authored-by: lihangfu <hfli8@iflytek.com>
2024-09-22 16:29:09 +08:00
23 changed files with 451 additions and 21 deletions

View File

@@ -0,0 +1 @@
{"ServicePort":"80","SecurityPorts":[80],"RepoName":"hanans426/one-api","Arch":"EcsSingle","RunCommand":"echo \"start run command\"\necho \"${AdminPassword}\"\n","SourceCodePath":".","CommandTimeout":3600,"ServiceType":"private","AllowedRegions":["cn-hangzhou","cn-shanghai","cn-beijing"],"ArtifactSourceType":"SourceCode","ImageId":"centos_7_9_x64_20G_alibase_20230613.vhd","RegionId":"cn-hangzhou","CustomParameters":[{"NoEcho":true,"Type":"String","AssociationProperty":"ALIYUN::ECS::Instance::Password","Label":"管理员密码","Name":"AdminPassword"}]}

21
.computenest/README.md Normal file
View File

@@ -0,0 +1,21 @@
# 代码仓库结构
## 文档目录说明:
```
.
├── README.md - README
├── docs - 服务文档相关文件
│ └── index.md
├── resources - 服务资源文件
│ ├── icons
│ │ └── service_logo.png - 服务logo
│ └── artifact_resources - 部署物相关资源文件
├── ros_templates - 服务ROS模板目录支持多模板
│ └── template.yaml - ROS模板ROS模板引擎根据该模板会自动创建出所有的资源
├── config.yaml - 服务配置文件服务构建过程中会使用计算巢命令行工具computenest-clicomputenest-cli会基于该配置文件构建服务
├── preset_parameters.yaml - 该文件只有托管版有服务商预设参数如VpcIdVSwitchId等该ros模板内容会渲染为表单方便服务商填写
```
## 其他
关于ROS模板请参见 [资源编排](https://help.aliyun.com/zh/ros)。
关于computenest-cli请参见 [computenest-cli](https://pypi.org/project/computenest-cli/)。

28
.computenest/config.yaml Normal file
View File

@@ -0,0 +1,28 @@
Service:
RegionId: cn-hangzhou
DeployType: ros
DeployMetadata:
SupplierDeployMetadata:
FileArtifactRelation:
'{{ computenest::file::hanans426_one-api }}':
ArtifactId: ${Artifact.Artifact_1.ArtifactId}
ArtifactVersion: ${Artifact.Artifact_1.ArtifactVersion}
TemplateConfigs:
- Name: 单机版
Url: 'ros_templates/template.yaml'
AllowedRegions:
- cn-hangzhou
- cn-shanghai
- cn-beijing
ServiceType: private
ServiceInfo:
Locale: zh-CN
ShortDescription: demo
Image: 'resources/icons/service_logo.png'
Artifact:
Artifact_1:
ArtifactType: File
ArtifactName: hanans426_one-api
ArtifactProperty:
RegionId: cn-hangzhou
Url: 'resources/artifact_resources/file/hanans426_one-api.tar.gz'

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

View File

@@ -0,0 +1,70 @@
# 服务模板说明文档
## 服务说明
**简单描述服务的功能和用途。**
例如:
_服务功能描述如“WordPress 是一款免费开源的 CMS适用于创建和管理各种类型的网站。”_
_服务快速上手链接或文档如果有的话_
## 服务架构
此服务模板构建出的服务的部署架构为单机ecs部署。
<img src="architecture_ecs_single.png" width="600" height="400" align="bottom"/>
## 计费说明
通过此服务模板构建服务不产生费用。
用户部署构建出的服务时,资源费用主要涉及:
- 所选ECS实例规格
- 磁盘容量
- 公网带宽
计费方式包括:
- 按量付费(小时)
- 包年包月
预估费用在部署前可实时看到。
## RAM账号所需权限
此服务模板构建出的服务需要对ECS、VPC等资源进行访问和创建操作若使用RAM用户创建服务实例需要在创建服务实例前对使用的RAM用户的账号添加相应资源的权限。添加RAM权限的详细操作请参见[为RAM用户授权](https://help.aliyun.com/document_detail/121945.html)。所需权限如下表所示:
| 权限策略名称 | 备注 |
|-------------------------------------|-------------------------------|
| AliyunECSFullAccess | 管理云服务器服务ECS的权限 |
| AliyunVPCFullAccess | 管理专有网络VPC的权限 |
| AliyunROSFullAccess | 管理资源编排服务ROS的权限 |
| AliyunComputeNestUserFullAccess | 管理计算巢服务ComputeNest的用户侧权限 |
| AliyunComputeNestSupplierFullAccess | 管理计算巢服务ComputeNest的服务商侧权限 |
## 服务实例计费说明
**详细说明服务实例的计费方式。**
_描述费用构成例如所选 vCPU 和内存规格系统盘类型和容量等_
_列出计费方式例如按量付费或包年包月_
## 服务实例部署流程
### 部署参数说明
| 参数组 | 参数项 | 说明 |
|---------------------------------|--------|-------------------------------------------------------------------------|
| 服务实例 | 服务实例名称 | 长度不超过64个字符必须以英文字母开头可包含数字、英文字母、短划线-和下划线_。 |
| | 地域 | 服务实例部署的地域。 |
| | 付费类型 | 资源的计费类型:按量付费和包年包月。 |
| ECS实例配置 | 实例类型 | ECS实例规格配置。 |
| | 实例密码 | 长度8-30必须包含三项大写字母、小写字母、数字、 ()`~!@#$%^&*-+=&#124;{}[]:;'<>,.?/ 中的特殊符号)。 |
| 网络配置 | 可用区 | ECS实例所在可用区。 |
### 部署步骤
**简述如何一步步部署服务实例。**
1. _步骤1描述和相关链接或图片如果有的话_
2. _步骤2描述和相关链接或图片如果有的话_
...
[部署链接](部署链接地址)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

@@ -0,0 +1,218 @@
ROSTemplateFormatVersion: '2015-09-01'
Description:
en: Source Code Service Ros Template
zh-cn: 源代码服务模板
Parameters:
PayType:
Type: String
Label:
en: ECS Instance Charge Type
zh-cn: 付费类型
Default: PostPaid
AllowedValues:
- PostPaid
- PrePaid
AssociationProperty: ChargeType
AssociationPropertyMetadata:
LocaleKey: InstanceChargeType
PayPeriodUnit:
Type: String
Label:
en: Pay Period Unit
zh-cn: 购买资源时长周期
Default: Month
AllowedValues:
- Month
- Year
AssociationProperty: PayPeriodUnit
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Not:
Fn::Equals:
- ${PayType}
- PostPaid
PayPeriod:
Type: Number
Label:
en: Period
zh-cn: 购买资源时长
Default: 1
AllowedValues:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
AssociationProperty: PayPeriod
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Not:
Fn::Equals:
- ${PayType}
- PostPaid
EcsInstanceType:
Type: String
Label:
en: Instance Type
zh-cn: 实例类型
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
InstanceChargeType: ${PayType}
Constraints:
InstanceTypeFamily:
- ecs.u1
- ecs.e
InstancePassword:
NoEcho: true
Type: String
Description:
en: Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)
zh-cn: 服务器登录密码,长度8-30必须包含三项大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)
AllowedPattern: '^[a-zA-Z0-9-\(\)\`\~\!\@\#\$\%\^\&\*\_\-\+\=\|\{\}\[\]\:\;\<\>\,\.\?\/]*$'
Label:
en: Instance Password
zh-cn: 实例密码
ConstraintDescription:
en: Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)
zh-cn: 长度8-30必须包含三项大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)
MinLength: 8
MaxLength: 30
AssociationProperty: ALIYUN::ECS::Instance::Password
ZoneId:
Type: String
Label:
en: Zone ID
zh-cn: 可用区ID
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
VpcId:
Type: String
Label:
en: VPC ID
zh-cn: 专有网络VPC实例ID
AssociationProperty: 'ALIYUN::ECS::VPC::VPCId'
VSwitchId:
Type: String
Label:
en: VSwitch ID
zh-cn: 交换机实例ID
Default: ''
AssociationProperty: 'ALIYUN::ECS::VSwitch::VSwitchId'
AssociationPropertyMetadata:
VpcId: VpcId
ZoneId: ZoneId
AdminPassword:
Type: String
AssociationProperty: ALIYUN::ECS::Instance::Password
Label: 管理员密码
NoEcho: True
Resources:
SecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
SecurityGroupName:
Ref: ALIYUN::StackName
VpcId:
Ref: VpcId
SecurityGroupIngress:
- PortRange: 80/80
Priority: 1
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
NicType: internet
InstanceGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
# 付费类型
InstanceChargeType:
Ref: PayType
PeriodUnit:
Ref: PayPeriodUnit
Period:
Ref: PayPeriod
VpcId:
Ref: VpcId
VSwitchId:
Ref: VSwitchId
ZoneId:
Ref: ZoneId
SecurityGroupId:
Ref: SecurityGroup
ImageId: centos_7_9_x64_20G_alibase_20230613.vhd
Password:
Ref: InstancePassword
InstanceType:
Ref: EcsInstanceType
SystemDiskCategory: cloud_essd
SystemDiskSize: 200
InternetMaxBandwidthOut: 5
IoOptimized: optimized
MaxAmount: 1
RunInstallCommand:
Type: ALIYUN::ECS::RunCommand
Properties:
InstanceIds:
Fn::GetAtt:
- InstanceGroup
- InstanceIds
Type: RunShellScript
Sync: true
Timeout: 3600
CommandContent:
Fn::Sub:
- |
#!/bin/bash
# 源代码通过computenest-cli被打包为tar.gz包并发布为部署物
wget '{{ computenest::file::hanans426_one-api }}' -O hanans426_one-api.tar.gz > /var/log/download.log
tar -zxvf hanans426_one-api.tar.gz && cd "$(tar -tzf hanans426_one-api.tar.gz | head -1 | awk -F'/' '{print $1}')"
echo "start run command"
echo "${AdminPassword}"
ARGUS_VERSION=3.5.7 /bin/bash -c "$(curl -sS https://cms-agent-${RegionId}.oss-${RegionId}-internal.aliyuncs.com/Argus/agent_install_ecs-1.7.sh)" >> /root/install_cms_agent.log 2>&1
- RegionId:
Ref: ALIYUN::Region
Outputs:
ServerAddress:
Description:
en: ServerAddress.
zh-cn: 访问页面。
Value:
Fn::Sub:
- 'http://${ServerAddress}:80'
- ServerAddress:
Fn::Select:
- 0
- Fn::GetAtt:
- InstanceGroup
- PublicIps
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- PayType
- PayPeriodUnit
- PayPeriod
Label:
default: 付费类型配置
- Parameters:
- EcsInstanceType
- InstancePassword
Label:
default: 资源配置
- Parameters:
- ZoneId
- VpcId
- VSwitchId
Label:
default: 可用区配置
- Parameters:
- AdminPassword
Label:
en: Software Configuration
zh-cn: 软件配置

View File

@@ -204,6 +204,17 @@ If you encounter a blank page after deployment, refer to [#97](https://github.co
</div>
</details>
<details>
<summary><strong>Deployment on Aliyun</strong></summary>
<div>
> Aliyun support one-click deployment to a dedicated VPC.。
Aliyun support the fast deployment[Deployment Link](https://computenest.console.aliyun.com/service/instance/create/default?type=user&ServiceName=One%20API%20%E7%A4%BE%E5%8C%BA%E7%89%88)
</div>
</details>
## Configuration
The system is ready to use out of the box.

View File

@@ -302,6 +302,17 @@ Render 可以直接部署 docker 镜像,不需要 fork 仓库https://dashbo
</div>
</details>
<details>
<summary><strong>部署到阿里云</strong></summary>
<div>
> 阿里云支持一键部署到专属VPC。
阿里云支持快速一键部署,[部署链接](https://computenest.console.aliyun.com/service/instance/create/default?type=user&ServiceName=One%20API%20%E7%A4%BE%E5%8C%BA%E7%89%88)
</div>
</details>
## 配置
系统本身开箱即用。

View File

@@ -31,15 +31,15 @@ func UnmarshalBodyReusable(c *gin.Context, v any) error {
contentType := c.Request.Header.Get("Content-Type")
if strings.HasPrefix(contentType, "application/json") {
err = json.Unmarshal(requestBody, &v)
c.Request.Body = io.NopCloser(bytes.NewBuffer(requestBody))
} else {
// skip for now
// TODO: someday non json request have variant model, we will need to implementation this
c.Request.Body = io.NopCloser(bytes.NewBuffer(requestBody))
err = c.ShouldBind(&v)
}
if err != nil {
return err
}
// Reset request body
c.Request.Body = io.NopCloser(bytes.NewBuffer(requestBody))
return nil
}

View File

@@ -81,6 +81,26 @@ type APGC2DGPTUsageResponse struct {
TotalUsed float64 `json:"total_used"`
}
type SiliconFlowUsageResponse struct {
Code int `json:"code"`
Message string `json:"message"`
Status bool `json:"status"`
Data struct {
ID string `json:"id"`
Name string `json:"name"`
Image string `json:"image"`
Email string `json:"email"`
IsAdmin bool `json:"isAdmin"`
Balance string `json:"balance"`
Status string `json:"status"`
Introduction string `json:"introduction"`
Role string `json:"role"`
ChargeBalance string `json:"chargeBalance"`
TotalBalance string `json:"totalBalance"`
Category string `json:"category"`
} `json:"data"`
}
// GetAuthHeader get auth header
func GetAuthHeader(token string) http.Header {
h := http.Header{}
@@ -203,6 +223,28 @@ func updateChannelAIGC2DBalance(channel *model.Channel) (float64, error) {
return response.TotalAvailable, nil
}
func updateChannelSiliconFlowBalance(channel *model.Channel) (float64, error) {
url := "https://api.siliconflow.cn/v1/user/info"
body, err := GetResponseBody("GET", url, channel, GetAuthHeader(channel.Key))
if err != nil {
return 0, err
}
response := SiliconFlowUsageResponse{}
err = json.Unmarshal(body, &response)
if err != nil {
return 0, err
}
if response.Code != 20000 {
return 0, fmt.Errorf("code: %d, message: %s", response.Code, response.Message)
}
balance, err := strconv.ParseFloat(response.Data.Balance, 64)
if err != nil {
return 0, err
}
channel.UpdateBalance(balance)
return balance, nil
}
func updateChannelBalance(channel *model.Channel) (float64, error) {
baseURL := channeltype.ChannelBaseURLs[channel.Type]
if channel.GetBaseURL() == "" {
@@ -227,6 +269,8 @@ func updateChannelBalance(channel *model.Channel) (float64, error) {
return updateChannelAPI2GPTBalance(channel)
case channeltype.AIGC2D:
return updateChannelAIGC2DBalance(channel)
case channeltype.SiliconFlow:
return updateChannelSiliconFlowBalance(channel)
default:
return 0, errors.New("尚未实现")
}

View File

@@ -12,7 +12,7 @@ import (
)
type ModelRequest struct {
Model string `json:"model"`
Model string `json:"model" form:"model"`
}
func Distribute() func(c *gin.Context) {

View File

@@ -30,7 +30,7 @@ type Token struct {
RemainQuota int64 `json:"remain_quota" gorm:"bigint;default:0"`
UnlimitedQuota bool `json:"unlimited_quota" gorm:"default:false"`
UsedQuota int64 `json:"used_quota" gorm:"bigint;default:0"` // used quota
Models *string `json:"models" gorm:"default:''"` // allowed models
Models *string `json:"models" gorm:"type:text"` // allowed models
Subnet *string `json:"subnet" gorm:"default:''"` // allowed subnet
}
@@ -121,30 +121,40 @@ func GetTokenById(id int) (*Token, error) {
return &token, err
}
func (token *Token) Insert() error {
func (t *Token) Insert() error {
var err error
err = DB.Create(token).Error
err = DB.Create(t).Error
return err
}
// Update Make sure your token's fields is completed, because this will update non-zero values
func (token *Token) Update() error {
func (t *Token) Update() error {
var err error
err = DB.Model(token).Select("name", "status", "expired_time", "remain_quota", "unlimited_quota", "models", "subnet").Updates(token).Error
err = DB.Model(t).Select("name", "status", "expired_time", "remain_quota", "unlimited_quota", "models", "subnet").Updates(t).Error
return err
}
func (token *Token) SelectUpdate() error {
func (t *Token) SelectUpdate() error {
// This can update zero values
return DB.Model(token).Select("accessed_time", "status").Updates(token).Error
return DB.Model(t).Select("accessed_time", "status").Updates(t).Error
}
func (token *Token) Delete() error {
func (t *Token) Delete() error {
var err error
err = DB.Delete(token).Error
err = DB.Delete(t).Error
return err
}
func (t *Token) GetModels() string {
if t == nil {
return ""
}
if t.Models == nil {
return ""
}
return *t.Models
}
func DeleteTokenById(id int, userId int) (err error) {
// Why we need userId here? In case user want to delete other's token.
if id == 0 || userId == 0 {

View File

@@ -55,8 +55,8 @@ func StreamHandler(c *gin.Context, resp *http.Response, relayMode int) (*model.E
render.StringData(c, data) // if error happened, pass the data to client
continue // just ignore the error
}
if len(streamResponse.Choices) == 0 {
// but for empty choice, we should not pass it to client, this is for azure
if len(streamResponse.Choices) == 0 && streamResponse.Usage == nil {
// but for empty choice and no usage, we should not pass it to client, this is for azure
continue // just ignore empty choice
}
render.StringData(c, data)

View File

@@ -5,4 +5,5 @@ var ModelList = []string{
"hunyuan-standard",
"hunyuan-standard-256K",
"hunyuan-pro",
"hunyuan-vision",
}

View File

@@ -5,6 +5,7 @@ var ModelList = []string{
"SparkDesk-v1.1",
"SparkDesk-v2.1",
"SparkDesk-v3.1",
"SparkDesk-v3.1-128K",
"SparkDesk-v3.5",
"SparkDesk-v4.0",
}

View File

@@ -272,9 +272,9 @@ func xunfeiMakeRequest(textRequest model.GeneralOpenAIRequest, domain, authUrl,
}
func parseAPIVersionByModelName(modelName string) string {
parts := strings.Split(modelName, "-")
if len(parts) == 2 {
return parts[1]
index := strings.IndexAny(modelName, "-")
if index != -1 {
return modelName[index+1:]
}
return ""
}
@@ -288,6 +288,8 @@ func apiVersion2domain(apiVersion string) string {
return "generalv2"
case "v3.1":
return "generalv3"
case "v3.1-128K":
return "pro-128k"
case "v3.5":
return "generalv3.5"
case "v4.0":
@@ -297,7 +299,14 @@ func apiVersion2domain(apiVersion string) string {
}
func getXunfeiAuthUrl(apiVersion string, apiKey string, apiSecret string) (string, string) {
var authUrl string
domain := apiVersion2domain(apiVersion)
authUrl := buildXunfeiAuthUrl(fmt.Sprintf("wss://spark-api.xf-yun.com/%s/chat", apiVersion), apiKey, apiSecret)
switch apiVersion {
case "v3.1-128K":
authUrl = buildXunfeiAuthUrl(fmt.Sprintf("wss://spark-api.xf-yun.com/%s/pro-128k", apiVersion), apiKey, apiSecret)
break
default:
authUrl = buildXunfeiAuthUrl(fmt.Sprintf("wss://spark-api.xf-yun.com/%s/chat", apiVersion), apiKey, apiSecret)
}
return domain, authUrl
}

View File

@@ -128,6 +128,7 @@ var ModelRatio = map[string]float64{
"SparkDesk-v1.1": 1.2858, // ¥0.018 / 1k tokens
"SparkDesk-v2.1": 1.2858, // ¥0.018 / 1k tokens
"SparkDesk-v3.1": 1.2858, // ¥0.018 / 1k tokens
"SparkDesk-v3.1-128K": 1.2858, // ¥0.018 / 1k tokens
"SparkDesk-v3.5": 1.2858, // ¥0.018 / 1k tokens
"SparkDesk-v4.0": 1.2858, // ¥0.018 / 1k tokens
"360GPT_S2_V9": 0.8572, // ¥0.012 / 1k tokens

View File

@@ -78,7 +78,7 @@ const EditChannel = (props) => {
localModels = ['chatglm_pro', 'chatglm_std', 'chatglm_lite'];
break;
case 18:
localModels = ['SparkDesk', 'SparkDesk-v1.1', 'SparkDesk-v2.1', 'SparkDesk-v3.1', 'SparkDesk-v3.5', 'SparkDesk-v4.0'];
localModels = ['SparkDesk', 'SparkDesk-v1.1', 'SparkDesk-v2.1', 'SparkDesk-v3.1', 'SparkDesk-v3.1-128K', 'SparkDesk-v3.5', 'SparkDesk-v4.0'];
break;
case 19:
localModels = ['360GPT_S2_V9', 'embedding-bert-512-v1', 'embedding_s1_v1', 'semantic_similarity_s1_v1'];

View File

@@ -268,6 +268,8 @@ function renderBalance(type, balance) {
return <span>¥{balance.toFixed(2)}</span>;
case 13: // AIGC2D
return <span>{renderNumber(balance)}</span>;
case 44: // SiliconFlow
return <span>¥{balance.toFixed(2)}</span>;
default:
return <span>不支持</span>;
}

View File

@@ -91,7 +91,7 @@ const typeConfig = {
other: '版本号'
},
input: {
models: ['SparkDesk', 'SparkDesk-v1.1', 'SparkDesk-v2.1', 'SparkDesk-v3.1', 'SparkDesk-v3.5', 'SparkDesk-v4.0']
models: ['SparkDesk', 'SparkDesk-v1.1', 'SparkDesk-v2.1', 'SparkDesk-v3.1', 'SparkDesk-v3.1-128K', 'SparkDesk-v3.5', 'SparkDesk-v4.0']
},
prompt: {
key: '按照如下格式输入APPID|APISecret|APIKey',

View File

@@ -52,6 +52,8 @@ function renderBalance(type, balance) {
return <span>¥{balance.toFixed(2)}</span>;
case 13: // AIGC2D
return <span>{renderNumber(balance)}</span>;
case 44: // SiliconFlow
return <span>¥{balance.toFixed(2)}</span>;
default:
return <span>不支持</span>;
}