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
ac7b183b
authored
Feb 08, 2026
by
Seefs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 如果模型管理有自定义配置则不合并默认配置
parent
aed8c07c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
model/pricing.go
+8
-3
No files found.
model/pricing.go
View file @
ac7b183b
...
@@ -196,22 +196,27 @@ func updatePricing() {
...
@@ -196,22 +196,27 @@ func updatePricing() {
modelSupportEndpointsStr
[
ability
.
Model
]
=
endpoints
modelSupportEndpointsStr
[
ability
.
Model
]
=
endpoints
}
}
// 再补充模型自定义端点
// 再补充模型自定义端点
:若配置有效则替换默认端点,不做合并
for
modelName
,
meta
:=
range
metaMap
{
for
modelName
,
meta
:=
range
metaMap
{
if
strings
.
TrimSpace
(
meta
.
Endpoints
)
==
""
{
if
strings
.
TrimSpace
(
meta
.
Endpoints
)
==
""
{
continue
continue
}
}
var
raw
map
[
string
]
interface
{}
var
raw
map
[
string
]
interface
{}
if
err
:=
json
.
Unmarshal
([]
byte
(
meta
.
Endpoints
),
&
raw
);
err
==
nil
{
if
err
:=
json
.
Unmarshal
([]
byte
(
meta
.
Endpoints
),
&
raw
);
err
==
nil
{
endpoints
:=
modelSupportEndpointsStr
[
modelName
]
endpoints
:=
make
([]
string
,
0
,
len
(
raw
))
for
k
:=
range
raw
{
for
k
,
v
:=
range
raw
{
switch
v
.
(
type
)
{
case
string
,
map
[
string
]
interface
{}
:
if
!
common
.
StringsContains
(
endpoints
,
k
)
{
if
!
common
.
StringsContains
(
endpoints
,
k
)
{
endpoints
=
append
(
endpoints
,
k
)
endpoints
=
append
(
endpoints
,
k
)
}
}
}
}
}
if
len
(
endpoints
)
>
0
{
modelSupportEndpointsStr
[
modelName
]
=
endpoints
modelSupportEndpointsStr
[
modelName
]
=
endpoints
}
}
}
}
}
modelSupportEndpointTypes
=
make
(
map
[
string
][]
constant
.
EndpointType
)
modelSupportEndpointTypes
=
make
(
map
[
string
][]
constant
.
EndpointType
)
for
model
,
endpoints
:=
range
modelSupportEndpointsStr
{
for
model
,
endpoints
:=
range
modelSupportEndpointsStr
{
...
...
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