Skip to content

Commit a7accdb

Browse files
committed
feat: web logic
1 parent 61d0f24 commit a7accdb

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

agentic_rag/gradio_app.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,19 +365,26 @@ def create_interface():
365365
repo_button = gr.Button("Process Repository")
366366
repo_output = gr.Textbox(label="Repository Processing Output")
367367

368+
# Define collection choices once to ensure consistency
369+
collection_choices = [
370+
"PDF Collection",
371+
"Repository Collection",
372+
"Web Knowledge Base",
373+
"General Knowledge"
374+
]
375+
368376
with gr.Tab("Standard Chat Interface"):
369377
with gr.Row():
370378
with gr.Column(scale=1):
371-
# Create model choices with quantization options
372379
standard_agent_dropdown = gr.Dropdown(
373380
choices=model_choices,
374381
value=model_choices[0] if model_choices else None,
375382
label="Select Agent"
376383
)
377384
with gr.Column(scale=1):
378385
standard_collection_dropdown = gr.Dropdown(
379-
choices=["PDF Collection", "Repository Collection", "Web Knowledge Base", "General Knowledge"],
380-
value="PDF Collection",
386+
choices=collection_choices,
387+
value=collection_choices[0],
381388
label="Select Knowledge Base",
382389
info="Choose which knowledge base to use for answering questions"
383390
)
@@ -386,7 +393,7 @@ def create_interface():
386393
> - This interface ALWAYS uses the selected collection without performing query analysis.
387394
> - "PDF Collection": Will ALWAYS search the PDF documents regardless of query type.
388395
> - "Repository Collection": Will ALWAYS search the repository code regardless of query type.
389-
> - "Web Knowledge Base": Will ALWAYS search the web content regardless of query type.
396+
> - "Web Knowledge Base": Will ALWAYS search web content regardless of query type.
390397
> - "General Knowledge": Will ALWAYS use the model's built-in knowledge without searching collections.
391398
""")
392399
standard_chatbot = gr.Chatbot(height=400)
@@ -398,16 +405,15 @@ def create_interface():
398405
with gr.Tab("Chain of Thought Chat Interface"):
399406
with gr.Row():
400407
with gr.Column(scale=1):
401-
# Create model choices with quantization options
402408
cot_agent_dropdown = gr.Dropdown(
403409
choices=model_choices,
404410
value=model_choices[0] if model_choices else None,
405411
label="Select Agent"
406412
)
407413
with gr.Column(scale=1):
408414
cot_collection_dropdown = gr.Dropdown(
409-
choices=["PDF Collection", "Repository Collection", "Web Knowledge Base", "General Knowledge"],
410-
value="PDF Collection",
415+
choices=collection_choices,
416+
value=collection_choices[0],
411417
label="Select Knowledge Base",
412418
info="Choose which knowledge base to use for answering questions"
413419
)
@@ -416,7 +422,7 @@ def create_interface():
416422
> - When a specific collection is selected, the system will ALWAYS use that collection without analysis:
417423
> - "PDF Collection": Will ALWAYS search the PDF documents.
418424
> - "Repository Collection": Will ALWAYS search the repository code.
419-
> - "Web Knowledge Base": Will ALWAYS search the web content.
425+
> - "Web Knowledge Base": Will ALWAYS search web content.
420426
> - "General Knowledge": Will ALWAYS use the model's built-in knowledge.
421427
> - This interface shows step-by-step reasoning and may perform query analysis when needed.
422428
""")

0 commit comments

Comments
 (0)