Nymbo commited on
Commit
5ca3b99
·
verified ·
1 Parent(s): cbbdf68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -412,7 +412,7 @@ def Search_Concise( # <-- MCP tool #4 (Concise DDG)
412
 
413
  # --- Fetch tab (compact controllable extraction) ---
414
  fetch_interface = gr.Interface(
415
- fn=extract_relevant, # (layman) connect the function to the UI
416
  inputs=[
417
  gr.Textbox(label="URL", placeholder="https://example.com/article"),
418
  gr.Dropdown(label="Verbosity", choices=["Brief", "Standard", "Full"], value="Standard"),
@@ -431,7 +431,7 @@ fetch_interface = gr.Interface(
431
 
432
  # --- Websearch tab (structured DDG via LangChain) ---
433
  websearch_interface = gr.Interface(
434
- fn=web_search, # (layman) connect the function to the UI
435
  inputs=[
436
  gr.Textbox(value="", label="Search query", placeholder="site:example.com interesting topic"),
437
  gr.Slider(minimum=1, maximum=20, value=5, step=1, label="Max results"),
@@ -445,7 +445,7 @@ websearch_interface = gr.Interface(
445
 
446
  # --- Unstructured DDG tab (matches your separate app’s output) ---
447
  unstructured_interface = gr.Interface(
448
- fn=ddg_unstructured,
449
  inputs=gr.Textbox(label="Enter Search Query"),
450
  outputs=gr.Textbox(label="Results", interactive=False),
451
  title="DuckDuckGo Search (Raw)",
@@ -457,7 +457,7 @@ unstructured_interface = gr.Interface(
457
 
458
  # --- Concise DDG tab (JSONL with short keys, minimal tokens) ---
459
  concise_interface = gr.Interface(
460
- fn=ddg_concise,
461
  inputs=[
462
  gr.Textbox(label="Query", placeholder="topic OR site:example.com"),
463
  gr.Slider(minimum=1, maximum=20, value=5, step=1, label="Max results"),
@@ -484,4 +484,4 @@ demo = gr.TabbedInterface(
484
 
485
  # Launch the UI and expose all functions as MCP tools in one server
486
  if __name__ == "__main__":
487
- demo.launch(mcp_server=True)
 
412
 
413
  # --- Fetch tab (compact controllable extraction) ---
414
  fetch_interface = gr.Interface(
415
+ fn=Fetch_Webpage, # (layman) connect the function to the UI
416
  inputs=[
417
  gr.Textbox(label="URL", placeholder="https://example.com/article"),
418
  gr.Dropdown(label="Verbosity", choices=["Brief", "Standard", "Full"], value="Standard"),
 
431
 
432
  # --- Websearch tab (structured DDG via LangChain) ---
433
  websearch_interface = gr.Interface(
434
+ fn=Search_Structured, # (layman) connect the function to the UI
435
  inputs=[
436
  gr.Textbox(value="", label="Search query", placeholder="site:example.com interesting topic"),
437
  gr.Slider(minimum=1, maximum=20, value=5, step=1, label="Max results"),
 
445
 
446
  # --- Unstructured DDG tab (matches your separate app’s output) ---
447
  unstructured_interface = gr.Interface(
448
+ fn=Search_Raw,
449
  inputs=gr.Textbox(label="Enter Search Query"),
450
  outputs=gr.Textbox(label="Results", interactive=False),
451
  title="DuckDuckGo Search (Raw)",
 
457
 
458
  # --- Concise DDG tab (JSONL with short keys, minimal tokens) ---
459
  concise_interface = gr.Interface(
460
+ fn=Search_Concise,
461
  inputs=[
462
  gr.Textbox(label="Query", placeholder="topic OR site:example.com"),
463
  gr.Slider(minimum=1, maximum=20, value=5, step=1, label="Max results"),
 
484
 
485
  # Launch the UI and expose all functions as MCP tools in one server
486
  if __name__ == "__main__":
487
+ demo.launch(mcp_server=True)