refactor: optimize core engine and retrieval logic for v2.80.43
This commit is contained in:
+16
-1
@@ -45,6 +45,19 @@ export interface IAgentConfig {
|
||||
maxAutoContinuations: number;
|
||||
/** 모델이 내부 사고만 출력하고 답변이 없으면 "최종 답변만" 지시로 1회 재생성. */
|
||||
finalOnlyRetryOnThoughtLeak: boolean;
|
||||
// ─── Hybrid Semantic Search ───
|
||||
/**
|
||||
* Embedding model name as registered in LM Studio / Ollama. Empty disables
|
||||
* semantic search and the retriever falls back to TF-IDF only. The user
|
||||
* must load this model in the engine before enabling it here.
|
||||
*/
|
||||
embeddingModel: string;
|
||||
/**
|
||||
* Blend between TF-IDF (sparse) and embedding cosine (dense) scoring.
|
||||
* 0 = TF-IDF only (status quo), 1 = embedding only.
|
||||
* Default 0.5 = equal weight, a reasonable starting point.
|
||||
*/
|
||||
embeddingBlendAlpha: number;
|
||||
}
|
||||
|
||||
// ─── 경로 정규화 유틸리티 ───
|
||||
@@ -125,7 +138,9 @@ export function getConfig(): IAgentConfig {
|
||||
smallModelContextCap: Math.max(0, cfg.get<number>('smallModelContextCap', 0)),
|
||||
autoContinueOnOutputLimit: cfg.get<boolean>('autoContinueOnOutputLimit', true),
|
||||
maxAutoContinuations: Math.max(0, Math.min(10, cfg.get<number>('maxAutoContinuations', 4))),
|
||||
finalOnlyRetryOnThoughtLeak: cfg.get<boolean>('finalOnlyRetryOnThoughtLeak', true)
|
||||
finalOnlyRetryOnThoughtLeak: cfg.get<boolean>('finalOnlyRetryOnThoughtLeak', true),
|
||||
embeddingModel: (cfg.get<string>('embeddingModel', '') || '').trim(),
|
||||
embeddingBlendAlpha: Math.max(0, Math.min(1, cfg.get<number>('embeddingBlendAlpha', 0.5))),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user