MilanM commited on
Commit
3ba4c57
·
verified ·
1 Parent(s): 6047652

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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.title("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, avatar="👤"})
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, avatar="😒"})
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()