浏览代码

fix: query empty not allow (#255)

John Wang 1 年之前
父节点
当前提交
ccd80653ff
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      api/services/completion_service.py

+ 4 - 0
api/services/completion_service.py

@@ -33,6 +33,10 @@ class CompletionService:
         # is streaming mode
         # is streaming mode
         inputs = args['inputs']
         inputs = args['inputs']
         query = args['query']
         query = args['query']
+
+        if not query:
+            raise ValueError('query is required')
+
         conversation_id = args['conversation_id'] if 'conversation_id' in args else None
         conversation_id = args['conversation_id'] if 'conversation_id' in args else None
 
 
         conversation = None
         conversation = None