feat: 支持 ChatSession 级别插件功能开关

This commit is contained in:
Hk-Gosuto
2023-08-12 00:53:15 +08:00
parent 6b28bcd9b5
commit fb1b92e9cc
6 changed files with 27 additions and 54 deletions

View File

@@ -200,20 +200,12 @@ async function handle(req: NextRequest) {
presencePenalty: reqBody.presence_penalty,
frequencyPenalty: reqBody.frequency_penalty,
});
let executor = await initializeAgentExecutorWithOptions(tools, llm, {
agentType: "chat-conversational-react-description",
const executor = await initializeAgentExecutorWithOptions(tools, llm, {
agentType: "openai-functions",
returnIntermediateSteps: true,
maxIterations: 3,
memory: memory,
});
if (reqBody.model.endsWith("0613"))
executor = await initializeAgentExecutorWithOptions(tools, llm, {
agentType: "openai-functions",
returnIntermediateSteps: true,
maxIterations: 3,
memory: memory,
});
executor.call(
{