FChatSession Data struct containing all the relevant information regarding a chat session between the user and AI characters. More...
#include <ChatSession.h>
Public Member Functions | |
const TArray< FChatMessage > & | GetChatMessages () |
Get the chat message history for this session. | |
FGuid | GetSessionId () const |
Get the VoxtaServer assigned ID of this session. | |
const TMap< VoxtaServiceType, FVoxtaServiceEntryData > & | GetActiveServices () const |
Get the services that were enabled when the chat session was started. | |
void | UpdateContext (const FString &newContext) |
Update the context of the ongoing chat session. | |
void | AddChatMessage (const FChatMessage &message) |
Add a new chat message to the session. | |
void | RemoveChatMessage (const FGuid &messageID) |
Remove a chat message from the session by message ID. | |
FChatMessage * | GetChatMessageById (const FGuid &messageId) |
Fetch a raw pointer to the ChatMessage that matches the given ID. | |
FChatSession (const TArray< const FAiCharData * > &characters, FGuid chatId, FGuid sessionId, const TMap< VoxtaServiceType, FVoxtaServiceEntryData > &services, FStringView chatContext) | |
Create a new instance of the ChatSession, containing all relevant data to it. | |
FChatSession ()=default | |
Default constructor. | |
FGuid | GetChatId () const |
Get the VoxtaServer assigned ID of this chat session. | |
FStringView | GetChatContext () const |
Get the current context of the chat session. | |
const TArray< FGuid > & | GetCharacterIds () const |
Get the list of character IDs in the chat session. | |
FChatSession Data struct containing all the relevant information regarding a chat session between the user and AI characters.
Acts as the single source of truth for chat state, message history, and available services. Thread-safe for concurrent read/write access.
|
inlineexplicit |
Create a new instance of the ChatSession, containing all relevant data to it.
characters | The AIcharacters participating in the chat session. |
chatId | The VoxtaServer assigned id of this Chat. |
sessionId | The VoxtaServer assigned id of this Session. |
services | The VoxtaServer services that are enabled for this chat session. |
|
default |
Default constructor.
|
inline |
Add a new chat message to the session.
message | The chat message to add. |
|
inline |
Get the services that were enabled when the chat session was started.
Used by VoxtaClient to know if it should notify audio playback handlers, mic input, etc.
|
inline |
Get the list of character IDs in the chat session.
Used to identify which characters are participating.
|
inline |
Get the current context of the chat session.
Used to retrieve the current context text that influences the AI's responses.
|
inline |
Get the VoxtaServer assigned ID of this chat session.
Used as the session identifier for HTTP requests and WebSocket messages.
|
inline |
Fetch a raw pointer to the ChatMessage that matches the given ID.
Note: The text & audio in this data is not guaranteed to be complete until the message is finalized.
messageId | The ID of the chat message to retrieve. |
|
inline |
Get the chat message history for this session.
Can be used to add, remove, and update chat message entries. Acts as the source-of-truth for what has been said so far.
|
inline |
Get the VoxtaServer assigned ID of this session.
Used as required data for some VoxtaServer API calls.
|
inline |
Remove a chat message from the session by message ID.
messageID | The ID of the chat message to remove. |
|
inline |
Update the context of the ongoing chat session.
newContext | The new context for the ongoing chat session. |