refactor(api/core/app/segments): implement to_object in ObjectVariable and ArrayVariable. (#6671)

Signed-off-by: -LAN- <laipz8200@outlook.com>
This commit is contained in:
-LAN-
2024-07-25 17:06:38 +08:00
committed by GitHub
parent 0b4c26578e
commit 75e6576c67
2 changed files with 6 additions and 6 deletions

View File

@@ -34,12 +34,6 @@ class Segment(BaseModel):
return str(self.value)
def to_object(self) -> Any:
if isinstance(self.value, Segment):
return self.value.to_object()
if isinstance(self.value, list):
return [v.to_object() for v in self.value]
if isinstance(self.value, dict):
return {k: v.to_object() for k, v in self.value.items()}
return self.value