From 792e9402799c421accee87e59e758d6713e43f2e Mon Sep 17 00:00:00 2001 From: zhayujie Date: Fri, 13 Oct 2023 19:12:23 +0800 Subject: [PATCH] fix: knowledge base miss suffix bug --- bot/linkai/link_ai_bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/linkai/link_ai_bot.py b/bot/linkai/link_ai_bot.py index 18898aa..80c0326 100644 --- a/bot/linkai/link_ai_bot.py +++ b/bot/linkai/link_ai_bot.py @@ -94,11 +94,11 @@ class LinkAIBot(Bot, OpenAIImage): response = res.json() reply_content = response["choices"][0]["message"]["content"] total_tokens = response["usage"]["total_tokens"] + logger.info(f"[LINKAI] reply={reply_content}, total_tokens={total_tokens}") + self.sessions.session_reply(reply_content, session_id, total_tokens) suffix = self._fecth_knowledge_search_suffix(response) if suffix: reply_content += suffix - logger.info(f"[LINKAI] reply={reply_content}, total_tokens={total_tokens}") - self.sessions.session_reply(reply_content, session_id, total_tokens) return Reply(ReplyType.TEXT, reply_content) else: