shukdevdatta123 commited on
Commit
b3c83bc
Β·
verified Β·
1 Parent(s): ccb73a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +67 -70
app.py CHANGED
@@ -291,9 +291,10 @@ def create_gradio_app():
291
  padding: 15px;
292
  margin: 10px 0;
293
  }
294
- # #neuroscope-accordion .gr-accordion {
295
- # background: linear-gradient(45deg, #26f1b5 0%, #307f3f 100%)
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
- # with gr.Group(elem_id="neuroscope-accordion"):
311
- with gr.Accordion("πŸ€– NeuroScope AI", open=False):
312
- gr.Markdown("""
313
- - 🧠 Intelligence (Neuro)
314
- - πŸ” Domain filtering (Scope)
315
- - πŸ€– AI capabilities (AI)
316
- - ⚑ Precision (Scope implies focused, targeted results)
317
- """)
318
 
319
- with gr.Accordion("πŸ“š IMPORTANT !!!", open=False):
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
- with gr.Column(scale=3):
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
- with gr.Column(scale=2):
334
- model_selection = gr.Radio(
335
- choices=["compound-beta", "compound-beta-mini"],
336
- label="🧠 Model Selection",
337
- value="compound-beta",
338
- info="compound-beta: More powerful | compound-beta-mini: Faster"
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(scale=1):
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
- with gr.Row():
383
- temperature = gr.Slider(
384
- minimum=0.0,
385
- maximum=2.0,
386
- value=0.7,
387
- step=0.1,
388
- label="🌑️ Temperature",
389
- info="Higher = more creative, Lower = more focused"
390
- )
391
- max_tokens = gr.Slider(
392
- minimum=100,
393
- maximum=4000,
394
- value=1024,
395
- step=100,
396
- label="πŸ“ Max Tokens",
397
- info="Maximum length of response"
398
- )
399
 
400
- system_prompt = gr.Textbox(
401
- label="🎭 Custom System Prompt",
402
- placeholder="Override the default system prompt...",
403
- lines=2,
404
- info="Leave empty to use default creative assistant prompt"
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
- gr.Markdown("""
436
- **Academic & Research:**
437
- - arxiv.org, *.edu, scholar.google.com, researchgate.net
438
-
439
- **Technology & Programming:**
440
- - github.com, stackoverflow.com, docs.python.org, developer.mozilla.org
441
-
442
- **News & Media:**
443
- - reuters.com, bbc.com, npr.org, apnews.com
444
-
445
- **Business & Finance:**
446
- - bloomberg.com, wsj.com, nasdaq.com, sec.gov
447
-
448
- **Science & Medicine:**
449
- - nature.com, science.org, pubmed.ncbi.nlm.nih.gov, who.int
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):