Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -56,9 +56,10 @@ def get_motivational_quote():
|
|
| 56 |
return "Keep going! You're doing great."
|
| 57 |
|
| 58 |
def respond(message, history):
|
|
|
|
| 59 |
messages = [{
|
| 60 |
"role": "system",
|
| 61 |
-
"content": "You are a big sister chatbot named Nessie. You help people feel better in a simple manner. You need to be kind! please! Always reply in 3 sentences. Or if a list, 5 bullet points. Do NOT stop mid-sentence, even if more tokens are needed. When the user is asking for ideas give 5 max, as you don't want to overwhelm them"
|
| 62 |
}]
|
| 63 |
context = get_top_chunks(message)
|
| 64 |
if history:
|
|
@@ -66,6 +67,7 @@ def respond(message, history):
|
|
| 66 |
messages.append({"role": "user", "content": message})
|
| 67 |
|
| 68 |
user_context = f"{message}\nInformation: {context}"
|
|
|
|
| 69 |
messages.append({"role": "user", "content": user_context})
|
| 70 |
|
| 71 |
response = ""
|
|
|
|
| 56 |
return "Keep going! You're doing great."
|
| 57 |
|
| 58 |
def respond(message, history):
|
| 59 |
+
user_knowledge = get_top_chunks(message)
|
| 60 |
messages = [{
|
| 61 |
"role": "system",
|
| 62 |
+
"content": f"Get information from {user_knowledge}. You are a big sister chatbot named Nessie. You help people feel better in a simple manner. You need to be kind! please! Always reply in 3 sentences. Or if a list, 5 bullet points. Do NOT stop mid-sentence, even if more tokens are needed. When the user is asking for ideas give 5 max, as you don't want to overwhelm them"
|
| 63 |
}]
|
| 64 |
context = get_top_chunks(message)
|
| 65 |
if history:
|
|
|
|
| 67 |
messages.append({"role": "user", "content": message})
|
| 68 |
|
| 69 |
user_context = f"{message}\nInformation: {context}"
|
| 70 |
+
|
| 71 |
messages.append({"role": "user", "content": user_context})
|
| 72 |
|
| 73 |
response = ""
|