Spaces:
Runtime error
Runtime error
Update query.py
Browse files
query.py
CHANGED
@@ -95,17 +95,21 @@ class VectaraQuery():
|
|
95 |
# Step 1a: Check for 'responseSet'
|
96 |
if res is not None and 'responseSet' in res:
|
97 |
response_set = res['responseSet']
|
|
|
98 |
|
99 |
# Step 1b: Check for 'summary' within the first item
|
100 |
if len(response_set) > 0 and 'summary' in response_set[0]:
|
101 |
summary = response_set[0]['summary']
|
|
|
102 |
|
103 |
# Step 1c: Check for 'chat' within the first summary
|
104 |
if len(summary) > 0 and 'chat' in summary[0]:
|
105 |
chat = summary[0]['chat']
|
|
|
106 |
|
107 |
# Step 1d: Finally, access 'conversationId'
|
108 |
-
|
|
|
109 |
else:
|
110 |
# Handle missing 'chat' in summary
|
111 |
print("Chat data not found in response summary")
|
|
|
95 |
# Step 1a: Check for 'responseSet'
|
96 |
if res is not None and 'responseSet' in res:
|
97 |
response_set = res['responseSet']
|
98 |
+
print("BIG 1")
|
99 |
|
100 |
# Step 1b: Check for 'summary' within the first item
|
101 |
if len(response_set) > 0 and 'summary' in response_set[0]:
|
102 |
summary = response_set[0]['summary']
|
103 |
+
print("BIG 2")
|
104 |
|
105 |
# Step 1c: Check for 'chat' within the first summary
|
106 |
if len(summary) > 0 and 'chat' in summary[0]:
|
107 |
chat = summary[0]['chat']
|
108 |
+
print("BIG 3")
|
109 |
|
110 |
# Step 1d: Finally, access 'conversationId'
|
111 |
+
self.conv_id = res['responseSet'][0]['summary'][0]['chat']['conversationId']
|
112 |
+
print("BIG CHANGE")
|
113 |
else:
|
114 |
# Handle missing 'chat' in summary
|
115 |
print("Chat data not found in response summary")
|