refactor: Improve handling of message content in HumanMessage object

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-06-21 15:42:33 -03:00
commit 25eed67f98

View file

@ -79,8 +79,12 @@ class Message(Data):
contents.extend(self.get_file_content_dicts())
human_message = HumanMessage(content=contents) # type: ignore
else:
if not isinstance(self.text, str):
text = ""
else:
text = self.text
human_message = HumanMessage(
content=self.text,
content=text,
)
return human_message