refactor: Support the generated images horizontal tiling display

--story=1017907 --user=刘瑞斌 【越秀农牧】图片生成节点,生成的图片,希望可以支持横向平铺展示 https://www.tapd.cn/57709429/s/1659636
This commit is contained in:
CaptainB 2025-02-27 10:57:17 +08:00 committed by 刘瑞斌
parent 1811a80ecc
commit c92ad06092

View File

@ -47,7 +47,7 @@ class BaseImageGenerateNode(IImageGenerateNode):
file_url = FileSerializer(data={'file': file, 'meta': meta}).upload()
file_urls.append(file_url)
self.context['image_list'] = [{'file_id': path.split('/')[-1], 'url': path} for path in file_urls]
answer = '\n'.join([f"![Image]({path})" for path in file_urls])
answer = ' '.join([f"![Image]({path})" for path in file_urls])
return NodeResult({'answer': answer, 'chat_model': tti_model, 'message_list': message_list,
'image': [{'file_id': path.split('/')[-1], 'url': path} for path in file_urls],
'history_message': history_message, 'question': question}, {})