denizd commited on
Commit
ed40569
·
verified ·
1 Parent(s): 0156830

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -45,8 +45,9 @@ def get_top_chunks(query):
45
 
46
  def chatbot_response(message, history):
47
  top_chunks = get_top_chunks(message)
48
- numbered_response = "\n".join([f"{i+1}. {chunk}" for i, chunk in enumerate(top_chunks)])
49
- return [{"responder": "chatbot", "content": numbered_response}]
 
50
 
51
  chatbot = gr.ChatInterface(fn=chatbot_response, title="RAG Chatbot")
52
  chatbot.launch()
 
45
 
46
  def chatbot_response(message, history):
47
  top_chunks = get_top_chunks(message)
48
+ intro = "Hi! I'm a Rochester food assistant. I can help you find places to eat near the University of Rochester.\n\n"
49
+ formatted = "\n".join([f"- {chunk}" for chunk in top_chunks])
50
+ return [{"responder": "chatbot", "content": intro + formatted}]
51
 
52
  chatbot = gr.ChatInterface(fn=chatbot_response, title="RAG Chatbot")
53
  chatbot.launch()