mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
replace message content type list to string when file_objs is empty .. (#2745)
This commit is contained in:
parent
bd26c933d2
commit
237bb8514e
|
@ -47,11 +47,14 @@ class TokenBufferMemory:
|
||||||
files, message.app_model_config
|
files, message.app_model_config
|
||||||
)
|
)
|
||||||
|
|
||||||
prompt_message_contents = [TextPromptMessageContent(data=message.query)]
|
if not file_objs:
|
||||||
for file_obj in file_objs:
|
prompt_messages.append(UserPromptMessage(content=message.query))
|
||||||
prompt_message_contents.append(file_obj.prompt_message_content)
|
else:
|
||||||
|
prompt_message_contents = [TextPromptMessageContent(data=message.query)]
|
||||||
|
for file_obj in file_objs:
|
||||||
|
prompt_message_contents.append(file_obj.prompt_message_content)
|
||||||
|
|
||||||
prompt_messages.append(UserPromptMessage(content=prompt_message_contents))
|
prompt_messages.append(UserPromptMessage(content=prompt_message_contents))
|
||||||
else:
|
else:
|
||||||
prompt_messages.append(UserPromptMessage(content=message.query))
|
prompt_messages.append(UserPromptMessage(content=message.query))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user