From faad247d85b102c7471f872a00961fd503d93bfe Mon Sep 17 00:00:00 2001 From: -LAN- Date: Mon, 21 Oct 2024 19:42:22 +0800 Subject: [PATCH] fix(upload): correct incorrect dictionary key usage (#9563) --- api/core/app/app_config/features/file_upload/manager.py | 2 +- api/core/prompt/utils/prompt_template_parser.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/core/app/app_config/features/file_upload/manager.py b/api/core/app/app_config/features/file_upload/manager.py index 6d301f6ea..12037f857 100644 --- a/api/core/app/app_config/features/file_upload/manager.py +++ b/api/core/app/app_config/features/file_upload/manager.py @@ -20,7 +20,7 @@ class FileUploadConfigManager: data = { "image_config": { "number_limits": file_upload_dict["number_limits"], - "transfer_methods": file_upload_dict["allowed_file_upload_methods"], + "transfer_methods": file_upload_dict["allowed_upload_methods"], } } diff --git a/api/core/prompt/utils/prompt_template_parser.py b/api/core/prompt/utils/prompt_template_parser.py index 811155967..0fd08c5d3 100644 --- a/api/core/prompt/utils/prompt_template_parser.py +++ b/api/core/prompt/utils/prompt_template_parser.py @@ -33,7 +33,7 @@ class PromptTemplateParser: key = match.group(1) value = inputs.get(key, match.group(0)) # return original matched string if key not found - if remove_template_variables: + if remove_template_variables and isinstance(value, str): return PromptTemplateParser.remove_template_variables(value, self.with_variable_tmpl) return value