ソースを参照

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
         inputs = args['inputs']
         query = args['query']
+
+        if not query:
+            raise ValueError('query is required')
+
         conversation_id = args['conversation_id'] if 'conversation_id' in args else None
 
         conversation = None