Browse Source

fix(api/core/app/segments/segments.py): Fix file to markdown. (#7293)

-LAN- 8 tháng trước cách đây
mục cha
commit
3f9720bca0
1 tập tin đã thay đổi với 7 bổ sung1 xóa
  1. 7 1
      api/core/app/segments/segments.py

+ 7 - 1
api/core/app/segments/segments.py

@@ -99,7 +99,13 @@ class ObjectSegment(Segment):
 class ArraySegment(Segment):
     @property
     def markdown(self) -> str:
-        return '\n'.join(['- ' + item.markdown for item in self.value])
+        items = []
+        for item in self.value:
+            if hasattr(item, 'to_markdown'):
+                items.append(item.to_markdown())
+            else:
+                items.append(str(item))
+        return '\n'.join(items)
 
 
 class ArrayAnySegment(ArraySegment):