before prev commit - working
Browse files- src/streamlit_app.py +8 -3
src/streamlit_app.py
CHANGED
|
@@ -98,7 +98,7 @@ if st.session_state.processing:
|
|
| 98 |
previous_messages = [msg for msg in full_history if msg["role"] == "assistant" or
|
| 99 |
(msg["role"] == "user" and msg["content"] != last_user_message)]
|
| 100 |
|
| 101 |
-
reply, explanation, evidence = orchestrator_chat(
|
| 102 |
previous_messages,
|
| 103 |
last_user_message,
|
| 104 |
use_rag=st.session_state.use_rag,
|
|
@@ -109,11 +109,17 @@ if st.session_state.processing:
|
|
| 109 |
cleaned_reply = remove_reasoning_and_sources(reply)
|
| 110 |
cleaned_explanation = clean_explanation(explanation) if explanation else ""
|
| 111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
# Add assistant response to history
|
| 113 |
assistant_message = {
|
| 114 |
"role": "assistant",
|
| 115 |
"content": cleaned_reply,
|
| 116 |
"explanation": cleaned_explanation,
|
|
|
|
| 117 |
"evidence": evidence if evidence else []
|
| 118 |
}
|
| 119 |
|
|
@@ -138,5 +144,4 @@ if __name__ == "__main__":
|
|
| 138 |
import sys
|
| 139 |
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 140 |
if current_dir not in sys.path:
|
| 141 |
-
sys.path.insert(0, current_dir)
|
| 142 |
-
|
|
|
|
| 98 |
previous_messages = [msg for msg in full_history if msg["role"] == "assistant" or
|
| 99 |
(msg["role"] == "user" and msg["content"] != last_user_message)]
|
| 100 |
|
| 101 |
+
reply, explanation, follow_up_questions, evidence = orchestrator_chat(
|
| 102 |
previous_messages,
|
| 103 |
last_user_message,
|
| 104 |
use_rag=st.session_state.use_rag,
|
|
|
|
| 109 |
cleaned_reply = remove_reasoning_and_sources(reply)
|
| 110 |
cleaned_explanation = clean_explanation(explanation) if explanation else ""
|
| 111 |
|
| 112 |
+
# Format follow-up questions as a string
|
| 113 |
+
formatted_follow_up = ""
|
| 114 |
+
if follow_up_questions:
|
| 115 |
+
formatted_follow_up = "\n".join([f"{i+1}. {q}" for i, q in enumerate(follow_up_questions)])
|
| 116 |
+
|
| 117 |
# Add assistant response to history
|
| 118 |
assistant_message = {
|
| 119 |
"role": "assistant",
|
| 120 |
"content": cleaned_reply,
|
| 121 |
"explanation": cleaned_explanation,
|
| 122 |
+
"follow_up_questions": formatted_follow_up,
|
| 123 |
"evidence": evidence if evidence else []
|
| 124 |
}
|
| 125 |
|
|
|
|
| 144 |
import sys
|
| 145 |
current_dir = os.path.dirname(os.path.abspath(__file__))
|
| 146 |
if current_dir not in sys.path:
|
| 147 |
+
sys.path.insert(0, current_dir)
|
|
|