Update app.py
Browse files
app.py
CHANGED
@@ -93,19 +93,19 @@ def get_refs(res):
|
|
93 |
doc = res['documents'][i].to_dict()
|
94 |
ref_id = doc['meta']['ref_id']
|
95 |
if ref_id in ref_ids:
|
96 |
-
|
97 |
return result_str
|
98 |
|
99 |
def run_query(input_text):
|
100 |
docs = get_docs(input_text)
|
101 |
-
st.write('
|
102 |
res = pipe.run(query=input_text, documents=docs)
|
103 |
output = res["results"][0]
|
104 |
st.write('Response')
|
105 |
st.success(output)
|
106 |
references = get_refs(res)
|
107 |
st.write('References')
|
108 |
-
st.
|
109 |
|
110 |
# def run_query(input_text):
|
111 |
# docs = get_docs(input_text)
|
|
|
93 |
doc = res['documents'][i].to_dict()
|
94 |
ref_id = doc['meta']['ref_id']
|
95 |
if ref_id in ref_ids:
|
96 |
+
result_str += "Ref. " + str(ref_id) + " [" + doc['meta']['country'] + " " + doc['meta']['document_name'] + "]: " + "'" + doc['content'] + "'<br> <br>" # Add <br> for a line break
|
97 |
return result_str
|
98 |
|
99 |
def run_query(input_text):
|
100 |
docs = get_docs(input_text)
|
101 |
+
st.write('Selected country: ', country) # Debugging country
|
102 |
res = pipe.run(query=input_text, documents=docs)
|
103 |
output = res["results"][0]
|
104 |
st.write('Response')
|
105 |
st.success(output)
|
106 |
references = get_refs(res)
|
107 |
st.write('References')
|
108 |
+
st.success(references)
|
109 |
|
110 |
# def run_query(input_text):
|
111 |
# docs = get_docs(input_text)
|