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:
parent
f823d5ccf7
commit
c956aed61b
1 changed files with 8 additions and 8 deletions
|
|
@ -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")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue