refactor: Update Message.from_data method parameter name

Update the Message.from_data method in message.py to change the parameter name from "record" to "data". This change improves clarity and consistency in the codebase.
This commit is contained in:
ogabrielluiz 2024-06-13 00:20:20 -03:00
commit c956aed61b

View file

@ -68,7 +68,7 @@ class Message(BaseModel):
return AIMessage(content=self.text) return AIMessage(content=self.text)
@classmethod @classmethod
def from_data(cls, record: Data) -> "Message": def from_data(cls, data: Data) -> "Message":
""" """
Converts a BaseMessage to a Data. Converts a BaseMessage to a Data.
@ -80,13 +80,13 @@ class Message(BaseModel):
""" """
return cls( return cls(
text=record.text, text=data.text,
sender=record.sender, sender=data.sender,
sender_name=record.sender_name, sender_name=data.sender_name,
files=record.files, files=data.files,
session_id=record.session_id, session_id=data.session_id,
timestamp=record.timestamp, timestamp=data.timestamp,
flow_id=record.flow_id, flow_id=data.flow_id,
) )
@field_serializer("text", mode="plain") @field_serializer("text", mode="plain")