Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -77,8 +77,8 @@ def query_vectara(question):
|
|
77 |
query_data = response.json()
|
78 |
if query_data:
|
79 |
# Extract summary and the first 5 sources
|
80 |
-
summary_text = query_data[
|
81 |
-
sources = query_data[
|
82 |
sources_text = [source["text"] for source in sources]
|
83 |
return f"Summary: {summary_text}\n\nSources:\n{json.dumps(sources_text, indent=2)}"
|
84 |
else:
|
|
|
77 |
query_data = response.json()
|
78 |
if query_data:
|
79 |
# Extract summary and the first 5 sources
|
80 |
+
summary_text = query_data["summary"]["text"]
|
81 |
+
sources = query_data["responseSet"]["responseList"][:5]
|
82 |
sources_text = [source["text"] for source in sources]
|
83 |
return f"Summary: {summary_text}\n\nSources:\n{json.dumps(sources_text, indent=2)}"
|
84 |
else:
|