feat: 支持session级别插件开关

This commit is contained in:
Hk-Gosuto
2023-08-11 17:55:50 +08:00
parent 987598f30d
commit 6b28bcd9b5
7 changed files with 117 additions and 102 deletions

View File

@@ -61,7 +61,7 @@ export interface ChatSession {
clearContextIndex?: number;
mask: Mask;
useTools: boolean;
usePlugins: boolean;
}
export const DEFAULT_TOPIC = Locale.Store.DefaultTopic;
@@ -85,7 +85,7 @@ function createEmptySession(): ChatSession {
lastSummarizeIndex: 0,
mask: createEmptyMask(),
useTools: true,
usePlugins: true,
};
}
@@ -317,7 +317,7 @@ export const useChatStore = create<ChatStore>()(
session.messages.push(botMessage);
});
if (session.useTools && modelConfig.model.endsWith("0613")) {
if (session.usePlugins) {
console.log("[ToolAgent] start");
api.llm.toolAgentChat({
messages: sendMessages,