mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-10 15:49:29 +08:00
fix: OpenAIResponseProvider summaryForSearch impl model wrong
This commit is contained in:
parent
352b449948
commit
e4d1dd0c87
@ -1011,6 +1011,7 @@ export default class OpenAIProvider extends BaseOpenAiProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const lastUserMessage = messages[messages.length - 1]
|
const lastUserMessage = messages[messages.length - 1]
|
||||||
|
|
||||||
const { abortController, cleanup } = this.createAbortController(lastUserMessage?.id)
|
const { abortController, cleanup } = this.createAbortController(lastUserMessage?.id)
|
||||||
const { signal } = abortController
|
const { signal } = abortController
|
||||||
|
|
||||||
|
|||||||
@ -925,18 +925,23 @@ export abstract class BaseOpenAiProvider extends BaseProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async summaryForSearch(messages: Message[], assistant: Assistant): Promise<string | null> {
|
public async summaryForSearch(messages: Message[], assistant: Assistant): Promise<string | null> {
|
||||||
const model = getTopNamingModel() || assistant.model || getDefaultModel()
|
const model = assistant.model || getDefaultModel()
|
||||||
|
|
||||||
const systemMessage: OpenAI.Responses.EasyInputMessage = {
|
const systemMessage: OpenAI.Responses.EasyInputMessage = {
|
||||||
role: 'system',
|
role: 'system',
|
||||||
content: assistant.prompt
|
content: assistant.prompt
|
||||||
}
|
}
|
||||||
|
|
||||||
const messageContents = messages.map((m) => getMainTextContent(m))
|
const messageContents = messages.map((m) => getMainTextContent(m))
|
||||||
const userMessageContent = messageContents.join('\n')
|
const userMessageContent = messageContents.join('\n')
|
||||||
|
|
||||||
const userMessage: OpenAI.Responses.EasyInputMessage = {
|
const userMessage: OpenAI.Responses.EasyInputMessage = {
|
||||||
role: 'user',
|
role: 'user',
|
||||||
content: userMessageContent
|
content: userMessageContent
|
||||||
}
|
}
|
||||||
|
|
||||||
const lastUserMessage = messages[messages.length - 1]
|
const lastUserMessage = messages[messages.length - 1]
|
||||||
|
|
||||||
const { abortController, cleanup } = this.createAbortController(lastUserMessage?.id)
|
const { abortController, cleanup } = this.createAbortController(lastUserMessage?.id)
|
||||||
const { signal } = abortController
|
const { signal } = abortController
|
||||||
|
|
||||||
|
|||||||
@ -1309,6 +1309,9 @@ const migrateConfig = {
|
|||||||
provider.type = 'openai-response'
|
provider.type = 'openai-response'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
state.assistants.assistants.forEach((assistant) => {
|
||||||
|
assistant.knowledgeRecognition = 'off'
|
||||||
|
})
|
||||||
return state
|
return state
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return state
|
return state
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user