fix: use_web=True bypasses L0 early return so web search always runs
Browse files
acra.py
CHANGED
|
@@ -116,7 +116,8 @@ async def query_pipeline(query, namespace, top_k, rerank, user_id, use_web=False
|
|
| 116 |
# L0: always retrieve first — give Gemma the context and let it decide
|
| 117 |
# whether to use it or answer from its own knowledge. This prevents
|
| 118 |
# hallucination when the answer exists in the user docs.
|
| 119 |
-
|
|
|
|
| 120 |
hits = vsearch(query, namespace, user_id, 2)
|
| 121 |
if hits:
|
| 122 |
ctx = "\n\n---\n\n".join(h["content"] for h in hits)
|
|
|
|
| 116 |
# L0: always retrieve first — give Gemma the context and let it decide
|
| 117 |
# whether to use it or answer from its own knowledge. This prevents
|
| 118 |
# hallucination when the answer exists in the user docs.
|
| 119 |
+
# If use_web=True, skip L0 early return so web search runs instead.
|
| 120 |
+
if level == 0 and not use_web:
|
| 121 |
hits = vsearch(query, namespace, user_id, 2)
|
| 122 |
if hits:
|
| 123 |
ctx = "\n\n---\n\n".join(h["content"] for h in hits)
|