artintel235 commited on
Commit
d958f42
·
verified ·
1 Parent(s): c57b527

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -44,8 +44,12 @@ async def generate_command(
44
  genai.configure(api_key=GEMINI_API_KEY)
45
  model = genai.GenerativeModel("gemini-2.0-flash-exp")
46
  response = model.generate_content(prompt, stream=True)
 
 
 
47
  for part in response:
48
- await interaction.followup.send(content=part.text)
 
49
  except Exception as e:
50
  print(e)
51
 
 
44
  genai.configure(api_key=GEMINI_API_KEY)
45
  model = genai.GenerativeModel("gemini-2.0-flash-exp")
46
  response = model.generate_content(prompt, stream=True)
47
+ initial_message = await interaction.followup.send(content="...")
48
+ full_text = ""
49
+
50
  for part in response:
51
+ full_text += part.text
52
+ await initial_message.edit(content=full_text)
53
  except Exception as e:
54
  print(e)
55