Skip to content

Commit

Permalink
fix(api/core/app/segments/segments.py): Fix file to markdown. (langge…
Browse files Browse the repository at this point in the history
  • Loading branch information
laipz8200 authored and cuiks committed Sep 2, 2024
1 parent c7405f7 commit 4a019a8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion api/core/app/segments/segments.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,13 @@ def markdown(self) -> str:
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):
Expand Down

0 comments on commit 4a019a8

Please sign in to comment.