mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-26 23:44:19 +00:00
perf: ruff format & remove stream params in requester
This commit is contained in:
@@ -67,7 +67,7 @@ class ContentFilterStage(stage.PipelineStage):
|
||||
if query.pipeline_config['safety']['content-filter']['scope'] == 'output-msg':
|
||||
return entities.StageProcessResult(result_type=entities.ResultType.CONTINUE, new_query=query)
|
||||
if not message.strip():
|
||||
return entities.StageProcessResult(result_type=entities.ResultType.CONTINUE, new_query=query)
|
||||
return entities.StageProcessResult(result_type=entities.ResultType.CONTINUE, new_query=query)
|
||||
else:
|
||||
for filter in self.filter_chain:
|
||||
if filter_entities.EnableStage.PRE in filter.enable_stages:
|
||||
|
||||
@@ -81,9 +81,7 @@ class ChatMessageHandler(handler.MessageHandler):
|
||||
query.resp_message_chain.pop()
|
||||
|
||||
query.resp_messages.append(result)
|
||||
self.ap.logger.info(
|
||||
f'对话({query.query_id})流式响应: {self.cut_str(result.readable_str())}'
|
||||
)
|
||||
self.ap.logger.info(f'对话({query.query_id})流式响应: {self.cut_str(result.readable_str())}')
|
||||
|
||||
if result.content is not None:
|
||||
text_length += len(result.content)
|
||||
|
||||
@@ -3,12 +3,10 @@ from __future__ import annotations
|
||||
import random
|
||||
import asyncio
|
||||
|
||||
from typing_inspection.typing_objects import is_final
|
||||
|
||||
from ...platform.types import events as platform_events
|
||||
from ...platform.types import message as platform_message
|
||||
|
||||
from ...provider import entities as llm_entities
|
||||
|
||||
from .. import stage, entities
|
||||
from ...core import entities as core_entities
|
||||
@@ -56,6 +54,4 @@ class SendResponseBackStage(stage.PipelineStage):
|
||||
quote_origin=quote_origin,
|
||||
)
|
||||
|
||||
|
||||
|
||||
return entities.StageProcessResult(result_type=entities.ResultType.CONTINUE, new_query=query)
|
||||
|
||||
Reference in New Issue
Block a user