Solshine commited on
Commit
4274570
1 Parent(s): 98e93ad

Update query.py

Browse files
Files changed (1) hide show
  1. query.py +7 -7
query.py CHANGED
@@ -80,13 +80,13 @@ class VectaraQuery():
80
  docs = res['responseSet'][0]['document']
81
  chat = res['responseSet'][0]['summary'][0]['chat']
82
 
83
- if chat['status'] != None:
84
- st_code = chat['status']
85
- print(f"Chat query failed with code {st_code}")
86
- if st_code == 'RESOURCE_EXHAUSTED':
87
- self.conv_id = None
88
- return 'Sorry, Vectara chat turns exceeds plan limit.'
89
- return 'Sorry, something went wrong in my brain. Please try again later.'
90
 
91
  try:
92
  self.conv_id = res['responseSet'][0]['summary'][0]['chat']['conversationId']
 
80
  docs = res['responseSet'][0]['document']
81
  chat = res['responseSet'][0]['summary'][0]['chat']
82
 
83
+ # if len(chat['status']) <= 0:
84
+ # st_code = chat['status']
85
+ # print(f"Chat query failed with code {st_code}")
86
+ # if st_code == 'RESOURCE_EXHAUSTED':
87
+ # self.conv_id = None
88
+ # return 'Sorry, Vectara chat turns exceeds plan limit.'
89
+ # return 'Sorry, something went wrong in my brain. Please try again later.'
90
 
91
  try:
92
  self.conv_id = res['responseSet'][0]['summary'][0]['chat']['conversationId']