Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,16 @@ import gradio as gr
|
|
2 |
from llm_handler import sanchaari
|
3 |
|
4 |
def handle_query(query):
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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,
|