Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -183,9 +183,12 @@ class GeminiPromptGenerator:
|
|
183 |
DO NOT include words like 'prompt' or 'description' in the response."""
|
184 |
|
185 |
try:
|
186 |
-
response = self.
|
187 |
-
|
188 |
-
|
|
|
|
|
|
|
189 |
else:
|
190 |
return "Sorry, I couldn't generate a creative prompt. Please try again."
|
191 |
except Exception as e:
|
|
|
183 |
DO NOT include words like 'prompt' or 'description' in the response."""
|
184 |
|
185 |
try:
|
186 |
+
response = self.client.chat.completions.create(
|
187 |
+
messages=[{"role": "user", "content": system_prompt}],
|
188 |
+
**self.model
|
189 |
+
)
|
190 |
+
if response.choices[0].message.content:
|
191 |
+
return response.choices[0].message.content.strip()
|
192 |
else:
|
193 |
return "Sorry, I couldn't generate a creative prompt. Please try again."
|
194 |
except Exception as e:
|