Skip to content

Commit

Permalink
ModerationConfigs
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenliang123 committed Jun 15, 2024
1 parent b62eb3a commit cf47865
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 0 additions & 5 deletions api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
'HOSTED_FETCH_APP_TEMPLATES_MODE': 'remote',
'HOSTED_FETCH_APP_TEMPLATES_REMOTE_DOMAIN': 'https://tmpl.dify.ai',
'CLEAN_DAY_SETTING': 30,
'OUTPUT_MODERATION_BUFFER_SIZE': 300,
'MULTIMODAL_SEND_IMAGE_FORMAT': 'base64',
'INVITE_EXPIRY_HOURS': 72,
'ETL_TYPE': 'dify',
Expand Down Expand Up @@ -185,7 +184,6 @@ def __init__(self):
self.RELYT_PASSWORD = get_env('RELYT_PASSWORD')
self.RELYT_DATABASE = get_env('RELYT_DATABASE')


# tencent settings
self.TENCENT_VECTOR_DB_URL = get_env('TENCENT_VECTOR_DB_URL')
self.TENCENT_VECTOR_DB_API_KEY = get_env('TENCENT_VECTOR_DB_API_KEY')
Expand Down Expand Up @@ -266,9 +264,6 @@ def __init__(self):
# Tool Configurations.
self.TOOL_ICON_CACHE_MAX_AGE = get_env('TOOL_ICON_CACHE_MAX_AGE')

# Moderation in app Configurations.
self.OUTPUT_MODERATION_BUFFER_SIZE = int(get_env('OUTPUT_MODERATION_BUFFER_SIZE'))

# ------------------------
# Platform Configurations.
# ------------------------
Expand Down
13 changes: 13 additions & 0 deletions api/configs/feature/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,21 @@ class OAuthConfigs(BaseModel):
)


class ModerationConfigs(BaseModel):
"""
Moderation in app configs.
"""

# todo: to be clarified in usage and unit
OUTPUT_MODERATION_BUFFER_SIZE: PositiveInt = Field(
description='buffer size for moderation',
default=300,
)


class FeatureConfigs(
OAuthConfigs,
ModerationConfigs,
EndpointConfigs,
HttpConfigs,
LoggingConfigs,
Expand Down

0 comments on commit cf47865

Please sign in to comment.