Skip to content

Commit ef4dc9e

Browse files
wangiiiNov1c444
authored andcommitted
Fixed the issue where recall the knowledge base in the iteration of the workflow and report errors when executing (#10060)
1 parent e2d4044 commit ef4dc9e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

api/factories/variable_factory.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
ArrayNumberVariable,
1111
ArrayObjectSegment,
1212
ArrayObjectVariable,
13+
ArraySegment,
1314
ArrayStringSegment,
1415
ArrayStringVariable,
1516
FileSegment,
@@ -79,7 +80,7 @@ def build_segment(value: Any, /) -> Segment:
7980
if isinstance(value, list):
8081
items = [build_segment(item) for item in value]
8182
types = {item.value_type for item in items}
82-
if len(types) != 1:
83+
if len(types) != 1 or all(isinstance(item, ArraySegment) for item in items):
8384
return ArrayAnySegment(value=value)
8485
match types.pop():
8586
case SegmentType.STRING:

0 commit comments

Comments
 (0)