调整了agent
This commit is contained in:
@@ -7,17 +7,15 @@ import config from '../../../config.js';
|
||||
import logger from '../../../utils/logger.js';
|
||||
import { createRestrictedBackend } from "../../infra/restricted_fs_backend.js";
|
||||
|
||||
// 密钥由 conf.json 统一提供;百度地图 skill 通过 env_get 读环境变量,此处桥接
|
||||
// 密钥由 conf.json 统一提供;百度地图 token 由 http_get 按域名在服务端注入
|
||||
process.env.TAVILY_API_KEY ??= config.agent.tavily?.apiKey;
|
||||
process.env.BAIDU_MAP_AUTH_TOKEN ??= config.agent.baiduMap?.authToken;
|
||||
import EscortAdminPrompts from "./prompts.js";
|
||||
import { createPatientRecordSubagent } from "../../subagent/patient_record.js";
|
||||
import { createResearchSubagent } from "../../subagent/research.js";
|
||||
import { createHospitalInfoSubagent } from "../../subagent/hospital_info.js";
|
||||
import {
|
||||
getEnvTool, webFetchTool, webSearchTool, getCalendarInfoTool,
|
||||
getLunarCalendarInfoTool, getYearHolidaysTool, getYearTermsTool, getLatLngTool,
|
||||
httpGetTool, httpPostTool, escortRecordQueryTool, escortRecordSetTool
|
||||
webFetchTool, webSearchTool, getCalendarInfoTool, getYearHolidaysTool,
|
||||
httpGetTool, escortRecordQueryTool, escortRecordSetTool
|
||||
} from "../../infra/tools/index.js";
|
||||
|
||||
export default class EscortAdminAgent {
|
||||
@@ -138,11 +136,6 @@ export default class EscortAdminAgent {
|
||||
apiKey: config.agent.deepseek.apiKey,
|
||||
temperature: 0.0
|
||||
});
|
||||
this.proModel = new ChatDeepSeek({
|
||||
model: config.agent.deepseek.proModel,
|
||||
apiKey: config.agent.deepseek.apiKey,
|
||||
temperature: 0.3
|
||||
});
|
||||
|
||||
return createDeepAgent({
|
||||
name: "deep-agent",
|
||||
@@ -150,10 +143,10 @@ export default class EscortAdminAgent {
|
||||
systemPrompt: EscortAdminPrompts.buildSystemPrompt(userInfo),
|
||||
backend,
|
||||
middleware: [todoListMiddleware()], // deepagents 1.12 起 todo 计划工具改为显式开启,多步记录操作用
|
||||
tools: [getEnvTool, webFetchTool, webSearchTool, getLatLngTool, httpGetTool, httpPostTool,
|
||||
getCalendarInfoTool, getLunarCalendarInfoTool, getYearHolidaysTool, getYearTermsTool,
|
||||
tools: [webFetchTool, webSearchTool, httpGetTool,
|
||||
getCalendarInfoTool, getYearHolidaysTool,
|
||||
escortRecordQueryTool, escortRecordSetTool],
|
||||
subagents: [createPatientRecordSubagent(this.flashModel), createResearchSubagent(this.proModel), createHospitalInfoSubagent(this.flashModel)]
|
||||
subagents: [createPatientRecordSubagent(this.flashModel), createHospitalInfoSubagent(this.flashModel, { allowWrite: true })]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,16 +9,15 @@ import { ChatDeepSeek } from "@langchain/deepseek";
|
||||
import config from '../../../config.js';
|
||||
import logger from '../../../utils/logger.js';
|
||||
|
||||
// 密钥由 conf.json 统一提供;百度地图 skill 通过 env_get 读环境变量,此处桥接
|
||||
// 密钥由 conf.json 统一提供;百度地图 token 由 http_get 按域名在服务端注入
|
||||
process.env.TAVILY_API_KEY ??= config.agent.tavily?.apiKey;
|
||||
process.env.BAIDU_MAP_AUTH_TOKEN ??= config.agent.baiduMap?.authToken;
|
||||
import Prompts from "./prompts.js";
|
||||
import { createRestrictedBackend } from "../../infra/restricted_fs_backend.js";
|
||||
import { createHospitalInfoSubagent } from "../../subagent/hospital_info.js";
|
||||
import {
|
||||
getEnvTool, webFetchTool, webSearchTool, getCalendarInfoTool,
|
||||
getLunarCalendarInfoTool, getYearHolidaysTool, getYearTermsTool, getLatLngTool,
|
||||
httpGetTool, httpPostTool, createEscortRecordQueryTool
|
||||
webFetchTool, webSearchTool, getCalendarInfoTool, getYearHolidaysTool,
|
||||
httpGetTool, createEscortRecordQueryTool
|
||||
} from "../../infra/tools/index.js";
|
||||
|
||||
export default class EscortAgent {
|
||||
@@ -188,8 +187,8 @@ export default class EscortAgent {
|
||||
systemPrompt: Prompts.buildSystemPrompt(userInfo),
|
||||
memory: ["./agent/bots/bot-escort/AGENTS.md"],
|
||||
backend,
|
||||
tools: [getEnvTool, webFetchTool, webSearchTool, getLatLngTool, httpGetTool, httpPostTool,
|
||||
getCalendarInfoTool, getLunarCalendarInfoTool, getYearHolidaysTool, getYearTermsTool,
|
||||
tools: [webFetchTool, webSearchTool, httpGetTool,
|
||||
getCalendarInfoTool, getYearHolidaysTool,
|
||||
createEscortRecordQueryTool(userInfo)],
|
||||
subagents: [createHospitalInfoSubagent(this.flashModel)],
|
||||
skills: ["./agent/infra/skills/"],
|
||||
|
||||
Reference in New Issue
Block a user