SaviAnna commited on
Commit
d3f1853
·
verified ·
1 Parent(s): ec5bf47

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +5 -5
src/streamlit_app.py CHANGED
@@ -135,7 +135,11 @@ async def main():
135
  dc_chunks = extract_dc_chunks(context_chunks)[:3]
136
  matched_sources = find_matches(dc_chunks, FULL_CHUNKS_DICT)
137
 
138
- # Показываем источники перед ответом
 
 
 
 
139
  if matched_sources:
140
  sources_md = "#### 📚 Sources:\n" + "\n".join(
141
  f"- **Time:** {src['timestamp']} | **File:** {src['file_path']}"
@@ -144,9 +148,5 @@ async def main():
144
  st.markdown(sources_md)
145
  st.session_state.messages.append({"role": "assistant", "content": sources_md})
146
 
147
- # Показываем ответ
148
- st.markdown(answer)
149
- st.session_state.messages.append({"role": "assistant", "content": answer})
150
-
151
  if __name__ == "__main__":
152
  asyncio.run(main())
 
135
  dc_chunks = extract_dc_chunks(context_chunks)[:3]
136
  matched_sources = find_matches(dc_chunks, FULL_CHUNKS_DICT)
137
 
138
+ # Сначала ответ
139
+ st.markdown(answer)
140
+ st.session_state.messages.append({"role": "assistant", "content": answer})
141
+
142
+ # Потом источники
143
  if matched_sources:
144
  sources_md = "#### 📚 Sources:\n" + "\n".join(
145
  f"- **Time:** {src['timestamp']} | **File:** {src['file_path']}"
 
148
  st.markdown(sources_md)
149
  st.session_state.messages.append({"role": "assistant", "content": sources_md})
150
 
 
 
 
 
151
  if __name__ == "__main__":
152
  asyncio.run(main())