Spaces:
Sleeping
Sleeping
Update app.py
Browse files28 unmodified lines293031323334353637383940414228 unmodified linesreturn top_chunksdef chatbot_response(message, history):try:top_chunks = get_top_chunks(message)numbered_response = "\n".join([f"{i+1}. {chunk}" for i, chunk in enumerate(top_chunks)])except Exception as e:numbered_response = f"Sorry, something went wrong: {e}"history = history or []history.append((message, numbered_response))return numbered_response, historychatbot = gr.ChatInterface(fn=chatbot_response, title="RAG Chatbot")chatbot.launch()28 unmodified lines29303132333435363728 unmodified linesreturn top_chunksdef chatbot_response(message, history):top_chunks = get_top_chunks(message)numbered_response = "\n".join([f"{i+1}. {chunk}" for i, chunk in enumerate(top_chunks)])return [{"role": "assistant", "content": numbered_response}]chatbot = gr.ChatInterface(fn=chatbot_response, title="RAG Chatbot")chatbot.launch()
app.py+3-8