Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,7 @@ groq_client = Groq(api_key="gsk_87XueMvzwc9sjnLah5r9WGdyb3FYy7ZlnLCfEyaNuWYL1DZd
|
|
| 20 |
chat_history = [
|
| 21 |
{
|
| 22 |
"role": "system",
|
| 23 |
-
"content": "You are a helpful AI assistant that only responds in plain text.
|
| 24 |
}
|
| 25 |
]
|
| 26 |
|
|
@@ -42,7 +42,6 @@ def get_groq_response(user_input):
|
|
| 42 |
# Extract and store the AI's response
|
| 43 |
ai_response = chat_completion.choices[0].message.content
|
| 44 |
chat_history.append({"role": "assistant", "content": ai_response})
|
| 45 |
-
|
| 46 |
return ai_response
|
| 47 |
|
| 48 |
except Exception as e:
|
|
@@ -55,7 +54,7 @@ def clear_history():
|
|
| 55 |
chat_history = [
|
| 56 |
{
|
| 57 |
"role": "system",
|
| 58 |
-
"content": "You are a helpful AI assistant that only responds in plain text.
|
| 59 |
}
|
| 60 |
]
|
| 61 |
return "Chat history cleared!"
|
|
|
|
| 20 |
chat_history = [
|
| 21 |
{
|
| 22 |
"role": "system",
|
| 23 |
+
"content": "You are a helpful AI assistant that only responds in plain text. Also, you are on scratch. like ur literally an api on scratch.mit.edu. Please be as kind as you can and make sure all code works before sharing. Thanks!"
|
| 24 |
}
|
| 25 |
]
|
| 26 |
|
|
|
|
| 42 |
# Extract and store the AI's response
|
| 43 |
ai_response = chat_completion.choices[0].message.content
|
| 44 |
chat_history.append({"role": "assistant", "content": ai_response})
|
|
|
|
| 45 |
return ai_response
|
| 46 |
|
| 47 |
except Exception as e:
|
|
|
|
| 54 |
chat_history = [
|
| 55 |
{
|
| 56 |
"role": "system",
|
| 57 |
+
"content": "You are a helpful AI assistant that only responds in plain text. Also, you are on scratch. like ur literally an api on scratch.mit.edu. Please be as kind as you can and make sure all code works before sharing. Thanks!"
|
| 58 |
}
|
| 59 |
]
|
| 60 |
return "Chat history cleared!"
|