Spaces:
Paused
Paused
Shreyas094
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -396,7 +396,7 @@ def summarize_web_results(query: str, search_results: List[Dict[str, str]], conv
|
|
396 |
return f"An error occurred during summarization: {str(e)}"
|
397 |
|
398 |
# Modify the existing respond function to handle both PDF and web search
|
399 |
-
def respond(message, history, model, temperature, num_calls,
|
400 |
logging.info(f"User Query: {message}")
|
401 |
logging.info(f"Model Used: {model}")
|
402 |
logging.info(f"Selected Documents: {selected_docs}")
|
@@ -659,8 +659,8 @@ demo = gr.ChatInterface(
|
|
659 |
gr.Dropdown(choices=MODELS, label="Select Model", value=MODELS[3]),
|
660 |
gr.Slider(minimum=0.1, maximum=1.0, value=0.2, step=0.1, label="Temperature"),
|
661 |
gr.Slider(minimum=1, maximum=5, value=1, step=1, label="Number of API Calls"),
|
662 |
-
gr.
|
663 |
-
gr.
|
664 |
],
|
665 |
title="AI-powered PDF Chat and Web Search Assistant",
|
666 |
description="Chat with your PDFs or use web search to answer questions.",
|
|
|
396 |
return f"An error occurred during summarization: {str(e)}"
|
397 |
|
398 |
# Modify the existing respond function to handle both PDF and web search
|
399 |
+
def respond(message, history, model, temperature, num_calls, use_web_search, selected_docs):
|
400 |
logging.info(f"User Query: {message}")
|
401 |
logging.info(f"Model Used: {model}")
|
402 |
logging.info(f"Selected Documents: {selected_docs}")
|
|
|
659 |
gr.Dropdown(choices=MODELS, label="Select Model", value=MODELS[3]),
|
660 |
gr.Slider(minimum=0.1, maximum=1.0, value=0.2, step=0.1, label="Temperature"),
|
661 |
gr.Slider(minimum=1, maximum=5, value=1, step=1, label="Number of API Calls"),
|
662 |
+
gr.Checkbox(label="Use Web Search", value=True),
|
663 |
+
gr.CheckboxGroup(label="Select documents to query")
|
664 |
],
|
665 |
title="AI-powered PDF Chat and Web Search Assistant",
|
666 |
description="Chat with your PDFs or use web search to answer questions.",
|