mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-25 05:46:13 +00:00
feat: 解藕chat的处理器和请求器 (#772)
This commit is contained in:
@@ -14,7 +14,18 @@ from .filters import cntignore, banwords, baiduexamine
|
||||
@stage.stage_class('PostContentFilterStage')
|
||||
@stage.stage_class('PreContentFilterStage')
|
||||
class ContentFilterStage(stage.PipelineStage):
|
||||
"""内容过滤阶段"""
|
||||
"""内容过滤阶段
|
||||
|
||||
前置:
|
||||
检查消息是否符合规则,不符合则拦截。
|
||||
改写:
|
||||
message_chain
|
||||
|
||||
后置:
|
||||
检查AI回复消息是否符合规则,可能进行改写,不符合则拦截。
|
||||
改写:
|
||||
query.resp_messages
|
||||
"""
|
||||
|
||||
filter_chain: list[filter_model.ContentFilter]
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ from ....config import manager as cfg_mgr
|
||||
|
||||
@filter_model.filter_class("ban-word-filter")
|
||||
class BanWordFilter(filter_model.ContentFilter):
|
||||
"""根据内容禁言"""
|
||||
"""根据内容过滤"""
|
||||
|
||||
async def initialize(self):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user