SaviAnna commited on
Commit
4a1eeaf
·
verified ·
1 Parent(s): f89bd00

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +4 -3
src/streamlit_app.py CHANGED
@@ -46,8 +46,9 @@ async def handle_input(user_input, rag):
46
 
47
 
48
  async def is_query_about_specific_file(user_input: str) -> bool:
49
- prompt = (f"User question: \"{user_input}\"\n"
50
- "Does the user explicitly refer to a specific sermon...yes or no.")
 
51
  response = await gpt_4o_mini_complete(prompt)
52
  return "yes" in response.strip().lower()
53
 
@@ -107,7 +108,7 @@ async def handle_input(user_input, rag):
107
  st.markdown(short_answer)
108
  st.session_state.messages.append({"role": "assistant", "content": short_answer})
109
 
110
- if matched_sources:
111
  sources_md = "#### 📚 Sources:\n" + "\n".join(
112
  f"- **Time:** {src['timestamp']} | **File:** {src['file_path']}"
113
  for src in matched_sources
 
46
 
47
 
48
  async def is_query_about_specific_file(user_input: str) -> bool:
49
+ prompt = ( f"User question: \"{user_input}\"\n"
50
+ "Does the user explicitly refer to a specific sermon, sermon series, or a named teaching by a preacher (e.g., by name like '2016 6 8 Bishops', 'Kingdom Exceptionalism', 'Joseph Prince's sermon on faith', 'Thankfulness, A Daily Habit - Bill Johnson')? This means the user is asking about content within a *particular* named message, not just a general topic or a request for a list of sermons.\n"
51
+ "Respond with only 'yes' or 'no'. Do not add anything else to your answer.")
52
  response = await gpt_4o_mini_complete(prompt)
53
  return "yes" in response.strip().lower()
54
 
 
108
  st.markdown(short_answer)
109
  st.session_state.messages.append({"role": "assistant", "content": short_answer})
110
 
111
+ if matched_sources and not explicit_source:
112
  sources_md = "#### 📚 Sources:\n" + "\n".join(
113
  f"- **Time:** {src['timestamp']} | **File:** {src['file_path']}"
114
  for src in matched_sources