Skip to content

Commit

Permalink
refactor: Image generate model history message show images
Browse files Browse the repository at this point in the history
  • Loading branch information
liuruibin committed Dec 16, 2024
1 parent 64443ee commit fcd305a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ def generate_history_ai_message(self, chat_record):
if self.node.id == val['node_id'] and 'image_list' in val:
if val['dialogue_type'] == 'WORKFLOW':
return chat_record.get_ai_message()
return AIMessage(content=val['answer'])
image_list = val['image_list']
return AIMessage(content=[
*[{'type': 'image_url', 'image_url': {'url': f'{file_url}'}} for file_url in image_list]
])
return chat_record.get_ai_message()

def get_history_message(self, history_chat_record, dialogue_number):
Expand Down

0 comments on commit fcd305a

Please sign in to comment.