feat: LLM_QUESTION_MARK_REQUIRED added as an optional gate for AI answer generation

This commit is contained in:
cra88y/pc
2026-03-29 20:57:37 -05:00
parent 4e567ce4e2
commit 76c77c997d
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -440,6 +440,7 @@ class SXNGPlugin(Plugin):
def _load_config(self):
self.interactive = os.getenv('LLM_INTERACTIVE', 'true').lower().strip() in ('true', '1', 'yes', 'on')
self.question_mark_required = os.getenv('LLM_QUESTION_MARK_REQUIRED', 'false').lower().strip() in ('true', '1', 'yes', 'on')
raw_provider = os.getenv('LLM_PROVIDER', '').lower().strip()
raw_url = os.getenv('LLM_URL', '').strip()
@@ -898,7 +899,10 @@ class SXNGPlugin(Plugin):
try:
if request and hasattr(request, 'headers') and request.headers.get('X-AI-Auxiliary'):
return results
if self.question_mark_required and '?' not in search.search_query.query:
return results
current_tabs = set(search.search_query.categories)
if not current_tabs: current_tabs = {'general'}