fix(agent): 放宽出诊清单输出与历史工具结果保留长度
输出上限支持按端配置并放宽到 escort 3000 / admin 5000;医院与网页类工具结果入历史保留 3000 字,数据库类维持 300 字,避免出诊信息被截断或追问时丢失。
This commit is contained in:
@@ -8,7 +8,7 @@ import logger from '../../../utils/logger.js';
|
||||
import { createRestrictedBackend } from "../../infra/restricted_fs_backend.js";
|
||||
import { appendToolMessage, trimHistory } from "../../infra/history.js";
|
||||
import { describeToolResult, describeStreamPayload } from "../../infra/tool_log.js";
|
||||
import { OutputGuard, OUTPUT_MAX_CHARS } from "../../infra/guard.js";
|
||||
import { OutputGuard, OUTPUT_MAX_CHARS, resolveOutputMaxChars } from "../../infra/guard.js";
|
||||
|
||||
// 密钥由 conf.json 统一提供;百度地图 token 由 http_get 按域名在服务端注入
|
||||
process.env.TAVILY_API_KEY ??= config.agent.tavily?.apiKey;
|
||||
@@ -37,8 +37,10 @@ export default class EscortAdminAgent {
|
||||
this.temperature = options.temperature ?? 0.0;
|
||||
// 历史消息字符数上限(管理端多步工具调用更易堆积上下文)
|
||||
this.maxHistoryChars = options.maxHistoryChars || config.agent.maxHistoryChars || 40000;
|
||||
// 单条回复字符上限:管理端要列记录,比咨询侧留更大余量
|
||||
this.maxOutputChars = options.maxOutputChars || config.agent.maxOutputChars || OUTPUT_MAX_CHARS.admin;
|
||||
// 单条回复字符上限:管理端要转述记录与医院清单,默认值需能完整输出一次排班列表;
|
||||
// 可在 conf.json agent.maxOutputChars 调整
|
||||
this.maxOutputChars = options.maxOutputChars
|
||||
|| resolveOutputMaxChars(config.agent.maxOutputChars, "admin", OUTPUT_MAX_CHARS.admin);
|
||||
}
|
||||
|
||||
clearMessages(userInfo) {
|
||||
|
||||
Reference in New Issue
Block a user