Skip to content

Commit

Permalink
feat: support SparkDesk-v3.5-32K (#1832)
Browse files Browse the repository at this point in the history
Co-authored-by: lihangfu <[email protected]>
  • Loading branch information
lihangfu and lihangfu authored Oct 27, 2024
1 parent fdd7bf4 commit e32cb0b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions relay/adaptor/xunfei/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ var ModelList = []string{
"SparkDesk-v3.1",
"SparkDesk-v3.1-128K",
"SparkDesk-v3.5",
"SparkDesk-v3.5-32K",
"SparkDesk-v4.0",
}
7 changes: 6 additions & 1 deletion relay/adaptor/xunfei/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ func apiVersion2domain(apiVersion string) string {
return "pro-128k"
case "v3.5":
return "generalv3.5"
case "v3.5-32K":
return "max-32k"
case "v4.0":
return "4.0Ultra"
}
Expand All @@ -303,7 +305,10 @@ func getXunfeiAuthUrl(apiVersion string, apiKey string, apiSecret string) (strin
domain := apiVersion2domain(apiVersion)
switch apiVersion {
case "v3.1-128K":
authUrl = buildXunfeiAuthUrl(fmt.Sprintf("wss://spark-api.xf-yun.com/%s/pro-128k", apiVersion), apiKey, apiSecret)
authUrl = buildXunfeiAuthUrl(fmt.Sprintf("wss://spark-api.xf-yun.com/chat/pro-128k"), apiKey, apiSecret)
break
case "v3.5-32K":
authUrl = buildXunfeiAuthUrl(fmt.Sprintf("wss://spark-api.xf-yun.com/chat/max-32k"), apiKey, apiSecret)
break
default:
authUrl = buildXunfeiAuthUrl(fmt.Sprintf("wss://spark-api.xf-yun.com/%s/chat", apiVersion), apiKey, apiSecret)
Expand Down
1 change: 1 addition & 0 deletions relay/billing/ratio/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ var ModelRatio = map[string]float64{
"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-v3.5-32K": 1.2858, // ¥0.018 / 1k tokens
"SparkDesk-v4.0": 1.2858, // ¥0.018 / 1k tokens
"360GPT_S2_V9": 0.8572, // ¥0.012 / 1k tokens
"embedding-bert-512-v1": 0.0715, // ¥0.001 / 1k tokens
Expand Down
2 changes: 1 addition & 1 deletion web/air/src/pages/Channel/EditChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.1-128K', '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-v3.5-32K', 'SparkDesk-v4.0'];
break;
case 19:
localModels = ['360GPT_S2_V9', 'embedding-bert-512-v1', 'embedding_s1_v1', 'semantic_similarity_s1_v1'];
Expand Down
2 changes: 1 addition & 1 deletion web/berry/src/views/Channel/type/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const typeConfig = {
other: '版本号'
},
input: {
models: ['SparkDesk', 'SparkDesk-v1.1', 'SparkDesk-v2.1', 'SparkDesk-v3.1', 'SparkDesk-v3.1-128K', '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-v3.5-32K', 'SparkDesk-v4.0']
},
prompt: {
key: '按照如下格式输入:APPID|APISecret|APIKey',
Expand Down

0 comments on commit e32cb0b

Please sign in to comment.