Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,16 +57,16 @@ def generate_from_gemini(prompt: str) -> str:
|
|
| 57 |
)
|
| 58 |
]
|
| 59 |
config = types.GenerateContentConfig(response_mime_type="text/plain")
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
model=model,
|
| 64 |
contents=contents,
|
| 65 |
config=config,
|
| 66 |
-
)
|
| 67 |
-
|
| 68 |
-
return
|
| 69 |
-
|
| 70 |
@app.route('/')
|
| 71 |
def index():
|
| 72 |
return render_template_string(HTML)
|
|
|
|
| 57 |
)
|
| 58 |
]
|
| 59 |
config = types.GenerateContentConfig(response_mime_type="text/plain")
|
| 60 |
+
|
| 61 |
+
# Synchronous, non-streaming call:
|
| 62 |
+
response = client.models.generate_content(
|
| 63 |
model=model,
|
| 64 |
contents=contents,
|
| 65 |
config=config,
|
| 66 |
+
)
|
| 67 |
+
# The full text is in response.text
|
| 68 |
+
return response.text
|
| 69 |
+
|
| 70 |
@app.route('/')
|
| 71 |
def index():
|
| 72 |
return render_template_string(HTML)
|