Commit 842072ad by 范立洲

chore: add more log

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