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
44550587
authored
Feb 06, 2026
by
Seefs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: auto default codex to /v1/responses without overriding user-selected endpoint
parent
0c0b69a3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
controller/channel-test.go
+16
-0
No files found.
controller/channel-test.go
View file @
44550587
...
@@ -42,6 +42,20 @@ type testResult struct {
...
@@ -42,6 +42,20 @@ type testResult struct {
newAPIError
*
types
.
NewAPIError
newAPIError
*
types
.
NewAPIError
}
}
func
normalizeChannelTestEndpoint
(
channel
*
model
.
Channel
,
modelName
,
endpointType
string
)
string
{
normalized
:=
strings
.
TrimSpace
(
endpointType
)
if
normalized
!=
""
{
return
normalized
}
if
strings
.
HasSuffix
(
modelName
,
ratio_setting
.
CompactModelSuffix
)
{
return
string
(
constant
.
EndpointTypeOpenAIResponseCompact
)
}
if
channel
!=
nil
&&
channel
.
Type
==
constant
.
ChannelTypeCodex
{
return
string
(
constant
.
EndpointTypeOpenAIResponse
)
}
return
normalized
}
func
testChannel
(
channel
*
model
.
Channel
,
testModel
string
,
endpointType
string
,
isStream
bool
)
testResult
{
func
testChannel
(
channel
*
model
.
Channel
,
testModel
string
,
endpointType
string
,
isStream
bool
)
testResult
{
tik
:=
time
.
Now
()
tik
:=
time
.
Now
()
var
unsupportedTestChannelTypes
=
[]
int
{
var
unsupportedTestChannelTypes
=
[]
int
{
...
@@ -77,6 +91,8 @@ func testChannel(channel *model.Channel, testModel string, endpointType string,
...
@@ -77,6 +91,8 @@ func testChannel(channel *model.Channel, testModel string, endpointType string,
}
}
}
}
endpointType
=
normalizeChannelTestEndpoint
(
channel
,
testModel
,
endpointType
)
requestPath
:=
"/v1/chat/completions"
requestPath
:=
"/v1/chat/completions"
// 如果指定了端点类型,使用指定的端点类型
// 如果指定了端点类型,使用指定的端点类型
...
...
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