Skip to content

Commit 8567d60

Browse files
authored
fix: model gpt-5.1 reasoning effort for Responses API (#657)
Signed-off-by: Bob Du <[email protected]>
1 parent 8af1a8d commit 8567d60

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

service/src/chatgpt/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ async function chatReplyProcess(options: RequestOptions) {
129129
// Use Responses API or Chat Completions to get search query
130130
let searchQuery: string = ''
131131
if (key.keyModel === 'ResponsesAPI') {
132+
const modelGetSearchQuery = model.startsWith('gpt-5') ? 'gpt-5-nano' : model
132133
const response = await openai.responses.create({
133-
model,
134+
model: modelGetSearchQuery,
134135
instructions: systemMessageGetSearchQuery,
135136
input: messages as OpenAI.Responses.ResponseInput,
136137
reasoning: {
@@ -254,7 +255,7 @@ search result: <search_result>${searchResultContent}</search_result>`,
254255
}
255256
else {
256257
reasoning = {
257-
effort: 'minimal',
258+
effort: model.startsWith('gpt-5.') ? 'none' : 'minimal',
258259
}
259260
}
260261
const stream = await openai.responses.create(

0 commit comments

Comments
 (0)