jaeyong2 commited on
Commit
080031c
·
1 Parent(s): 8721ec5

[update] fix empty data detection logic

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -56,7 +56,9 @@ def local_RAG(model, message, client, vector_id):
56
  "max_num_results": 5
57
  }]
58
  )
59
- if response.output[0].results is None:
 
 
60
  return ""
61
  return response.output[1].content[0].text
62
  except Exception as e:
 
56
  "max_num_results": 5
57
  }]
58
  )
59
+ if len(response.output)==0:
60
+ return ""
61
+ if not response.output[1].content[0].annotations:
62
  return ""
63
  return response.output[1].content[0].text
64
  except Exception as e: