Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -94,14 +94,14 @@ def generate_response(watsonx_llm, prompt_data, params):
|
|
| 94 |
yield chunk
|
| 95 |
|
| 96 |
def chat_interface():
|
| 97 |
-
st.
|
| 98 |
|
| 99 |
# User input
|
| 100 |
user_input = st.chat_input("You:", key="user_input")
|
| 101 |
|
| 102 |
if user_input:
|
| 103 |
# Add user message to chat history
|
| 104 |
-
st.session_state.chat_history.append({"role": "user", "content": user_input
|
| 105 |
|
| 106 |
# Prepare the prompt
|
| 107 |
prompt = prepare_prompt(user_input, st.session_state.chat_history)
|
|
@@ -137,7 +137,7 @@ def chat_interface():
|
|
| 137 |
response = st.write_stream(stream)
|
| 138 |
|
| 139 |
# Add AI response to chat history
|
| 140 |
-
st.session_state.chat_history.append({"role": "Jimmy", "content": response
|
| 141 |
|
| 142 |
def main():
|
| 143 |
initialize_session_state()
|
|
|
|
| 94 |
yield chunk
|
| 95 |
|
| 96 |
def chat_interface():
|
| 97 |
+
st.subheader("Jimmy")
|
| 98 |
|
| 99 |
# User input
|
| 100 |
user_input = st.chat_input("You:", key="user_input")
|
| 101 |
|
| 102 |
if user_input:
|
| 103 |
# Add user message to chat history
|
| 104 |
+
st.session_state.chat_history.append({"role": "user", "content": user_input})
|
| 105 |
|
| 106 |
# Prepare the prompt
|
| 107 |
prompt = prepare_prompt(user_input, st.session_state.chat_history)
|
|
|
|
| 137 |
response = st.write_stream(stream)
|
| 138 |
|
| 139 |
# Add AI response to chat history
|
| 140 |
+
st.session_state.chat_history.append({"role": "Jimmy", "content": response)
|
| 141 |
|
| 142 |
def main():
|
| 143 |
initialize_session_state()
|