Browse Source

fix: knowledge base miss suffix bug

master
zhayujie 1 year ago
parent
commit
792e940279
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      bot/linkai/link_ai_bot.py

+ 2
- 2
bot/linkai/link_ai_bot.py View File

@@ -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:


Loading…
Cancel
Save