diff --git a/README.md b/README.md index 6f1de21..67435ab 100644 --- a/README.md +++ b/README.md @@ -136,9 +136,9 @@ enableFavorabilitySystem: true # 好感度每日基础偏移速度(点/天) favorabilityBaseShiftSpeed: 2.0 # 聊天记录搜索最大天数 -searchHistoryMaxDays: 7 +searchHistoryMaxDays: 30 # 聊天记录搜索最大查询条数,防止内存溢出 -searchHistoryMaxRecords: 500 +searchHistoryMaxRecords: 5000 ``` ## 系统提示词 diff --git a/src/main/kotlin/PluginConfig.kt b/src/main/kotlin/PluginConfig.kt index 628cf78..b1408a4 100644 --- a/src/main/kotlin/PluginConfig.kt +++ b/src/main/kotlin/PluginConfig.kt @@ -133,8 +133,8 @@ object PluginConfig : AutoSavePluginConfig("Config") { val maxToolOutputLength: Int by value(15000) @ValueDescription("聊天记录搜索最大天数") - val searchHistoryMaxDays: Int by value(7) + val searchHistoryMaxDays: Int by value(30) @ValueDescription("聊天记录搜索最大查询条数,防止内存溢出") - val searchHistoryMaxRecords: Int by value(500) + val searchHistoryMaxRecords: Int by value(5000) } \ No newline at end of file diff --git a/src/main/kotlin/tools/SearchChatHistory.kt b/src/main/kotlin/tools/SearchChatHistory.kt index 154d5c1..dd34243 100644 --- a/src/main/kotlin/tools/SearchChatHistory.kt +++ b/src/main/kotlin/tools/SearchChatHistory.kt @@ -25,8 +25,8 @@ import java.time.format.DateTimeParseException class SearchChatHistory : BaseAgent( tool = Tool.function( name = "searchChatHistory", - description = "搜索群聊消息历史,可按关键词、发送者、时间范围筛选。用于回溯之前的讨论、查找某人说过的话等。" + - "不指定时间范围时默认搜索最近7天。指定时间时范围不能超过7天,如需更长跨度可分多次查询。" + + description = "搜索群聊消息历史,可按关键词、发送者、时间范围筛选。用于回溯之前的讨论、查找某人说过的话、统计话题等。" + + "不指定时间范围时默认搜索最近30天。指定时间时范围不能超过30天,如需更长跨度可分多次查询。" + "可以通过多轮搜索来实现找到某条消息的上下文。", parameters = Parameters.buildJsonObject { put("type", "object") @@ -49,7 +49,7 @@ class SearchChatHistory : BaseAgent( } putJsonObject("limit") { put("type", "integer") - put("description", "返回消息数量上限,默认20,最大50") + put("description", "返回消息数量上限,默认20,最大200") } } } @@ -121,7 +121,7 @@ class SearchChatHistory : BaseAgent( return "未找到匹配的聊天记录" } - val limit = args["limit"]?.jsonPrimitive?.intOrNull?.coerceIn(1, 50) ?: 20 + val limit = args["limit"]?.jsonPrimitive?.intOrNull?.coerceIn(1, 200) ?: 20 val total = filtered.size val result = filtered.takeLast(limit)