Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -214,7 +214,7 @@ def search_synthetize(query: str, k: int = 5) -> List[int]:
|
|
| 214 |
"""
|
| 215 |
Search within a PDF document for the most relevant pages to answer a query and synthetizes a short grounded answer using only those pages.
|
| 216 |
MCP tool description:
|
| 217 |
-
- name:
|
| 218 |
- description: Search within a PDF document for the most relevant pages to answer a query and synthetizes a short grounded answer using only those pages.
|
| 219 |
- input_schema:
|
| 220 |
type: object
|
|
@@ -626,11 +626,14 @@ def build_ui():
|
|
| 626 |
query_box = gr.Textbox(placeholder="Enter your question…", label="Query", lines=4)
|
| 627 |
k_slider = gr.Slider(minimum=1, maximum=10, step=1, label="Number of results (k)", value=5)
|
| 628 |
search_button = gr.Button("🔍 Search", variant="primary")
|
|
|
|
| 629 |
|
| 630 |
with gr.Column(scale=2):
|
| 631 |
-
|
|
|
|
| 632 |
|
| 633 |
-
search_button.click(search, inputs=[query_box, k_slider], outputs=[
|
|
|
|
| 634 |
|
| 635 |
# ---- Tab 3: Agent (Streaming)
|
| 636 |
with gr.Tab("3) Deep Search"):
|
|
|
|
| 214 |
"""
|
| 215 |
Search within a PDF document for the most relevant pages to answer a query and synthetizes a short grounded answer using only those pages.
|
| 216 |
MCP tool description:
|
| 217 |
+
- name: mcp_test_search_synthetize
|
| 218 |
- description: Search within a PDF document for the most relevant pages to answer a query and synthetizes a short grounded answer using only those pages.
|
| 219 |
- input_schema:
|
| 220 |
type: object
|
|
|
|
| 626 |
query_box = gr.Textbox(placeholder="Enter your question…", label="Query", lines=4)
|
| 627 |
k_slider = gr.Slider(minimum=1, maximum=10, step=1, label="Number of results (k)", value=5)
|
| 628 |
search_button = gr.Button("🔍 Search", variant="primary")
|
| 629 |
+
search_synthetize_button = gr.Button("🔍 Search & Synthetize", variant="primary")
|
| 630 |
|
| 631 |
with gr.Column(scale=2):
|
| 632 |
+
output_docs = gr.Textbox(label="Indices (0-based)", lines=1, placeholder="[0, 1, 2, ...]")
|
| 633 |
+
output_text = gr.Textbox(label="ColQwen+GPT-5 Answer", lines=12, placeholder="...")
|
| 634 |
|
| 635 |
+
search_button.click(search, inputs=[query_box, k_slider], outputs=[output_docs])
|
| 636 |
+
search_synthetize_button.click(search_synthetize, inputs=[query_box, k_slider], outputs=[output_text])
|
| 637 |
|
| 638 |
# ---- Tab 3: Agent (Streaming)
|
| 639 |
with gr.Tab("3) Deep Search"):
|