fix file render

This commit is contained in:
takatost
2024-03-18 20:59:11 +08:00
parent d5a404236a
commit a2195c813c
15 changed files with 160 additions and 90 deletions

View File

@ -20,10 +20,11 @@ class WorkflowAppConfigManager(BaseAppConfigManager):
def get_app_config(cls, app_model: App, workflow: Workflow) -> WorkflowAppConfig:
features_dict = workflow.features_dict
app_mode = AppMode.value_of(app_model.mode)
app_config = WorkflowAppConfig(
tenant_id=app_model.tenant_id,
app_id=app_model.id,
app_mode=AppMode.value_of(app_model.mode),
app_mode=app_mode,
workflow_id=workflow.id,
sensitive_word_avoidance=SensitiveWordAvoidanceConfigManager.convert(
config=features_dict
@ -31,7 +32,7 @@ class WorkflowAppConfigManager(BaseAppConfigManager):
variables=WorkflowVariablesConfigManager.convert(
workflow=workflow
),
additional_features=cls.convert_features(features_dict)
additional_features=cls.convert_features(features_dict, app_mode)
)
return app_config

View File

@ -50,7 +50,7 @@ class WorkflowAppGenerator(BaseAppGenerator):
# parse files
files = args['files'] if 'files' in args and args['files'] else []
message_file_parser = MessageFileParser(tenant_id=app_model.tenant_id, app_id=app_model.id)
file_extra_config = FileUploadConfigManager.convert(workflow.features_dict)
file_extra_config = FileUploadConfigManager.convert(workflow.features_dict, is_vision=False)
if file_extra_config:
file_objs = message_file_parser.validate_and_transform_files_arg(
files,