mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 00:05:57 +08:00
fix(api/core/moderation/output_moderation.py): Fix config call. (#6769)
This commit is contained in:
parent
2cd662c43b
commit
8dd68e2034
@ -65,3 +65,5 @@ class DifyConfig(
|
||||
|
||||
SSRF_PROXY_HTTP_URL: str | None = None
|
||||
SSRF_PROXY_HTTPS_URL: str | None = None
|
||||
|
||||
MODERATION_BUFFER_SIZE: int = Field(default=300, description='The buffer size for moderation.')
|
||||
|
@ -21,8 +21,6 @@ class ModerationRule(BaseModel):
|
||||
|
||||
|
||||
class OutputModeration(BaseModel):
|
||||
DEFAULT_BUFFER_SIZE: int = 300
|
||||
|
||||
tenant_id: str
|
||||
app_id: str
|
||||
|
||||
@ -77,10 +75,10 @@ class OutputModeration(BaseModel):
|
||||
return final_output
|
||||
|
||||
def start_thread(self) -> threading.Thread:
|
||||
buffer_size = int(dify_config.config.MODERATION_BUFFER_SIZE)
|
||||
buffer_size = dify_config.MODERATION_BUFFER_SIZE
|
||||
thread = threading.Thread(target=self.worker, kwargs={
|
||||
'flask_app': current_app._get_current_object(),
|
||||
'buffer_size': buffer_size if buffer_size > 0 else self.DEFAULT_BUFFER_SIZE
|
||||
'buffer_size': buffer_size if buffer_size > 0 else dify_config.MODERATION_BUFFER_SIZE
|
||||
})
|
||||
|
||||
thread.start()
|
||||
|
Loading…
x
Reference in New Issue
Block a user