Skip to content

Commit 96ccf44

Browse files
committed
Update AI Assist UI and improve LLM plugin prompts
Replaces the AI Assistant label with a custom SVG icon and 'Search Assist' in the UI, and adds enhanced Markdown styling for rendered content. Updates the LLM plugin to use a lower temperature (0.5) for more focused responses and refines the system prompt to emphasize extractive summarization and concise, well-formatted Markdown output. Also adds new documentation media files.
1 parent a752bd4 commit 96ccf44

File tree

4 files changed

+57
-4
lines changed

4 files changed

+57
-4
lines changed

docs/search_llm_assist.png

188 KB
Loading

docs/videos/seaxng_ai_assist.mp4

4.98 MB
Binary file not shown.

python/searxng-addons/search_answers_llm/llm_answer.html

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
<div class="assist-header">
44
<div class="assist-title">
55
<span>
6-
🤖 AI Assistant
6+
<svg width="20" height="20" viewBox="0 0 640 640" fill="currentColor" xmlns="http://www.w3.org/2000/svg"
7+
style="margin-right: 8px; vertical-align: text-bottom;">
8+
<path
9+
d="M112 120C112 106.7 101.3 96 88 96C74.7 96 64 106.7 64 120L64 464C64 508.2 99.8 544 144 544L552 544C565.3 544 576 533.3 576 520C576 506.7 565.3 496 552 496L144 496C126.3 496 112 481.7 112 464L112 120zM216 192L424 192C437.3 192 448 181.3 448 168C448 154.7 437.3 144 424 144L216 144C202.7 144 192 154.7 192 168C192 181.3 202.7 192 216 192zM216 256C202.7 256 192 266.7 192 280C192 293.3 202.7 304 216 304L360 304C373.3 304 384 293.3 384 280C384 266.7 373.3 256 360 256L216 256zM216 368C202.7 368 192 378.7 192 392C192 405.3 202.7 416 216 416L488 416C501.3 416 512 405.3 512 392C512 378.7 501.3 368 488 368L216 368z" />
10+
</svg>
11+
Search Assist
712
<small class="context-badge"></small>
813
</span>
914
</div>
@@ -145,10 +150,58 @@ <h2>About this Answer</h2>
145150
}
146151

147152
.assist-content {
148-
line-height: 1.6;
153+
line-height: 1.5;
149154
padding-bottom: 8px;
150155
}
151156

157+
/* Markdown Rendered Content */
158+
.assist-content h1,
159+
.assist-content h2,
160+
.assist-content h3,
161+
.assist-content h4,
162+
.assist-content h5,
163+
.assist-content h6 {
164+
margin-top: 0.6em;
165+
margin-bottom: 0.4em;
166+
line-height: 1.2;
167+
font-weight: 600;
168+
}
169+
170+
.assist-content p {
171+
margin-block-start: 0.5em;
172+
margin-block-end: 0.5em;
173+
}
174+
175+
.assist-content ul,
176+
.assist-content ol {
177+
margin-block-start: 0.5em;
178+
margin-block-end: 0.5em;
179+
padding-inline-start: 30px;
180+
}
181+
182+
.assist-content li {
183+
margin-bottom: 0.3em;
184+
}
185+
186+
.assist-content pre {
187+
margin-block-start: 0.8em;
188+
margin-block-end: 0.8em;
189+
}
190+
191+
.assist-content code {
192+
font-size: 0.9em;
193+
padding: 0.1em 0.3em;
194+
border-radius: 4px;
195+
background-color: #2b2d31;
196+
}
197+
198+
.assist-content pre code {
199+
display: block;
200+
padding: 0.8em;
201+
border-radius: 6px;
202+
background-color: #1e1e1e;
203+
}
204+
152205
/* Toggle Button */
153206
.assist-toggle-container {
154207
text-align: center;

python/searxng-addons/search_answers_llm/plugins_langchain_llm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def __init__(self, plg_cfg: "PluginCfg") -> None:
8686
# Initialize ChatOpenAI once and reuse
8787
self.llm = ChatOpenAI(
8888
model=self.model_name,
89-
temperature=0.7,
89+
temperature=0.5,
9090
base_url=environ.get(
9191
"LLM_BASE_URL",
9292
"https://generativelanguage.googleapis.com/v1beta/openai/",
@@ -253,9 +253,9 @@ def _generate_contextual_answer_html(
253253
messages = [
254254
SystemMessage(
255255
content="""You are a helpful Search Engine assistant that provides accurate answers and sources based on search results.
256+
Use extractive summarization to identify key information from search results and avoid fillers.
256257
Identify the most important information and links from the search results.
257258
Format your response using Markdown syntax for better readability.
258-
Warn against potential malicious links when encounterd.
259259
Keep the response concise but well-formatted in Markdown."""
260260
),
261261
HumanMessage(

0 commit comments

Comments
 (0)