searxng config radio, todos cleanup

frdel committed Jun 17, 2025 at 22:12 UTC 602d60cc8f8952eb372afdc8f75df067046e14b8
4 files changed +11 -64
docker/run/fs/etc/searxng/settings.yml
+9 -2
@@ -1,6 +1,11 @@
1 # SearXNG settings
2
3 -use_default_settings: true
3 +use_default_settings:
4 + engines:
5 + remove:
6 + - radio browser
7 +# TODO enable radio_browser when it works again
8 +# currently it crashes on x86 on gethostbyaddr
9
10 general:
11 debug: false
@@ -58,8 +63,10 @@ enabled_plugins:
63 # - '(.*\.)?wikipedia.org$'
64
65 engines:
61 - - name: radio_browser
66 + - name: radio browser
67 + engine: radio_browser
68 disabled: true
69 + inactive: true
70 # TODO enable radio_browser when it works again
71 # currently it crashes on x86 on gethostbyaddr
72
python/helpers/document_query.py
+1 -1
@@ -100,7 +100,7 @@ class DocumentQueryStore:
100
101 elif scheme in ["http", "https"]:
102 # Always use https for web URLs
103 - normalized = normalized.replace("http://", "https://") # TODO why?
103 + normalized = normalized.replace("http://", "https://")
104
105 return normalized
106
python/helpers/rag.py deleted
-60
@@ -1,60 +0,0 @@
1 -from typing import List
2 -
3 -from langchain_core.documents import Document
4 -from python.helpers import files
5 -
6 -from langchain_community.document_loaders import (
7 - CSVLoader,
8 - JSONLoader,
9 - PyPDFLoader,
10 - TextLoader,
11 - UnstructuredHTMLLoader,
12 - UnstructuredMarkdownLoader,
13 -)
14 -
15 -# def extract_file(path: str) -> List[Document]:
16 -# pass # TODO finish implementing
17 -
18 -def extract_text(content: bytes, chunk_size: int = 128) -> List[str]:
19 - result = []
20 -
21 - def is_binary_chunk(chunk: bytes) -> bool:
22 - # Check for high concentration of control chars
23 - try:
24 - text = chunk.decode("utf-8", errors="ignore")
25 - control_chars = sum(1 for c in text if ord(c) < 32 and c not in "\n\r\t")
26 - return control_chars / len(text) > 0.3
27 - except UnicodeDecodeError:
28 - return True
29 -
30 - # Process the content in overlapping chunks to handle boundaries
31 - pos = 0
32 - while pos < len(content):
33 - # Get current chunk with overlap
34 - chunk_end = min(pos + chunk_size, len(content))
35 -
36 - # Add overlap to catch word boundaries, unless at end of content
37 - if chunk_end < len(content):
38 - # Look ahead for next newline or space to avoid splitting words
39 - for i in range(chunk_end, min(chunk_end + 100, len(content))):
40 - if content[i : i + 1] in [b" ", b"\n", b"\r"]:
41 - chunk_end = i + 1
42 - break
43 -
44 - chunk = content[pos:chunk_end]
45 -
46 - if is_binary_chunk(chunk):
47 - if not result or result[-1] != "[BINARY]":
48 - result.append("[BINARY]")
49 - else:
50 - try:
51 - text = chunk.decode("utf-8", errors="ignore").strip()
52 - if text: # Only add non-empty text chunks
53 - result.append(text)
54 - except UnicodeDecodeError:
55 - if not result or result[-1] != "[BINARY]":
56 - result.append("[BINARY]")
57 -
58 - pos = chunk_end
59 -
60 - return result
python/tools/scheduler.py
+1 -1
@@ -183,7 +183,7 @@ class SchedulerTool(Tool):
183 await TaskScheduler.get().add_task(task)
184 return Response(message=f"Adhoc task '{name}' created: {task.uuid}", break_loop=False)
185
186 - async def create_planned_task(self, **kwargs) -> Response: # TODO: Implement
186 + async def create_planned_task(self, **kwargs) -> Response:
187 name: str = kwargs.get("name", None)
188 system_prompt: str = kwargs.get("system_prompt", None)
189 prompt: str = kwargs.get("prompt", None)