forked from langgenius/dify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: cleanup and rearrange unclassified configs into feature config…
… groups (langgenius#7586)
- Loading branch information
1 parent
1ed6223
commit f0671df
Showing
7 changed files
with
125 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
from pydantic import Field, computed_field | ||
from pydantic_settings import SettingsConfigDict | ||
|
||
from configs.deploy import DeploymentConfig | ||
|
@@ -24,8 +23,6 @@ class DifyConfig( | |
# **Before using, please contact [email protected] by email to inquire about licensing matters.** | ||
EnterpriseFeatureConfig, | ||
): | ||
DEBUG: bool = Field(default=False, description='whether to enable debug mode.') | ||
|
||
model_config = SettingsConfigDict( | ||
# read from dotenv format config file | ||
env_file='.env', | ||
|
@@ -35,33 +32,7 @@ class DifyConfig( | |
extra='ignore', | ||
) | ||
|
||
CODE_MAX_NUMBER: int = 9223372036854775807 | ||
CODE_MIN_NUMBER: int = -9223372036854775808 | ||
CODE_MAX_DEPTH: int = 5 | ||
CODE_MAX_PRECISION: int = 20 | ||
CODE_MAX_STRING_LENGTH: int = 80000 | ||
CODE_MAX_STRING_ARRAY_LENGTH: int = 30 | ||
CODE_MAX_OBJECT_ARRAY_LENGTH: int = 30 | ||
CODE_MAX_NUMBER_ARRAY_LENGTH: int = 1000 | ||
|
||
HTTP_REQUEST_MAX_CONNECT_TIMEOUT: int = 300 | ||
HTTP_REQUEST_MAX_READ_TIMEOUT: int = 600 | ||
HTTP_REQUEST_MAX_WRITE_TIMEOUT: int = 600 | ||
HTTP_REQUEST_NODE_MAX_BINARY_SIZE: int = 1024 * 1024 * 10 | ||
|
||
@computed_field | ||
def HTTP_REQUEST_NODE_READABLE_MAX_BINARY_SIZE(self) -> str: | ||
return f'{self.HTTP_REQUEST_NODE_MAX_BINARY_SIZE / 1024 / 1024:.2f}MB' | ||
|
||
HTTP_REQUEST_NODE_MAX_TEXT_SIZE: int = 1024 * 1024 | ||
|
||
@computed_field | ||
def HTTP_REQUEST_NODE_READABLE_MAX_TEXT_SIZE(self) -> str: | ||
return f'{self.HTTP_REQUEST_NODE_MAX_TEXT_SIZE / 1024 / 1024:.2f}MB' | ||
|
||
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.') | ||
|
||
MAX_VARIABLE_SIZE: int = Field(default=5 * 1024, description='The maximum size of a variable. default is 5KB.') | ||
# Before adding any config, | ||
# please consider to arrange it in the proper config group of existed or added | ||
# for better readability and maintainability. | ||
# Thanks for your concentration and consideration. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters