sabssag commited on
Commit
b2c0bfa
1 Parent(s): 08af185

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -10,8 +10,8 @@ chat = model.start_chat(history=[])
10
 
11
  def get_gemini_response(prompt):
12
  try:
13
- response = chat.send_message(prompt, stream=True)
14
- return response
15
  except Exception as e:
16
  return f"An error occurred: {str(e)}"
17
 
 
10
 
11
  def get_gemini_response(prompt):
12
  try:
13
+ chunks = [chunk.text for chunk in chat.send_message(prompt, stream=True)] # Collect response chunks
14
+ return " ".join(chunks) # Combine all chunks into a single string
15
  except Exception as e:
16
  return f"An error occurred: {str(e)}"
17