MilanM commited on
Commit
d595e9f
·
verified ·
1 Parent(s): 2e02ddb

Update app_v2.py

Browse files
Files changed (1) hide show
  1. app_v2.py +2 -1
app_v2.py CHANGED
@@ -139,7 +139,7 @@ def chat_interface():
139
 
140
  if user_input:
141
  # Add user message to chat history
142
- st.session_state.chat_history.append({"role": "user", "content": user_input})
143
 
144
  # Prepare the prompt
145
  prompt = prepare_prompt(user_input, st.session_state.chat_history)
@@ -174,6 +174,7 @@ def chat_interface():
174
  print(prompt_data)
175
  stream = generate_response(watsonx_llm, prompt_data, params)
176
  response = st.write_stream(stream)
 
177
 
178
  # Add AI response to chat history
179
  st.session_state.chat_history.append({"role": "Jimmy", "content": response})
 
139
 
140
  if user_input:
141
  # Add user message to chat history
142
+ # st.session_state.chat_history.append({"role": "user", "content": user_input})
143
 
144
  # Prepare the prompt
145
  prompt = prepare_prompt(user_input, st.session_state.chat_history)
 
174
  print(prompt_data)
175
  stream = generate_response(watsonx_llm, prompt_data, params)
176
  response = st.write_stream(stream)
177
+ st.session_state.chat_history.append({"role": "user", "content": user_input})
178
 
179
  # Add AI response to chat history
180
  st.session_state.chat_history.append({"role": "Jimmy", "content": response})