Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,6 @@ def extract_text_from_docx(docx_path):
|
|
60 |
text = "\n".join([para.text for para in doc.paragraphs])
|
61 |
return text
|
62 |
|
63 |
-
|
64 |
def process_and_query(state, text, file=None):
|
65 |
# Initialize state on first run
|
66 |
if state is None:
|
@@ -90,6 +89,11 @@ def process_and_query(state, text, file=None):
|
|
90 |
|
91 |
# Update conversation history
|
92 |
state["conversation"].append({"question": text,
|
|
|
|
|
|
|
|
|
|
|
93 |
|
94 |
|
95 |
|
|
|
60 |
text = "\n".join([para.text for para in doc.paragraphs])
|
61 |
return text
|
62 |
|
|
|
63 |
def process_and_query(state, text, file=None):
|
64 |
# Initialize state on first run
|
65 |
if state is None:
|
|
|
89 |
|
90 |
# Update conversation history
|
91 |
state["conversation"].append({"question": text,
|
92 |
+
"answer": answer})
|
93 |
+
|
94 |
+
# Return the conversation history and potentially answer
|
95 |
+
return {"conversation": state["conversation"]}
|
96 |
+
|
97 |
|
98 |
|
99 |
|