Update app.py
Browse files179 unmodified lines18018118218318318418518644 unmodified lines23123223323423423523623723823924 unmodified lines264265266265267268269270271272273272274275276277179 unmodified lines if search_engine == "Google": search_results = google_search(message) else: search_results = duckduckgo_search(message) search_results = duckduckgo_search(message, max_results=5)
# Check if we have a FAISS database if os.path.exists("faiss_database"):44 unmodified lines sources_section = "\n\nSources:\n" + "\n".join(f"- {source}" for source in sources) response += sources_section
return response # Update history and return history.append((message, response)) return history
# Gradio interfacedemo = gr.Blocks()24 unmodified lines respond, inputs=[ message_input, chatbot, gr.State([]), # Initialize empty history temperature, top_p, repetition_penalty, max_tokens, search_engine ], outputs=chatbot outputs=[chatbot] ) clear_button = gr.Button("Clear Cache")app.py+6-4