Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

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

-LAN-3f9720bca07f
diff --git a/api/core/app/segments/segments.py b/api/core/app/segments/segments.py
index 321bc0ad020..5c713cac674 100644
--- a/api/core/app/segments/segments.py
+++ b/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):