Spaces:
Runtime error
Runtime error
Update query.py
Browse files
query.py
CHANGED
@@ -104,7 +104,7 @@ class VectaraQuery():
|
|
104 |
doc_num = responses[response_num-1]['documentIndex']
|
105 |
metadata = {item['name']: item['value'] for item in docs[doc_num]['metadata']}
|
106 |
text = extract_between_tags(responses[response_num-1]['text'], start_tag, end_tag)
|
107 |
-
|
108 |
if url not in refs:
|
109 |
refs.append(url)
|
110 |
|
@@ -116,7 +116,7 @@ class VectaraQuery():
|
|
116 |
doc_num = responses[response_num-1]['documentIndex']
|
117 |
metadata = {item['name']: item['value'] for item in docs[doc_num]['metadata']}
|
118 |
text = extract_between_tags(responses[response_num-1]['text'], start_tag, end_tag)
|
119 |
-
|
120 |
citation_inx = refs_dict[url]
|
121 |
summary = summary[:start] + f'[\[{citation_inx}\]]({url})' + summary[end:]
|
122 |
|
|
|
104 |
doc_num = responses[response_num-1]['documentIndex']
|
105 |
metadata = {item['name']: item['value'] for item in docs[doc_num]['metadata']}
|
106 |
text = extract_between_tags(responses[response_num-1]['text'], start_tag, end_tag)
|
107 |
+
# for source citing url = f"{metadata['url']}#:~:text={quote(text)}"
|
108 |
if url not in refs:
|
109 |
refs.append(url)
|
110 |
|
|
|
116 |
doc_num = responses[response_num-1]['documentIndex']
|
117 |
metadata = {item['name']: item['value'] for item in docs[doc_num]['metadata']}
|
118 |
text = extract_between_tags(responses[response_num-1]['text'], start_tag, end_tag)
|
119 |
+
# for source citing url = f"{metadata['url']}#:~:text={quote(text)}"
|
120 |
citation_inx = refs_dict[url]
|
121 |
summary = summary[:start] + f'[\[{citation_inx}\]]({url})' + summary[end:]
|
122 |
|