Refactor web search plugin and clean up code

Refactored the web search plugin by removing the old Bing search implementation and reorganizing the plugin structure. Introduced modular search engine classes under 'web_search_tool/engines' and utility tools under 'web_search_tool/tools' and 'web_search_tool/utils'. Updated references and initialization logic to support multiple search engines and improved maintainability. Also performed minor code cleanups and replaced 'except ...: pass' with 'except ...: ...' for brevity.
This commit is contained in:
雅诺狐
2025-08-21 23:42:16 +08:00
parent 9c8fb929e1
commit f8ba0d0e43
27 changed files with 1367 additions and 1112 deletions

View File

@@ -18,10 +18,6 @@ logger = get_logger("anti_injector.counter_attack")
class CounterAttackGenerator:
"""反击消息生成器"""
def __init__(self):
"""初始化反击消息生成器"""
pass
def get_personality_context(self) -> str:
"""获取人格上下文信息

View File

@@ -18,9 +18,6 @@ logger = get_logger("anti_injector.counter_attack")
class CounterAttackGenerator:
"""反击消息生成器"""
def __init__(self):
"""初始化反击消息生成器"""
pass
def get_personality_context(self) -> str:
"""获取人格上下文信息

View File

@@ -17,10 +17,6 @@ logger = get_logger("anti_injector.message_processor")
class MessageProcessor:
"""消息内容处理器"""
def __init__(self):
"""初始化消息处理器"""
pass
def extract_text_content(self, message: MessageRecv) -> str:
"""提取消息中的文本内容,过滤掉引用的历史内容