Commit 842072ad by 范立洲

chore: add more log

parent 2e86b8ea
......@@ -71,6 +71,7 @@ class CompletionResource(Resource):
# 1.1 intent ==> qa
if intent is not None and intent.answer == const.INTENT_QA:
current_app.logger.info(f"Local Answer for Question {req['prompt']}")
try:
answer = self.qa_bot.complete(**req)
if answer is None:
......@@ -82,6 +83,7 @@ class CompletionResource(Resource):
# 1.2 intent ==> chatgpt
try:
current_app.logger.info(f"ChatGPT Answer for Question {req['prompt']}")
resp = self.chatgpt_bot.complete(req["prompt"])
return response.OK("", resp.to_dict())
except Exception as e:
......@@ -111,7 +113,6 @@ class CompletionResource(Resource):
traceback.print_exc()
return response.InternalServerError(str(e))
def _stream_completion(self, req):
# # 1. intent check
# intent = self.intent_bot.complete(req["prompt"])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论