优化了agent

This commit is contained in:
lik
2026-10-31 18:51:20 +08:00
parent ab584c5fa8
commit 02d57f82dc
22 changed files with 193 additions and 155 deletions
+6 -14
View File
@@ -1,5 +1,6 @@
import { tool } from "langchain"
import lunarLib from "lunar-javascript"
import { tool } from "@langchain/core/tools";
import { z } from "zod";
import lunarLib from "lunar-javascript";
const { Solar, HolidayUtil } = lunarLib
/**
@@ -36,17 +37,8 @@ export const getYearHolidaysTool = tool(
{
name: "get_year_holidays",
description: "查询给定年份节日所在日期列表,包括法定节假日安排(含调休)与传统节日",
schema: {
type: "object",
properties: {
year: {
type: "number",
description: "年份",
minimum: 1900,
maximum: 2100
}
},
required: ["year"]
}
schema: z.object({
year: z.number().int().min(1900).max(2100).describe("年份")
})
}
)