Spaces:
Sleeping
Sleeping
Lennox Kanyoe Kahati commited on
Commit ·
5459d87
1
Parent(s): 32a5df8
Fix ChatGroq invocation syntax (use .invoke instead of callable)
Browse files
app.py
CHANGED
|
@@ -1034,7 +1034,7 @@ def generate_trivia():
|
|
| 1034 |
if not prompt:
|
| 1035 |
return jsonify({'success': False, 'error': 'No prompt provided'}), 400
|
| 1036 |
|
| 1037 |
-
response = chat_model([HumanMessage(content=prompt)])
|
| 1038 |
return jsonify({'success': True, 'response': response.content})
|
| 1039 |
except Exception as e:
|
| 1040 |
return jsonify({'success': False, 'error': str(e)}), 500
|
|
|
|
| 1034 |
if not prompt:
|
| 1035 |
return jsonify({'success': False, 'error': 'No prompt provided'}), 400
|
| 1036 |
|
| 1037 |
+
response = chat_model.invoke([HumanMessage(content=prompt)])
|
| 1038 |
return jsonify({'success': True, 'response': response.content})
|
| 1039 |
except Exception as e:
|
| 1040 |
return jsonify({'success': False, 'error': str(e)}), 500
|