Skip to content

Commit

Permalink
feat(parameters): standardize system parameter field types and values (
Browse files Browse the repository at this point in the history
  • Loading branch information
laipz8200 authored Oct 24, 2024
1 parent 6477bb8 commit 22bb041
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
12 changes: 10 additions & 2 deletions api/controllers/console/explore/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ class AppParameterApi(InstalledAppResource):
"options": fields.List(fields.String),
}

system_parameters_fields = {"image_file_size_limit": fields.String}
system_parameters_fields = {
"image_file_size_limit": fields.Integer,
"video_file_size_limit": fields.Integer,
"audio_file_size_limit": fields.Integer,
}

parameters_fields = {
"opening_statement": fields.String,
Expand Down Expand Up @@ -82,7 +86,11 @@ def get(self, installed_app: InstalledApp):
}
},
),
"system_parameters": {"image_file_size_limit": dify_config.UPLOAD_IMAGE_FILE_SIZE_LIMIT},
"system_parameters": {
"image_file_size_limit": dify_config.UPLOAD_IMAGE_FILE_SIZE_LIMIT,
"video_file_size_limit": dify_config.UPLOAD_VIDEO_FILE_SIZE_LIMIT,
"audio_file_size_limit": dify_config.UPLOAD_AUDIO_FILE_SIZE_LIMIT,
},
}


Expand Down
12 changes: 10 additions & 2 deletions api/controllers/service_api/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ class AppParameterApi(Resource):
"options": fields.List(fields.String),
}

system_parameters_fields = {"image_file_size_limit": fields.String}
system_parameters_fields = {
"image_file_size_limit": fields.String,
"video_file_size_limit": fields.Integer,
"audio_file_size_limit": fields.Integer,
}

parameters_fields = {
"opening_statement": fields.String,
Expand Down Expand Up @@ -81,7 +85,11 @@ def get(self, app_model: App):
}
},
),
"system_parameters": {"image_file_size_limit": dify_config.UPLOAD_IMAGE_FILE_SIZE_LIMIT},
"system_parameters": {
"image_file_size_limit": dify_config.UPLOAD_IMAGE_FILE_SIZE_LIMIT,
"video_file_size_limit": dify_config.UPLOAD_VIDEO_FILE_SIZE_LIMIT,
"audio_file_size_limit": dify_config.UPLOAD_AUDIO_FILE_SIZE_LIMIT,
},
}


Expand Down
12 changes: 10 additions & 2 deletions api/controllers/web/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ class AppParameterApi(WebApiResource):
"options": fields.List(fields.String),
}

system_parameters_fields = {"image_file_size_limit": fields.String}
system_parameters_fields = {
"image_file_size_limit": fields.Integer,
"video_file_size_limit": fields.Integer,
"audio_file_size_limit": fields.Integer,
}

parameters_fields = {
"opening_statement": fields.String,
Expand Down Expand Up @@ -80,7 +84,11 @@ def get(self, app_model: App, end_user):
}
},
),
"system_parameters": {"image_file_size_limit": dify_config.UPLOAD_IMAGE_FILE_SIZE_LIMIT},
"system_parameters": {
"image_file_size_limit": dify_config.UPLOAD_IMAGE_FILE_SIZE_LIMIT,
"video_file_size_limit": dify_config.UPLOAD_VIDEO_FILE_SIZE_LIMIT,
"audio_file_size_limit": dify_config.UPLOAD_AUDIO_FILE_SIZE_LIMIT,
},
}


Expand Down

0 comments on commit 22bb041

Please sign in to comment.