chore(api/core): apply ruff reformatting (#7624)
This commit is contained in:
parent
178730266d
commit
2cf1187b32
724 changed files with 21180 additions and 21123 deletions
|
|
@ -13,13 +13,14 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
class InputModeration:
|
||||
def check(
|
||||
self, app_id: str,
|
||||
self,
|
||||
app_id: str,
|
||||
tenant_id: str,
|
||||
app_config: AppConfig,
|
||||
inputs: dict,
|
||||
query: str,
|
||||
message_id: str,
|
||||
trace_manager: Optional[TraceQueueManager] = None
|
||||
trace_manager: Optional[TraceQueueManager] = None,
|
||||
) -> tuple[bool, dict, str]:
|
||||
"""
|
||||
Process sensitive_word_avoidance.
|
||||
|
|
@ -39,10 +40,7 @@ class InputModeration:
|
|||
moderation_type = sensitive_word_avoidance_config.type
|
||||
|
||||
moderation_factory = ModerationFactory(
|
||||
name=moderation_type,
|
||||
app_id=app_id,
|
||||
tenant_id=tenant_id,
|
||||
config=sensitive_word_avoidance_config.config
|
||||
name=moderation_type, app_id=app_id, tenant_id=tenant_id, config=sensitive_word_avoidance_config.config
|
||||
)
|
||||
|
||||
with measure_time() as timer:
|
||||
|
|
@ -55,7 +53,7 @@ class InputModeration:
|
|||
message_id=message_id,
|
||||
moderation_result=moderation_result,
|
||||
inputs=inputs,
|
||||
timer=timer
|
||||
timer=timer,
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue