2 commits before
Browse files- src/streamlit_app.py +7 -9
src/streamlit_app.py
CHANGED
@@ -87,16 +87,14 @@ if prompt := st.chat_input("Describe your symptoms or ask a medical question..."
|
|
87 |
# Check if we need to process a response (this block runs after the rerun if processing is True)
|
88 |
if st.session_state.processing:
|
89 |
try:
|
90 |
-
#
|
91 |
-
|
92 |
|
93 |
-
if
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
# The query for the orchestrator is the content of the last user message
|
100 |
current_query = current_user_prompt_message["content"]
|
101 |
|
102 |
reply, explanation, follow_up_questions, evidence = orchestrator_chat(
|
|
|
87 |
# Check if we need to process a response (this block runs after the rerun if processing is True)
|
88 |
if st.session_state.processing:
|
89 |
try:
|
90 |
+
# Use the local session state history
|
91 |
+
current_session_history = st.session_state.get('history', [])
|
92 |
|
93 |
+
if current_session_history: # Ensure history is not empty
|
94 |
+
# The history for the orchestrator is all messages EXCEPT the last one (current user's prompt)
|
95 |
+
# The last message is the current user's prompt, which was just added.
|
96 |
+
history_for_orchestrator = current_session_history[:-1]
|
97 |
+
current_user_prompt_message = current_session_history[-1]
|
|
|
|
|
98 |
current_query = current_user_prompt_message["content"]
|
99 |
|
100 |
reply, explanation, follow_up_questions, evidence = orchestrator_chat(
|