Skip to content

Commit 792e940

Browse files
committed
fix: knowledge base miss suffix bug
1 parent c2477b2 commit 792e940

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bot/linkai/link_ai_bot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ def _chat(self, query, context, retry_count=0) -> Reply:
9494
response = res.json()
9595
reply_content = response["choices"][0]["message"]["content"]
9696
total_tokens = response["usage"]["total_tokens"]
97+
logger.info(f"[LINKAI] reply={reply_content}, total_tokens={total_tokens}")
98+
self.sessions.session_reply(reply_content, session_id, total_tokens)
9799
suffix = self._fecth_knowledge_search_suffix(response)
98100
if suffix:
99101
reply_content += suffix
100-
logger.info(f"[LINKAI] reply={reply_content}, total_tokens={total_tokens}")
101-
self.sessions.session_reply(reply_content, session_id, total_tokens)
102102
return Reply(ReplyType.TEXT, reply_content)
103103

104104
else:

0 commit comments

Comments
 (0)