From 93d263cdc39a80dcb9aac2ebd73b923226fb90ae Mon Sep 17 00:00:00 2001 From: tyler Date: Tue, 19 May 2026 02:56:01 -0400 Subject: [PATCH] Cleaning up code --- ollama_answers.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/ollama_answers.py b/ollama_answers.py index 457d24e..22d4f27 100644 --- a/ollama_answers.py +++ b/ollama_answers.py @@ -1,12 +1,11 @@ -import json, os, logging, base64, time, hashlib, re, http.client, ssl, concurrent.futures, threading, math +import json, os, logging, time, hashlib, re, http.client, ssl, concurrent.futures, threading, math from collections import Counter from urllib.parse import urlparse -from searx import network try: from searx.network import get_network except ImportError: get_network = None -from flask import Response, request, abort, jsonify +from flask import request, abort, jsonify from searx.plugins import Plugin, PluginInfo from searx.result_types import EngineResults from searx import settings @@ -24,7 +23,6 @@ except ImportError: logger.warning("AI Answers: valkey package not found. Streaming via Valkey unavailable.") TOKEN_EXPIRY_SEC = 3600 -STREAM_CHUNK_SIZE = 512 STREAM_TIMEOUT_SEC = 60 CONV_TTL = 1800 @@ -670,7 +668,6 @@ INTERACTIVE_JS = r''' } }); box.style.display = 'block'; - if(wrapper) wrapper.style.display = ''; if(footer && is_interactive) footer.style.display = 'flex'; restored = true; } @@ -855,7 +852,6 @@ FRONTEND_JS_TEMPLATE = r""" const conversation = { originalQuery: q_init, originalContext: new TextDecoder().decode(Uint8Array.from(atob(b64_init), c => c.charCodeAt(0))), - originalSources: [...urls], turns: [{role: 'user', content: q_init, ts: Date.now()}] }; const box = document.getElementById('sxng-stream-box'); @@ -889,10 +885,6 @@ FRONTEND_JS_TEMPLATE = r""" }); }); - // Also apply to document root so our CSS vars cascade - Object.entries(theme).forEach(([k, v]) => { - if (v) box.style.setProperty(k, v); - }); } catch(e) {} })();