调整了agent

This commit is contained in:
lik
2026-10-28 11:15:29 +08:00
parent b8f53d3660
commit c4f6be6494
29 changed files with 703 additions and 921 deletions
+20 -7
View File
@@ -1,6 +1,6 @@
import { TavilySearch } from "@langchain/tavily";
import { tool } from "@langchain/core/tools";
import * as z from "zod"
import { z } from "zod";
import config from "../../../../config.js";
const webSearchTool = tool(
@@ -19,16 +19,29 @@ const webSearchTool = tool(
return await tavilySearch._call({ query });
},
{
name: "internet_search",
description: "Run a web search",
name: "web_search",
description:
"联网搜索公开网页信息,返回摘要与链接。适合查询医院公示、就医政策、停诊/号源公告等时效性信息。",
schema: z.object({
query: z.string().describe("The search query"),
maxResults: z.number().optional().default(5),
query: z.string().describe("搜索关键词或问题"),
maxResults: z
.number()
.int()
.min(1)
.max(10)
.optional()
.default(5)
.describe("返回结果数量(1-10),默认 5"),
topic: z
.enum(["general", "news", "finance"])
.optional()
.default("general"),
includeRawContent: z.boolean().optional().default(false),
.default("general")
.describe("搜索主题,政策/新闻类查询建议用 news"),
includeRawContent: z
.boolean()
.optional()
.default(false)
.describe("是否返回网页原文(内容较长,默认关闭)"),
}),
},
);