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:
@@ -18,10 +18,6 @@ logger = get_logger("anti_injector.counter_attack")
|
||||
class CounterAttackGenerator:
|
||||
"""反击消息生成器"""
|
||||
|
||||
def __init__(self):
|
||||
"""初始化反击消息生成器"""
|
||||
pass
|
||||
|
||||
def get_personality_context(self) -> str:
|
||||
"""获取人格上下文信息
|
||||
|
||||
|
||||
@@ -18,9 +18,6 @@ logger = get_logger("anti_injector.counter_attack")
|
||||
class CounterAttackGenerator:
|
||||
"""反击消息生成器"""
|
||||
|
||||
def __init__(self):
|
||||
"""初始化反击消息生成器"""
|
||||
pass
|
||||
|
||||
def get_personality_context(self) -> str:
|
||||
"""获取人格上下文信息
|
||||
|
||||
@@ -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:
|
||||
"""提取消息中的文本内容,过滤掉引用的历史内容
|
||||
|
||||
|
||||
Reference in New Issue
Block a user