mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-16 09:26:07 +00:00
style: restrict line-length
This commit is contained in:
@@ -47,9 +47,7 @@ class LongTextProcessStage(stage.PipelineStage):
|
||||
'未找到字体文件,且无法使用系统自带字体,更换为转发消息组件以发送长消息,您可以在配置文件中调整相关设置。'
|
||||
)
|
||||
|
||||
pipeline_config['output']['long-text-processing'][
|
||||
'strategy'
|
||||
] = 'forward'
|
||||
pipeline_config['output']['long-text-processing']['strategy'] = 'forward'
|
||||
except Exception:
|
||||
traceback.print_exc()
|
||||
self.ap.logger.error(
|
||||
@@ -58,9 +56,7 @@ class LongTextProcessStage(stage.PipelineStage):
|
||||
)
|
||||
)
|
||||
|
||||
pipeline_config['output']['long-text-processing']['strategy'] = (
|
||||
'forward'
|
||||
)
|
||||
pipeline_config['output']['long-text-processing']['strategy'] = 'forward'
|
||||
|
||||
for strategy_cls in strategy.preregistered_strategies:
|
||||
if strategy_cls.name == config['strategy']:
|
||||
@@ -71,9 +67,7 @@ class LongTextProcessStage(stage.PipelineStage):
|
||||
|
||||
await self.strategy_impl.initialize()
|
||||
|
||||
async def process(
|
||||
self, query: core_entities.Query, stage_inst_name: str
|
||||
) -> entities.StageProcessResult:
|
||||
async def process(self, query: core_entities.Query, stage_inst_name: str) -> entities.StageProcessResult:
|
||||
# 检查是否包含非 Plain 组件
|
||||
contains_non_plain = False
|
||||
|
||||
@@ -89,11 +83,7 @@ class LongTextProcessStage(stage.PipelineStage):
|
||||
> query.pipeline_config['output']['long-text-processing']['threshold']
|
||||
):
|
||||
query.resp_message_chain[-1] = platform_message.MessageChain(
|
||||
await self.strategy_impl.process(
|
||||
str(query.resp_message_chain[-1]), query
|
||||
)
|
||||
await self.strategy_impl.process(str(query.resp_message_chain[-1]), query)
|
||||
)
|
||||
|
||||
return entities.StageProcessResult(
|
||||
result_type=entities.ResultType.CONTINUE, new_query=query
|
||||
)
|
||||
return entities.StageProcessResult(result_type=entities.ResultType.CONTINUE, new_query=query)
|
||||
|
||||
Reference in New Issue
Block a user