Spaces:
Runtime error
Runtime error
Update query.py
Browse files
query.py
CHANGED
|
@@ -70,7 +70,7 @@ class VectaraQuery():
|
|
| 70 |
response = requests.post(endpoint, data=json.dumps(body), verify=True, headers=headers)
|
| 71 |
if response.status_code != 200:
|
| 72 |
print(f"Query failed with code {response.status_code}, reason {response.reason}, text {response.text}")
|
| 73 |
-
return "Sorry,
|
| 74 |
|
| 75 |
res = response.json()
|
| 76 |
|
|
@@ -85,8 +85,8 @@ class VectaraQuery():
|
|
| 85 |
print(f"Chat query failed with code {st_code}")
|
| 86 |
if st_code == 'RESOURCE_EXHAUSTED':
|
| 87 |
self.conv_id = None
|
| 88 |
-
return 'Sorry,
|
| 89 |
-
return 'Sorry,
|
| 90 |
|
| 91 |
self.conv_id = res['responseSet'][0]['summary'][0]['chat']['conversationId']
|
| 92 |
|
|
|
|
| 70 |
response = requests.post(endpoint, data=json.dumps(body), verify=True, headers=headers)
|
| 71 |
if response.status_code != 200:
|
| 72 |
print(f"Query failed with code {response.status_code}, reason {response.reason}, text {response.text}")
|
| 73 |
+
return "Sorry, I'm experiencing an error. Please report this and try again later."
|
| 74 |
|
| 75 |
res = response.json()
|
| 76 |
|
|
|
|
| 85 |
print(f"Chat query failed with code {st_code}")
|
| 86 |
if st_code == 'RESOURCE_EXHAUSTED':
|
| 87 |
self.conv_id = None
|
| 88 |
+
return 'Sorry, chat turns exceeds plan limit.'
|
| 89 |
+
return 'Sorry, I'm experiencing an error. Please report this and try again later.'
|
| 90 |
|
| 91 |
self.conv_id = res['responseSet'][0]['summary'][0]['chat']['conversationId']
|
| 92 |
|