Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -291,9 +291,10 @@ def create_gradio_app():
|
|
291 |
padding: 15px;
|
292 |
margin: 10px 0;
|
293 |
}
|
294 |
-
#
|
295 |
-
|
296 |
-
|
|
|
297 |
"""
|
298 |
|
299 |
with gr.Blocks(css=css, title="π€ Creative Agentic AI Chat", theme=gr.themes.Soft()) as app:
|
@@ -307,38 +308,35 @@ def create_gradio_app():
|
|
307 |
""")
|
308 |
|
309 |
# NeuroScope AI Section
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
|
319 |
-
|
320 |
gr.Markdown("""
|
321 |
When **no domains are specified**, NeuroScope AI operates with unrestricted web search capabilities, allowing the compound models to autonomously search across the entire internet to find the most relevant and up-to-date information to answer your questions - essentially giving the AI complete freedom to use its agentic tools and search any website it deems helpful. When **domains are specified** (either include or exclude lists), you're essentially putting the AI on a leash - if you specify "include domains" like "arxiv.org, *.edu", the AI can ONLY search those academic sources, making it laser-focused on scholarly content, while "exclude domains" like "wikipedia.org, reddit.com" tells the AI to search everywhere EXCEPT those sites, filtering out potentially unreliable sources. The **π Custom System Prompt** feature allows you to completely override the AI's default personality and behavior - instead of the default creative assistant, you could make it act like a professional business consultant, a coding mentor, a creative writer, or even a specific character, essentially giving you the power to reshape the AI's entire conversational style and expertise focus with a single prompt change.
|
322 |
""")
|
323 |
|
324 |
# API Key Section
|
325 |
with gr.Row():
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
)
|
340 |
-
with gr.Column(scale=1):
|
341 |
-
connect_btn = gr.Button("π Connect", variant="primary", size="lg")
|
342 |
|
343 |
# Status display
|
344 |
status_display = gr.Markdown("### π Status: Not connected", elem_classes=["status-box"])
|
@@ -370,39 +368,38 @@ def create_gradio_app():
|
|
370 |
msg = gr.Textbox(
|
371 |
label="Your Message",
|
372 |
placeholder="Type your message here...",
|
373 |
-
lines=3
|
374 |
-
scale=4
|
375 |
)
|
376 |
-
with gr.Column(
|
377 |
send_btn = gr.Button("π€ Send", variant="primary")
|
378 |
clear_btn = gr.Button("ποΈ Clear", variant="secondary")
|
379 |
|
380 |
# Advanced Settings
|
381 |
with gr.Accordion("βοΈ Advanced Settings", open=False):
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
|
407 |
# Domain Filtering Section
|
408 |
with gr.Accordion("π Domain Filtering (for Web Search)", open=False):
|
@@ -432,22 +429,22 @@ def create_gradio_app():
|
|
432 |
)
|
433 |
|
434 |
with gr.Accordion("π Common Domain Examples", open=False):
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
|
452 |
# How to Use Section
|
453 |
with gr.Accordion("π How to Use This App", open=False):
|
|
|
291 |
padding: 15px;
|
292 |
margin: 10px 0;
|
293 |
}
|
294 |
+
#neuroscope-accordion {
|
295 |
+
background: linear-gradient(45deg, #26f1b5 0%, #307f3f 100%);
|
296 |
+
border-radius: 8px;
|
297 |
+
}
|
298 |
"""
|
299 |
|
300 |
with gr.Blocks(css=css, title="π€ Creative Agentic AI Chat", theme=gr.themes.Soft()) as app:
|
|
|
308 |
""")
|
309 |
|
310 |
# NeuroScope AI Section
|
311 |
+
with gr.Group():
|
312 |
+
with gr.Accordion("π€ NeuroScope AI", open=False, elem_id="neuroscope-accordion"):
|
313 |
+
gr.Markdown("""
|
314 |
+
- π§ Intelligence (Neuro)
|
315 |
+
- π Domain filtering (Scope)
|
316 |
+
- π€ AI capabilities (AI)
|
317 |
+
- β‘ Precision (Scope implies focused, targeted results)
|
318 |
+
""")
|
319 |
|
320 |
+
with gr.Accordion("π IMPORTANT !!!", open=False):
|
321 |
gr.Markdown("""
|
322 |
When **no domains are specified**, NeuroScope AI operates with unrestricted web search capabilities, allowing the compound models to autonomously search across the entire internet to find the most relevant and up-to-date information to answer your questions - essentially giving the AI complete freedom to use its agentic tools and search any website it deems helpful. When **domains are specified** (either include or exclude lists), you're essentially putting the AI on a leash - if you specify "include domains" like "arxiv.org, *.edu", the AI can ONLY search those academic sources, making it laser-focused on scholarly content, while "exclude domains" like "wikipedia.org, reddit.com" tells the AI to search everywhere EXCEPT those sites, filtering out potentially unreliable sources. The **π Custom System Prompt** feature allows you to completely override the AI's default personality and behavior - instead of the default creative assistant, you could make it act like a professional business consultant, a coding mentor, a creative writer, or even a specific character, essentially giving you the power to reshape the AI's entire conversational style and expertise focus with a single prompt change.
|
323 |
""")
|
324 |
|
325 |
# API Key Section
|
326 |
with gr.Row():
|
327 |
+
api_key = gr.Textbox(
|
328 |
+
label="π Groq API Key",
|
329 |
+
placeholder="Enter your Groq API key here...",
|
330 |
+
type="password",
|
331 |
+
info="Get your API key from: https://console.groq.com/"
|
332 |
+
)
|
333 |
+
model_selection = gr.Radio(
|
334 |
+
choices=["compound-beta", "compound-beta-mini"],
|
335 |
+
label="π§ Model Selection",
|
336 |
+
value="compound-beta",
|
337 |
+
info="compound-beta: More powerful | compound-beta-mini: Faster"
|
338 |
+
)
|
339 |
+
connect_btn = gr.Button("π Connect", variant="primary", size="lg")
|
|
|
|
|
|
|
340 |
|
341 |
# Status display
|
342 |
status_display = gr.Markdown("### π Status: Not connected", elem_classes=["status-box"])
|
|
|
368 |
msg = gr.Textbox(
|
369 |
label="Your Message",
|
370 |
placeholder="Type your message here...",
|
371 |
+
lines=3
|
|
|
372 |
)
|
373 |
+
with gr.Column():
|
374 |
send_btn = gr.Button("π€ Send", variant="primary")
|
375 |
clear_btn = gr.Button("ποΈ Clear", variant="secondary")
|
376 |
|
377 |
# Advanced Settings
|
378 |
with gr.Accordion("βοΈ Advanced Settings", open=False):
|
379 |
+
with gr.Row():
|
380 |
+
temperature = gr.Slider(
|
381 |
+
minimum=0.0,
|
382 |
+
maximum=2.0,
|
383 |
+
value=0.7,
|
384 |
+
step=0.1,
|
385 |
+
label="π‘οΈ Temperature",
|
386 |
+
info="Higher = more creative, Lower = more focused"
|
387 |
+
)
|
388 |
+
max_tokens = gr.Slider(
|
389 |
+
minimum=100,
|
390 |
+
maximum=4000,
|
391 |
+
value=1024,
|
392 |
+
step=100,
|
393 |
+
label="π Max Tokens",
|
394 |
+
info="Maximum length of response"
|
395 |
+
)
|
396 |
|
397 |
+
system_prompt = gr.Textbox(
|
398 |
+
label="π Custom System Prompt",
|
399 |
+
placeholder="Override the default system prompt...",
|
400 |
+
lines=2,
|
401 |
+
info="Leave empty to use default creative assistant prompt"
|
402 |
+
)
|
403 |
|
404 |
# Domain Filtering Section
|
405 |
with gr.Accordion("π Domain Filtering (for Web Search)", open=False):
|
|
|
429 |
)
|
430 |
|
431 |
with gr.Accordion("π Common Domain Examples", open=False):
|
432 |
+
gr.Markdown("""
|
433 |
+
**Academic & Research:**
|
434 |
+
- arxiv.org, *.edu, scholar.google.com, researchgate.net
|
435 |
+
|
436 |
+
**Technology & Programming:**
|
437 |
+
- github.com, stackoverflow.com, docs.python.org, developer.mozilla.org
|
438 |
+
|
439 |
+
**News & Media:**
|
440 |
+
- reuters.com, bbc.com, npr.org, apnews.com
|
441 |
+
|
442 |
+
**Business & Finance:**
|
443 |
+
- bloomberg.com, wsj.com, nasdaq.com, sec.gov
|
444 |
+
|
445 |
+
**Science & Medicine:**
|
446 |
+
- nature.com, science.org, pubmed.ncbi.nlm.nih.gov, who.int
|
447 |
+
""")
|
448 |
|
449 |
# How to Use Section
|
450 |
with gr.Accordion("π How to Use This App", open=False):
|