feat: Add support for enabled MCPs in message sending

This commit is contained in:
kangfenmao 2025-03-09 10:49:28 +08:00
parent 2fc7c4b5c7
commit aa33f0242a
3 changed files with 6 additions and 1 deletions

View File

@ -158,7 +158,7 @@ const Inputbar: FC<Props> = ({ assistant: _assistant, setActiveTopic }) => {
} catch (error) {
console.error('Failed to send message:', error)
}
}, [inputEmpty, text, assistant, files, selectedKnowledgeBases, mentionModels, dispatch])
}, [inputEmpty, files, dispatch, text, assistant, selectedKnowledgeBases, mentionModels, enabledMCPs])
const translate = async () => {
if (isTranslating) {

View File

@ -80,6 +80,7 @@ export async function fetchChatCompletion({
}
const allMCPTools = await window.api.mcp.listTools()
await AI.completions({
messages: filterUsefulMessages(messages),
assistant,

View File

@ -245,6 +245,10 @@ export const sendMessage =
if (options?.mentionModels) {
userMessage.mentions = options.mentionModels
}
if (options?.enabledMCPs) {
userMessage.enabledMCPs = options.enabledMCPs
}
}
// 如果不是重发,才添加新的用户消息