refactor: Improve handling of message content in HumanMessage object
This commit is contained in:
parent
ba343be992
commit
25eed67f98
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue