Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -39,9 +39,9 @@ def predict(prompt):
|
|
39 |
)
|
40 |
|
41 |
response = chat_session.send_message(f"{prompt}\n antworte immer auf deutsch")
|
42 |
-
response_data = json.loads(response)
|
43 |
# Extrahiere den Textwert
|
44 |
-
text_value =
|
45 |
# Entferne die Markdown-Formatierung (optional)
|
46 |
text_value = text_value.strip('```json\n').strip('```')
|
47 |
return text_value
|
|
|
39 |
)
|
40 |
|
41 |
response = chat_session.send_message(f"{prompt}\n antworte immer auf deutsch")
|
42 |
+
#response_data = json.loads(response)
|
43 |
# Extrahiere den Textwert
|
44 |
+
text_value = response['candidates'][0]['content']['parts'][0]['text']
|
45 |
# Entferne die Markdown-Formatierung (optional)
|
46 |
text_value = text_value.strip('```json\n').strip('```')
|
47 |
return text_value
|