fix(api/core/app/segments): Allow to contains boolean value in object segment (#7047)

This commit is contained in:
-LAN-
2024-08-07 16:20:22 +08:00
committed by GitHub
parent 72c75b75cf
commit aad02113c6
4 changed files with 7 additions and 21 deletions

View File

@@ -75,8 +75,7 @@ def build_segment(value: Any, /) -> Segment:
return FloatSegment(value=value)
if isinstance(value, dict):
# TODO: Limit the depth of the object
obj = {k: build_segment(v) for k, v in value.items()}
return ObjectSegment(value=obj)
return ObjectSegment(value=value)
if isinstance(value, list):
# TODO: Limit the depth of the array
elements = [build_segment(v) for v in value]