bug: (#7586 followup) fix config of CODE_MAX_STRING_LENGTH (#7683)

This commit is contained in:
Bowen Liang 2024-08-27 10:38:24 +08:00 committed by GitHub
parent 35431bce0d
commit a15080a1d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -88,9 +88,9 @@ class CodeNode(BaseNode):
else: else:
raise ValueError(f"Output variable `{variable}` must be a string") raise ValueError(f"Output variable `{variable}` must be a string")
if len(value) > dify_config.CODE_MAX_STRING_ARRAY_LENGTH: if len(value) > dify_config.CODE_MAX_STRING_LENGTH:
raise ValueError(f'The length of output variable `{variable}` must be' raise ValueError(f'The length of output variable `{variable}` must be'
f' less than {dify_config.CODE_MAX_STRING_ARRAY_LENGTH} characters') f' less than {dify_config.CODE_MAX_STRING_LENGTH} characters')
return value.replace('\x00', '') return value.replace('\x00', '')