snsynth commited on
Commit
d1b7cc6
·
1 Parent(s): bab388e

update chat utils

Browse files
Files changed (1) hide show
  1. rag_app/chat_utils.py +4 -5
rag_app/chat_utils.py CHANGED
@@ -40,13 +40,12 @@ def respond_to_chat(query: str, history: list[ChatMessage]):
40
  assistant_message = ChatMessage(role=_ROLE_ASSISTANT)
41
  yield assistant_message
42
  state = me.state(State)
43
- if len(state.pdf_files)==0:
44
- pdf_files = ["data/annual-report-of-fy-2022-23.pdf", "data/reliance-jio-infocomm-limited-annual-report-fy-2023-24.pdf"]
45
  else:
46
  pdf_files = state.pdf_files
47
-
48
- response = extract_final_answer(pdf_files, query)
49
-
50
  print("Agent response=", response)
51
  yield response
52
 
 
40
  assistant_message = ChatMessage(role=_ROLE_ASSISTANT)
41
  yield assistant_message
42
  state = me.state(State)
43
+ if len(state.pdf_files) == 0:
44
+ response = answer_question(query)
45
  else:
46
  pdf_files = state.pdf_files
47
+ response = extract_final_answer(pdf_files, query)
48
+
 
49
  print("Agent response=", response)
50
  yield response
51