Browse Source

fix: search miss config

master
zhayujie 1 year ago
parent
commit
dd082bd212
3 changed files with 3 additions and 3 deletions
  1. +1
    -1
      bot/linkai/link_ai_bot.py
  2. +1
    -1
      channel/wechat/wechat_message.py
  3. +1
    -1
      plugins/linkai/summary.py

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

@@ -197,7 +197,7 @@ class LinkAIBot(Bot, OpenAIImage):
plugin_config = pconf("linkai") plugin_config = pconf("linkai")
if plugin_config.get("knowledge_base") and plugin_config.get("knowledge_base").get("search_miss_text_enabled"): if plugin_config.get("knowledge_base") and plugin_config.get("knowledge_base").get("search_miss_text_enabled"):
search_miss_similarity = plugin_config.get("knowledge_base").get("search_miss_similarity") search_miss_similarity = plugin_config.get("knowledge_base").get("search_miss_similarity")
search_miss_text = plugin_config.get("knowledge_base").get("search_miss_text")
search_miss_text = plugin_config.get("knowledge_base").get("search_miss_suffix")
if not search_hit: if not search_hit:
return search_miss_text return search_miss_text
if search_miss_similarity and float(search_miss_similarity) > first_similarity: if search_miss_similarity and float(search_miss_similarity) > first_similarity:


+ 1
- 1
channel/wechat/wechat_message.py View File

@@ -43,7 +43,7 @@ class WechatMessage(ChatMessage):
raise NotImplementedError("Unsupported note message: " + itchat_msg["Content"]) raise NotImplementedError("Unsupported note message: " + itchat_msg["Content"])
elif itchat_msg["Type"] == ATTACHMENT: elif itchat_msg["Type"] == ATTACHMENT:
self.ctype = ContextType.FILE self.ctype = ContextType.FILE
self.content = TmpDir().path() + itchat_msg["FileName"]
self.content = TmpDir().path() + itchat_msg["FileName"] # content直接存临时目录路径
self._prepare_fn = lambda: itchat_msg.download(self.content) self._prepare_fn = lambda: itchat_msg.download(self.content)
elif itchat_msg["Type"] == SHARING: elif itchat_msg["Type"] == SHARING:
self.ctype = ContextType.SHARING self.ctype = ContextType.SHARING


+ 1
- 1
plugins/linkai/summary.py View File

@@ -90,5 +90,5 @@ class LinkSummary:
for support_url in support_list: for support_url in support_list:
if url.strip().startswith(support_url): if url.strip().startswith(support_url):
return True return True
logger.warn(f"[LinkSum] unsupported url, no need to process, url={url}")
logger.debug(f"[LinkSum] unsupported url, no need to process, url={url}")
return False return False

Loading…
Cancel
Save