SmartSession.Message
Wisej.AI.SmartSession Message
Last updated
Wisej.AI.SmartSession Message
Last updated
Namespace: Wisej.AI
Assembly: Wisej.AI (3.5.0.0)
Represents a message within a SmartSession, containing various types of content such as text, image, and binary data.
The Message
class is used to encapsulate different types of content that can be part of a session. It includes properties for text, image, and binary content, as well as methods to retrieve role and image data in specific formats.
Initializes a new instance of .
: Gets or sets the binary content of the message.
: Gets the "finish_reason" returned by the model.
Converts the image content of the message to a Base64 string.
If the image is null, an empty string is returned. Otherwise, the image is serialized to a Base64 string.
Converts the image content of the message to a Base64 Data URL string.
If the image is null, an empty string is returned. Otherwise, the image is serialized to a Base64 Data URL string.
Returns the media type string for the image content.
Retrieves the role of the message as a string.
The method returns a string representation of the message role, which can be "system", "assistant", or "user".
: Gets or sets the image content of the message.
: Gets or sets the role associated with the message.
: Gets or sets the text content of the message.
: Gets the usage metrics associated with the message.
Returns: . A Base64 string representation of the image content.
Returns: . A Base64 Data URL string representation of the image content.
Returns: . The media type string, or an empty string if the image is null.
Returns: . A string representing the role of the message.