Refine fast path logic in router by enabling early exit for web search and cleaning up text processing
This commit is contained in:
@@ -121,7 +121,6 @@ def _fast_path(
|
||||
if vision:
|
||||
return _workflow_result(vision, confidence=1.0, reason="The request includes attachments.")
|
||||
|
||||
lowered = text.lower()
|
||||
mentions_knowledge = bool(_KNOWLEDGE_RE.search(text))
|
||||
|
||||
if _REMEMBER_RE.search(text):
|
||||
@@ -129,6 +128,9 @@ def _fast_path(
|
||||
if remember:
|
||||
return _workflow_result(remember, confidence=1.0, reason="The user explicitly asked Heimgeist to remember or save this.")
|
||||
|
||||
if web_search_enabled:
|
||||
return None
|
||||
|
||||
if library_slug and mentions_knowledge:
|
||||
knowledge = _manifest_by_slug(manifests, "knowledge-answer")
|
||||
if knowledge:
|
||||
|
||||
Reference in New Issue
Block a user