Skip to content
Merged
5 changes: 4 additions & 1 deletion apps/application/flow/compare/is_not_null_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ def support(self, node_id, fields: List[str], source_value, compare, target_valu
return True

def compare(self, source_value, compare, target_value):
return source_value is not None and len(source_value) > 0
try:
return source_value is not None and len(source_value) > 0
except Exception:
return True
Copy link
Copy Markdown
Contributor Author

@wangliang181230 wangliang181230 Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

len(source_value) 可能会抛出异常,捕获处理。
因为抛出异常时 source_value is not None 已经判定为 True,表示对象不为空,所以len方法出现异常后,直接 return True

2 changes: 1 addition & 1 deletion apps/common/handle/impl/qa/csv_parse_qa_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

def read_csv_standard(file_path):
data = []
with open(file_path, 'r') as file:
with open(file_path, 'r', encoding='utf-8') as file:
reader = csv.reader(file)
for row in reader:
data.append(row)
Expand Down
6 changes: 3 additions & 3 deletions apps/local_model/serializers/model_apply_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ def get_embedding_model(model_id):


class EmbedDocuments(serializers.Serializer):
texts = serializers.ListField(required=True, child=serializers.CharField(required=True,
label=_('vector text')),
label=_('vector text list')),
texts = serializers.ListField(required=True,
child=serializers.CharField(required=True, label=_('vector text')),
label=_('vector text list'))


class EmbedQuery(serializers.Serializer):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ def generate_image(self, prompt: str, negative_prompt: str = None):

return file_urls
except Exception as e:
raise f"OpenAI generate image error: {e}"
raise RuntimeError(f"OpenAI generate image error: {e}") from e
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ def generate_image(self, prompt: str, negative_prompt: str = None):
file_urls.append(url)
return file_urls
except Exception as e:
raise f"RegoloTextToImage generate_image error: {e}"
raise RuntimeError(f"RegoloTextToImage generate_image error: {e}") from e
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ def generate_image(self, prompt: str, negative_prompt: str = None):
return file_urls
except TencentCloudSDKException as err:
maxkb_logger.error(f"Tencent Text to Image API call failed: {err}")
raise f"Tencent Text to Image API call failed: {err}"
raise RuntimeError(f"Tencent Text to Image API call failed: {err}") from err
6 changes: 3 additions & 3 deletions apps/models_provider/serializers/model_apply_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def get_embedding_model(model_id):


class EmbedDocuments(serializers.Serializer):
texts = serializers.ListField(required=True, child=serializers.CharField(required=True,
label=_('vector text')),
label=_('vector text list')),
texts = serializers.ListField(required=True,
child=serializers.CharField(required=True, label=_('vector text')),
label=_('vector text list'))


class EmbedQuery(serializers.Serializer):
Expand Down
4 changes: 2 additions & 2 deletions apps/oss/serializers/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ def _is_unsafe_ip(self, ip: str) -> bool:
def get_url_content(url, application_id: str):
application = Application.objects.filter(id=application_id).first()
if application is None:
return AppApiException(500, _('Application does not exist'))
raise AppApiException(500, _('Application does not exist'))
if not application.file_upload_enable:
return AppApiException(500, _('File upload is not enabled'))
raise AppApiException(500, _('File upload is not enabled'))
Copy link
Copy Markdown
Contributor Author

@wangliang181230 wangliang181230 Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

关键字错误,这个方法并不是一个返回异常对象的方法。

file_limit = 50 * 1024 * 1024
if application.file_upload_setting and application.file_upload_setting.get('fileLimit'):
file_limit = application.file_upload_setting.get('fileLimit') * 1024 * 1024
Expand Down
5 changes: 2 additions & 3 deletions ui/src/workflow/nodes/intent-classify-node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,11 @@ class IntentModel extends AppNodeModel {
})

if (branch_condition_list) {

const FORM_ITEMS_HEIGHT = 397 // 上方表单占用高度

for (let index = 0; index < branch_condition_list.length; index++) {
const element = branch_condition_list[index]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix style

anchors.push({
x: x + width / 2 - 10,
y: showNode
Expand Down
Loading