Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
|
|
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 |
|