mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-28 05:11:24 +08:00
parent
5d34e49c57
commit
d1e19aad51
@ -104,9 +104,9 @@ async function fetchExternalTool(
|
||||
const showListTools = enabledMCPs && enabledMCPs.length > 0
|
||||
|
||||
// 是否使用工具
|
||||
const hasAnyTool = shouldWebSearch || shouldKnowledgeSearch || shouldSearchMemory || showListTools
|
||||
const hasAnyTool = shouldWebSearch || shouldKnowledgeSearch || showListTools
|
||||
|
||||
// 在工具链开始时发送进度通知
|
||||
// 在工具链开始时发送进度通知(不包括记忆搜索)
|
||||
if (hasAnyTool) {
|
||||
onChunkReceived({ type: ChunkType.EXTERNEL_TOOL_IN_PROGRESS })
|
||||
}
|
||||
@ -456,8 +456,6 @@ export async function fetchChatCompletion({
|
||||
const { mcpTools } = await fetchExternalTool(lastUserMessage, assistant, onChunkReceived, lastAnswer)
|
||||
const model = assistant.model || getDefaultModel()
|
||||
|
||||
onChunkReceived({ type: ChunkType.LLM_RESPONSE_CREATED })
|
||||
|
||||
const { maxTokens, contextCount } = getAssistantSettings(assistant)
|
||||
|
||||
const filteredMessages2 = filterUsefulMessages(filteredMessages1)
|
||||
@ -488,7 +486,7 @@ export async function fetchChatCompletion({
|
||||
isGenerateImageModel(model) && (isSupportedDisableGenerationModel(model) ? assistant.enableGenerateImage : true)
|
||||
|
||||
// --- Call AI Completions ---
|
||||
|
||||
onChunkReceived({ type: ChunkType.LLM_RESPONSE_CREATED })
|
||||
const completionsParams: CompletionsParams = {
|
||||
callType: 'chat',
|
||||
messages: _messages,
|
||||
|
||||
@ -40,6 +40,7 @@ export const createCitationCallbacks = (deps: CitationCallbacksDependencies) =>
|
||||
status: MessageBlockStatus.SUCCESS
|
||||
}
|
||||
blockManager.smartBlockUpdate(citationBlockId, changes, MessageBlockType.CITATION, true)
|
||||
citationBlockId = null
|
||||
} else {
|
||||
logger.error('[onExternalToolComplete] citationBlockId is null. Cannot update.')
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user