fix(app):
1. List operation node sub-variable comparison; 2. Non-Dashscope Omni model processing; 3.Handling the issue of disappearing iterative nodes
This commit is contained in:
@@ -112,7 +112,7 @@ class RedBearModelFactory:
|
|||||||
params["stream_usage"] = True
|
params["stream_usage"] = True
|
||||||
# 深度思考模式
|
# 深度思考模式
|
||||||
is_streaming = bool(config.extra_params.get("streaming"))
|
is_streaming = bool(config.extra_params.get("streaming"))
|
||||||
if is_streaming:
|
if is_streaming and not config.is_omni:
|
||||||
if provider == ModelProvider.VOLCANO:
|
if provider == ModelProvider.VOLCANO:
|
||||||
# 火山引擎深度思考仅流式调用支持,非流式时不传 thinking 参数
|
# 火山引擎深度思考仅流式调用支持,非流式时不传 thinking 参数
|
||||||
thinking_config: Dict[str, Any] = {
|
thinking_config: Dict[str, Any] = {
|
||||||
|
|||||||
@@ -483,11 +483,11 @@ class DifyConverter(BaseConverter):
|
|||||||
node_data = node["data"]
|
node_data = node["data"]
|
||||||
result = IterationNodeConfig.model_construct(
|
result = IterationNodeConfig.model_construct(
|
||||||
input=self._process_list_variable_literal(node_data["iterator_selector"]),
|
input=self._process_list_variable_literal(node_data["iterator_selector"]),
|
||||||
parallel=node_data["is_parallel"],
|
parallel=node_data.get("is_parallel", False),
|
||||||
parallel_count=node_data["parallel_nums"],
|
parallel_count=node_data.get("parallel_nums", 4),
|
||||||
output=self._process_list_variable_literal(node_data["output_selector"]),
|
output=self._process_list_variable_literal(node_data["output_selector"]),
|
||||||
output_type=self.variable_type_map(node_data.get("output_type")),
|
output_type=self.variable_type_map(node_data.get("output_type")),
|
||||||
flatten=node_data["flatten_output"],
|
flatten=node_data.get("flatten_output", False),
|
||||||
).model_dump()
|
).model_dump()
|
||||||
|
|
||||||
self.config_validate(node["id"], node["data"]["title"], IterationNodeConfig, result)
|
self.config_validate(node["id"], node["data"]["title"], IterationNodeConfig, result)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from app.core.workflow.variable.base_variable import VariableType
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# File object fields that hold string values
|
# File object fields that hold string values
|
||||||
_FILE_STRING_KEYS = {"name", "extension", "mime_type", "url", "transfer_method", "origin_file_type", "file_id"}
|
_FILE_STRING_KEYS = {"type", "name", "url", "extension", "mime_type", "transfer_method", "origin_file_type", "file_id"}
|
||||||
_FILE_NUMBER_KEYS = {"size"}
|
_FILE_NUMBER_KEYS = {"size"}
|
||||||
|
|
||||||
|
|
||||||
@@ -100,10 +100,17 @@ class ListOperatorNode(BaseNode):
|
|||||||
else:
|
else:
|
||||||
left = item # primitive array: compare element directly
|
left = item # primitive array: compare element directly
|
||||||
|
|
||||||
|
# Determine if this field should be compared as a string
|
||||||
|
is_string_field = isinstance(item, dict) and cond.key in _FILE_STRING_KEYS
|
||||||
|
|
||||||
# Numeric operators
|
# Numeric operators
|
||||||
if op == ComparisonOperator.EQ:
|
if op == ComparisonOperator.EQ:
|
||||||
|
if is_string_field:
|
||||||
|
return str(left) == str(value)
|
||||||
return self._safe_num(left) == self._safe_num(value)
|
return self._safe_num(left) == self._safe_num(value)
|
||||||
if op == ComparisonOperator.NE:
|
if op == ComparisonOperator.NE:
|
||||||
|
if is_string_field:
|
||||||
|
return str(left) != str(value)
|
||||||
return self._safe_num(left) != self._safe_num(value)
|
return self._safe_num(left) != self._safe_num(value)
|
||||||
if op == ComparisonOperator.LT:
|
if op == ComparisonOperator.LT:
|
||||||
return self._safe_num(left) < self._safe_num(value)
|
return self._safe_num(left) < self._safe_num(value)
|
||||||
|
|||||||
Reference in New Issue
Block a user