mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-24 06:30:16 +09:00
fix(73): fix bug
This commit is contained in:
parent
73fd388007
commit
a9f2a9d963
@ -116,7 +116,7 @@ export class AgentApi {
|
||||
},
|
||||
async handleAgentAction(action) {
|
||||
try {
|
||||
console.log("[handleAgentAction]", action.tool);
|
||||
// console.log("[handleAgentAction]", action.tool);
|
||||
if (!reqBody.returnIntermediateSteps) return;
|
||||
var response = new ResponseBody();
|
||||
response.isToolMessage = true;
|
||||
@ -139,13 +139,13 @@ export class AgentApi {
|
||||
}
|
||||
},
|
||||
handleToolStart(tool, input) {
|
||||
console.log("[handleToolStart]", { tool });
|
||||
// console.log("[handleToolStart]", { tool });
|
||||
},
|
||||
async handleToolEnd(output, runId, parentRunId, tags) {
|
||||
console.log("[handleToolEnd]", { output, runId, parentRunId, tags });
|
||||
// console.log("[handleToolEnd]", { output, runId, parentRunId, tags });
|
||||
},
|
||||
handleAgentEnd(action, runId, parentRunId, tags) {
|
||||
console.log("[handleAgentEnd]");
|
||||
// console.log("[handleAgentEnd]");
|
||||
},
|
||||
});
|
||||
}
|
||||
@ -178,17 +178,7 @@ export class AgentApi {
|
||||
reqBody: RequestBody,
|
||||
customTools: any[],
|
||||
) {
|
||||
if (req.method === "OPTIONS") {
|
||||
return NextResponse.json({ body: "OK" }, { status: 200 });
|
||||
}
|
||||
try {
|
||||
const authResult = auth(req);
|
||||
if (authResult.error) {
|
||||
return NextResponse.json(authResult, {
|
||||
status: 401,
|
||||
});
|
||||
}
|
||||
|
||||
const serverConfig = getServerSideConfig();
|
||||
|
||||
// const reqBody: RequestBody = await req.json();
|
||||
@ -249,7 +239,7 @@ export class AgentApi {
|
||||
const tools = [];
|
||||
|
||||
if (useTools.includes("web-search")) tools.push(searchTool);
|
||||
console.log(customTools);
|
||||
// console.log(customTools);
|
||||
|
||||
customTools.forEach((customTool) => {
|
||||
if (customTool) {
|
||||
|
@ -2,7 +2,6 @@ import { NextRequest, NextResponse } from "next/server";
|
||||
import { AgentApi, RequestBody, ResponseBody } from "../agentapi";
|
||||
import { auth } from "@/app/api/auth";
|
||||
import { EdgeTool } from "../../../../langchain-tools/edge_tools";
|
||||
import { getServerSideConfig } from "@/app/config/server";
|
||||
import { OpenAI } from "langchain/llms/openai";
|
||||
import { OpenAIEmbeddings } from "langchain/embeddings/openai";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user