Fix typing for previous message

This commit is contained in:
hagen-danswer 2024-07-29 09:58:14 -07:00 committed by Chris Weaver
parent 38af12ab97
commit ea9a9cb553

View File

@ -42,7 +42,7 @@ def translate_danswer_msg_to_langchain(
# If the message is a `ChatMessage`, it doesn't have the downloaded files
# attached. Just ignore them for now. Also, OpenAI doesn't allow files to
# be attached to AI messages, so we must remove them
if isinstance(msg, PreviousMessage) and msg.message_type != MessageType.ASSISTANT:
if not isinstance(msg, ChatMessage) and msg.message_type != MessageType.ASSISTANT:
files = msg.files
content = build_content_with_imgs(msg.message, files)