mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 19:36:53 +08:00
fix(api/core/app/segments/segments.py): Fix file to markdown. (#7293)
This commit is contained in:
@@ -99,7 +99,13 @@ class ObjectSegment(Segment):
|
|||||||
class ArraySegment(Segment):
|
class ArraySegment(Segment):
|
||||||
@property
|
@property
|
||||||
def markdown(self) -> str:
|
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):
|
class ArrayAnySegment(ArraySegment):
|
||||||
|
|||||||
Reference in New Issue
Block a user