feat: Add support for enabled MCPs in message sending
This commit is contained in:
parent
2fc7c4b5c7
commit
aa33f0242a
@ -158,7 +158,7 @@ const Inputbar: FC<Props> = ({ assistant: _assistant, setActiveTopic }) => {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to send message:', 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 () => {
|
const translate = async () => {
|
||||||
if (isTranslating) {
|
if (isTranslating) {
|
||||||
|
|||||||
@ -80,6 +80,7 @@ export async function fetchChatCompletion({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const allMCPTools = await window.api.mcp.listTools()
|
const allMCPTools = await window.api.mcp.listTools()
|
||||||
|
|
||||||
await AI.completions({
|
await AI.completions({
|
||||||
messages: filterUsefulMessages(messages),
|
messages: filterUsefulMessages(messages),
|
||||||
assistant,
|
assistant,
|
||||||
|
|||||||
@ -245,6 +245,10 @@ export const sendMessage =
|
|||||||
if (options?.mentionModels) {
|
if (options?.mentionModels) {
|
||||||
userMessage.mentions = options.mentionModels
|
userMessage.mentions = options.mentionModels
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (options?.enabledMCPs) {
|
||||||
|
userMessage.enabledMCPs = options.enabledMCPs
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果不是重发,才添加新的用户消息
|
// 如果不是重发,才添加新的用户消息
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user