mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 10:40:07 +08:00
fix: OpenAIResponseProvider summaryForSearch impl model wrong
This commit is contained in:
parent
8214a70c38
commit
ff8224a2dc
@ -1011,6 +1011,7 @@ export default class OpenAIProvider extends BaseOpenAiProvider {
|
||||
}
|
||||
|
||||
const lastUserMessage = messages[messages.length - 1]
|
||||
|
||||
const { abortController, cleanup } = this.createAbortController(lastUserMessage?.id)
|
||||
const { signal } = abortController
|
||||
|
||||
|
||||
@ -925,18 +925,23 @@ export abstract class BaseOpenAiProvider extends BaseProvider {
|
||||
}
|
||||
|
||||
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 = {
|
||||
role: 'system',
|
||||
content: assistant.prompt
|
||||
}
|
||||
|
||||
const messageContents = messages.map((m) => getMainTextContent(m))
|
||||
const userMessageContent = messageContents.join('\n')
|
||||
|
||||
const userMessage: OpenAI.Responses.EasyInputMessage = {
|
||||
role: 'user',
|
||||
content: userMessageContent
|
||||
}
|
||||
|
||||
const lastUserMessage = messages[messages.length - 1]
|
||||
|
||||
const { abortController, cleanup } = this.createAbortController(lastUserMessage?.id)
|
||||
const { signal } = abortController
|
||||
|
||||
|
||||
@ -1309,6 +1309,9 @@ const migrateConfig = {
|
||||
provider.type = 'openai-response'
|
||||
}
|
||||
})
|
||||
state.assistants.assistants.forEach((assistant) => {
|
||||
assistant.knowledgeRecognition = 'off'
|
||||
})
|
||||
return state
|
||||
} catch (error) {
|
||||
return state
|
||||
|
||||
Loading…
Reference in New Issue
Block a user