Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,12 +40,13 @@ if prompt := st.chat_input("Type your message here..."):
|
|
| 40 |
with st.chat_message("user"):
|
| 41 |
st.markdown(prompt)
|
| 42 |
|
| 43 |
-
# Prepare context as a plain string (no schema)
|
| 44 |
context = ""
|
| 45 |
for msg in st.session_state.messages:
|
| 46 |
role = "User" if msg["role"] == "user" else "Assistant"
|
| 47 |
context += f"{role}: {msg['content']}\n"
|
| 48 |
-
|
|
|
|
|
|
|
| 49 |
|
| 50 |
# Generate response from LLM
|
| 51 |
with st.chat_message("assistant"):
|
|
|
|
| 40 |
with st.chat_message("user"):
|
| 41 |
st.markdown(prompt)
|
| 42 |
|
|
|
|
| 43 |
context = ""
|
| 44 |
for msg in st.session_state.messages:
|
| 45 |
role = "User" if msg["role"] == "user" else "Assistant"
|
| 46 |
context += f"{role}: {msg['content']}\n"
|
| 47 |
+
|
| 48 |
+
# Add explicit instruction to limit response
|
| 49 |
+
context += "Assistant: (Please answer in 50 words or fewer.)"
|
| 50 |
|
| 51 |
# Generate response from LLM
|
| 52 |
with st.chat_message("assistant"):
|