Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions controller/channel-test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ func testChannel(channel *model.Channel, testModel string, endpointType string,
requestPath = "/v1/images/generations"
}

// responses-only models
if strings.Contains(strings.ToLower(testModel), "codex") {
// Use Responses API if the global policy says this channel+model should use it
if service.ShouldChatCompletionsUseResponsesGlobal(channel.Id, channel.Type, testModel) {
requestPath = "/v1/responses"
}

Expand Down Expand Up @@ -685,8 +685,8 @@ func buildTestRequest(model string, endpointType string, channel *model.Channel,
}
}

// Responses-only models (e.g. codex series)
if strings.Contains(strings.ToLower(model), "codex") {
// Use Responses API if the global policy says this channel+model should use it
if channel != nil && service.ShouldChatCompletionsUseResponsesGlobal(channel.Id, channel.Type, model) {
return &dto.OpenAIResponsesRequest{
Model: model,
Input: json.RawMessage(`[{"role":"user","content":"hi"}]`),
Expand Down
8 changes: 8 additions & 0 deletions web/src/pages/Playground/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,14 @@ const Playground = () => {
setMessage((prevMessage) => {
const newMessages = [...prevMessage, userMessage, loadingMessage];

// Inject the user's new message into the custom payload's messages array
if (Array.isArray(customPayload.messages)) {
customPayload.messages = [
...customPayload.messages,
{ role: MESSAGE_ROLES.USER, content },
];
}

// 发送自定义请求体
sendRequest(customPayload, customPayload.stream !== false);

Expand Down