Overview
The VoxtaData module provides the foundational data structures and type definitions for the UnrealVoxta plugin. It contains read-only & mutable data containers, server response types, state enums, and service definitions that form the core data model for Voxta's chat system.
Module Structure
Character Data Models
BaseCharData
: Base class for character data structures
UserCharData
: User/player character representation
AiCharData
: AI character data with additional metadata
Chat Models
ChatSession
: Container for active chat session state
ChatMessage
: Individual message data structure
MessageChunkState
: Message chunk processing states
Server Response Models
ServerResponseBase
: Base class for all server responses
ServerResponseType
: Supported response types enum
- Specialized response classes for different server events:
- Welcome/Authentication
- Chat operations (messages, started, update, etc.)
- Speech transcription
- etc.
Service Models
Sequence diagram
The general flow of how the data structures are populated by VoxtaServer responses.
Thread Safety
The module implements thread-safe data structures where needed:
FChatSession
is thread-safe for concurrent read/write access
FChatMessage
supports incremental updates from different threads
- Server response objects are always immutable
Features
Chat Session Management
characterArray,
chatId,
sessionId,
enabledServices,
contextString
);
const TArray<FChatMessage>& messages = chatSession.GetChatMessages();
const TArray<FGuid>& participants = chatSession.GetCharacterIds();
FStringView context = chatSession.GetChatContext();
chatSession.AddChatMessage(newMessage);
chatSession.UpdateContext(newContextText);
chatSession.RemoveChatMessage(messageId);
FChatSession Data struct containing all the relevant information regarding a chat session between the...
Definition ChatSession.h:20
Character Data Handling
characterId,
characterName,
creatorNotes,
isExplicit,
isFavorited,
thumbnailUrl,
packageId,
packageName
);
FGuid id = aiChar.GetId();
FStringView name = aiChar.GetName();
FString thumbnail = aiChar.GetThumbnailUrl();
bool isExplicit = aiChar.GetAllowedExplicitContent();
FAiCharData Read-only data struct containing all the relevant information for an AI character.
Definition AiCharData.h:21
Message Management
message.TryAppendMoreContent(textChunk, audioUrlPath);
message.MarkComplete();
bool isComplete = message.GetIsComplete();
FStringView text = message.GetTextContent();
const TArray<FString>& audioUrls = message.GetAudioUrls();
FChatMessage Represents a single message in a chat conversation, containing both text and audio data.
Definition ChatMessage.h:16
Version Management
bool isApiCompatible = versionData.IsMatchingAPIVersion();
bool isServerCompatible = versionData.IsMatchingServerVersion();
FStringView targetApi = versionData.GetCompatibleAPIVersion();
FStringView currentApi = versionData.GetApiVersion();
FVoxtaVersionData Data struct for managing version compatibility between the UnrealVoxta client and V...
Definition VoxtaVersionData.h:17
Dependencies
Licensing
MIT license - copyright (c) 2024 grrimgrriefer & DZnnah. See LICENSE in root for details.