atlasbot: merge global metric facts into selection
This commit is contained in:
parent
f5e928fa59
commit
9cb591e469
@ -361,6 +361,17 @@ class AnswerEngine:
|
||||
)
|
||||
metric_facts: list[str] = []
|
||||
if classify.get("question_type") in {"metric", "diagnostic"} or force_metric:
|
||||
global_metric_facts: list[str] = []
|
||||
if global_facts:
|
||||
global_metric_facts = await _select_fact_lines(
|
||||
call_llm,
|
||||
normalized,
|
||||
global_facts,
|
||||
plan,
|
||||
max_lines=min(2, max(1, plan.max_subquestions)),
|
||||
)
|
||||
if global_metric_facts:
|
||||
key_facts = _merge_fact_lines(global_metric_facts, key_facts)
|
||||
all_tokens = _merge_tokens(signal_tokens, keyword_tokens, question_tokens)
|
||||
if plan.use_deep_retrieval:
|
||||
if observer:
|
||||
@ -445,6 +456,8 @@ class AnswerEngine:
|
||||
metric_facts = _merge_fact_lines([best_line], metric_facts)
|
||||
if metric_facts:
|
||||
key_facts = _merge_fact_lines(metric_facts, key_facts)
|
||||
if global_metric_facts:
|
||||
metric_facts = _merge_fact_lines(global_metric_facts, metric_facts)
|
||||
if (classify.get("question_type") in {"metric", "diagnostic"} or force_metric) and not metric_facts and key_facts:
|
||||
metric_facts = key_facts
|
||||
if key_facts:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user