arde0909 commited on
Commit
999a29a
1 Parent(s): 6481cbf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -2,8 +2,16 @@ import gradio as gr
2
  from llm_handler import sanchaari
3
 
4
  def handle_query(query):
5
- thought_process, response = sanchaari(query)
6
- return {"Thought Process": thought_process, "Response": response}
 
 
 
 
 
 
 
 
7
 
8
  gr.Interface(
9
  fn=handle_query,
 
2
  from llm_handler import sanchaari
3
 
4
  def handle_query(query):
5
+ thoughts = []
6
+ final_answer = None
7
+
8
+ for result in sanchaari(query):
9
+ if "thought" in result:
10
+ thoughts.append(result["thought"])
11
+ yield {"Thought Process": thoughts, "Response Text": ""}
12
+ if "final_answer" in result:
13
+ final_answer = result["final_answer"]
14
+ yield {"Thought Process": thoughts, "Response Text": final_answer}
15
 
16
  gr.Interface(
17
  fn=handle_query,