feat: Agnes上下文512K→1M + Ollama支持配置num_ctx
Agnes AI: - adapter注释和API文档更新: 上下文512K→1M (官方已升级) Ollama num_ctx 支持: - MetonaGenerationParams 新增 contextLength 字段 - OllamaAdapter.toNativeRequest 发送 options.num_ctx - AgentLoopEngine 从 config 读取并传递到请求参数 - database.service 新增 ollama.numCtx 默认配置(null=由模型决定) - SettingsModal LLM设置: Ollama 选中时显示上下文长度输入框 - main.ts 启动时从 configService 读取 ollama.numCtx 数据流: Settings → configService → main.ts → AgentLoopEngine.config → MetonaRequest.params → OllamaAdapter → options.num_ctx
This commit is contained in:
+5
-1
@@ -147,7 +147,11 @@ async function initialize(): Promise<void> {
|
||||
];
|
||||
|
||||
// ===== Agent Loop =====
|
||||
const agentLoop = new AgentLoopEngine({}, adapter, toolRegistry, preToolHooks, postToolHooks);
|
||||
const ollamaNumCtx = configService.get<number>('ollama.numCtx');
|
||||
const agentLoop = new AgentLoopEngine(
|
||||
{ contextLength: ollamaNumCtx ?? undefined },
|
||||
adapter, toolRegistry, preToolHooks, postToolHooks,
|
||||
);
|
||||
agentLoop.setTools(toolRegistry.listTools());
|
||||
agentLoop.setWorkspacePath(workspaceInfo.path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user