mirror of
https://github.com/langgenius/dify.git
synced 2026-01-14 06:07:33 +08:00
fix: variable assigner can't assign float number (#28068)
This commit is contained in:
parent
1369119a0c
commit
6026bd873b
@ -808,7 +808,11 @@ class DraftVariableSaver:
|
|||||||
# We only save conversation variable here.
|
# We only save conversation variable here.
|
||||||
if selector[0] != CONVERSATION_VARIABLE_NODE_ID:
|
if selector[0] != CONVERSATION_VARIABLE_NODE_ID:
|
||||||
continue
|
continue
|
||||||
segment = WorkflowDraftVariable.build_segment_with_type(segment_type=item.value_type, value=item.new_value)
|
# Conversation variables are exposed as NUMBER in the UI even if their
|
||||||
|
# persisted type is INTEGER. Allow float updates by loosening the type
|
||||||
|
# to NUMBER here so downstream storage infers the precise subtype.
|
||||||
|
segment_type = SegmentType.NUMBER if item.value_type == SegmentType.INTEGER else item.value_type
|
||||||
|
segment = WorkflowDraftVariable.build_segment_with_type(segment_type=segment_type, value=item.new_value)
|
||||||
draft_vars.append(
|
draft_vars.append(
|
||||||
WorkflowDraftVariable.new_conversation_variable(
|
WorkflowDraftVariable.new_conversation_variable(
|
||||||
app_id=self._app_id,
|
app_id=self._app_id,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user