Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ad47a337
authored
Mar 03, 2024
by
1808837298@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复添加和编辑渠道无可选择模型
parent
d70115a5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletions
+9
-1
common/model-ratio.go
+1
-0
controller/model.go
+7
-0
router/api-router.go
+1
-1
No files found.
common/model-ratio.go
View file @
ad47a337
...
...
@@ -83,6 +83,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.5"
:
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
"embedding_s1_v1"
:
0.0715
,
// ¥0.001 / 1k tokens
...
...
controller/model.go
View file @
ad47a337
...
...
@@ -129,6 +129,13 @@ func ListModels(c *gin.Context) {
})
}
func
ChannelListModels
(
c
*
gin
.
Context
)
{
c
.
JSON
(
200
,
gin
.
H
{
"object"
:
"list"
,
"data"
:
openAIModels
,
})
}
func
RetrieveModel
(
c
*
gin
.
Context
)
{
modelId
:=
c
.
Param
(
"model"
)
if
model
,
ok
:=
openAIModelsMap
[
modelId
];
ok
{
...
...
router/api-router.go
View file @
ad47a337
...
...
@@ -73,7 +73,7 @@ func SetApiRouter(router *gin.Engine) {
{
channelRoute
.
GET
(
"/"
,
controller
.
GetAllChannels
)
channelRoute
.
GET
(
"/search"
,
controller
.
SearchChannels
)
channelRoute
.
GET
(
"/models"
,
controller
.
ListModels
)
channelRoute
.
GET
(
"/models"
,
controller
.
Channel
ListModels
)
channelRoute
.
GET
(
"/:id"
,
controller
.
GetChannel
)
channelRoute
.
GET
(
"/test"
,
controller
.
TestAllChannels
)
channelRoute
.
GET
(
"/test/:id"
,
controller
.
TestChannel
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment