Skip to content

Commit 7ad2668

Browse files
authored
docs: add docstring to build_message (#547)
1 parent c7b011b commit 7ad2668

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/rai_core/rai/communication/hri_connector.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,27 @@ def build_message(
150150
seq_no: int = 0,
151151
seq_end: bool = False,
152152
) -> T:
153+
"""
154+
Build a new message object from a given input message.
155+
156+
Parameters
157+
----------
158+
message : LangchainBaseMessage or RAIMultimodalMessage
159+
The source message to transform into the target type.
160+
communication_id : str, optional
161+
An optional identifier for the communication session. Defaults to `None`.
162+
seq_no : int, optional
163+
The sequence number of the message in the communication stream. Defaults to `0`.
164+
seq_end : bool, optional
165+
Flag indicating whether this message is the final one in the sequence. Defaults to `False`.
166+
167+
Returns
168+
-------
169+
T
170+
A message instance of type `T` compatible with the Connector, created from the provided input.
171+
172+
Notes
173+
-----
174+
This method uses `self.T_class.from_langchain` for conversion and assumes compatibility.
175+
"""
153176
return self.T_class.from_langchain(message, communication_id, seq_no, seq_end) # type: ignore

0 commit comments

Comments
 (0)