UnrealVoxta 0.1.1
 
Loading...
Searching...
No Matches
FChatMessage Struct Reference

FChatMessage Represents a single message in a chat conversation, containing both text and audio data. More...

#include <ChatMessage.h>

Public Member Functions

const FGuid & GetMessageId () const
 Get the unique identifier assigned to this message.
 
const FGuid & GetCharId () const
 Get the ID of the character who sent this message.
 
FStringView GetTextContent () const
 Get the current text content of the message.
 
const TArray< FString > & GetAudioUrls () const
 Get the list of audio URLs for this message's synthesized speech.
 
bool GetIsComplete () const
 Check if this message is complete with no further chunks expected.
 
bool TryAppendMoreContent (const FString &textContent, const FString &audioUrl)
 Add more data to this message, as VoxtaServer notifies us of the complete data in chunks.
 
void MarkComplete ()
 Mark this message as complete, indicating no further chunks are expected.
 
 FChatMessage (FGuid messageId, FGuid charId)
 Create an instance of the chat message for the User data.
 
 FChatMessage ()=default
 Default constructor.
 

Detailed Description

FChatMessage Represents a single message in a chat conversation, containing both text and audio data.

Messages can be built up incrementally as chunks are received from the server. A message is considered complete only after being marked as such.

Constructor & Destructor Documentation

◆ FChatMessage() [1/2]

FChatMessage::FChatMessage ( FGuid messageId,
FGuid charId )
inlineexplicit

Create an instance of the chat message for the User data.

The notification by VoxtaServer of a new message is always without text, so it will be empty at first.

Parameters
messageIdThe VoxtaServer assigned id of this message.
charIdThe VoxtaServer assigned id of the character that says this message.

◆ FChatMessage() [2/2]

FChatMessage::FChatMessage ( )
default

Default constructor.

Member Function Documentation

◆ GetAudioUrls()

const TArray< FString > & FChatMessage::GetAudioUrls ( ) const
inline

Get the list of audio URLs for this message's synthesized speech.

Used to retrieve audio content for playback.

Returns
Array of audio URL strings.

◆ GetCharId()

const FGuid & FChatMessage::GetCharId ( ) const
inline

Get the ID of the character who sent this message.

Used to identify the sender of the message.

Returns
The sender's character ID.

◆ GetIsComplete()

bool FChatMessage::GetIsComplete ( ) const
inline

Check if this message is complete with no further chunks expected.

Used to determine if message content is finalized.

Returns
True if message is complete, false if still receiving chunks.

◆ GetMessageId()

const FGuid & FChatMessage::GetMessageId ( ) const
inline

Get the unique identifier assigned to this message.

Used to track and reference this specific message.

Returns
The message's unique ID.

◆ GetTextContent()

FStringView FChatMessage::GetTextContent ( ) const
inline

Get the current text content of the message.

May be incomplete if message is still being received.

Returns
The current message text.

◆ MarkComplete()

void FChatMessage::MarkComplete ( )
inline

Mark this message as complete, indicating no further chunks are expected.

◆ TryAppendMoreContent()

bool FChatMessage::TryAppendMoreContent ( const FString & textContent,
const FString & audioUrl )
inline

Add more data to this message, as VoxtaServer notifies us of the complete data in chunks.

Parameters
textContentThe new text that will be appended to what we already had.
audioUrlThe new audio (sub)url that will be registered as required for playback.

The documentation for this struct was generated from the following file: