@saber2pr/ai-agent 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/core/agent-chain.js +3 -3
- package/package.json +1 -1
package/lib/core/agent-chain.js
CHANGED
|
@@ -54,9 +54,9 @@ class McpChainAgent {
|
|
|
54
54
|
this.extraTools = [];
|
|
55
55
|
this.runningTokenCounter = 0;
|
|
56
56
|
this.extraTools = (options === null || options === void 0 ? void 0 : options.tools) || [];
|
|
57
|
-
this.maxTokens = (options === null || options === void 0 ? void 0 : options.maxTokens) ||
|
|
57
|
+
this.maxTokens = (options === null || options === void 0 ? void 0 : options.maxTokens) || 8000;
|
|
58
58
|
this.apiConfig = options === null || options === void 0 ? void 0 : options.apiConfig;
|
|
59
|
-
this.maxIterations = (options === null || options === void 0 ? void 0 : options.maxIterations) ||
|
|
59
|
+
this.maxIterations = (options === null || options === void 0 ? void 0 : options.maxIterations) || 50;
|
|
60
60
|
this.apiModel = options === null || options === void 0 ? void 0 : options.apiModel;
|
|
61
61
|
this.verbose = (options === null || options === void 0 ? void 0 : options.verbose) || false;
|
|
62
62
|
const baseSystemPrompt = `你是一个专业的代码架构师。
|
|
@@ -114,7 +114,7 @@ class McpChainAgent {
|
|
|
114
114
|
// maxTokenLimit 决定了当对话历史超过多少 Token 时触发“自动总结”
|
|
115
115
|
this.memory = new memory_1.ConversationSummaryBufferMemory({
|
|
116
116
|
llm: model,
|
|
117
|
-
maxTokenLimit:
|
|
117
|
+
maxTokenLimit: this.maxTokens,
|
|
118
118
|
memoryKey: "chat_history",
|
|
119
119
|
returnMessages: true,
|
|
120
120
|
// 必须添加下面这两行显式声明:
|