5#include "CoreMinimal.h"
10#include "ChatSession.generated.h"
18USTRUCT(BlueprintType, Category =
"Voxta")
23#pragma region public API
34 return m_chatMessages;
63 m_chatContext = newContext;
73 m_chatMessages.Add(message);
83 int index = m_chatMessages.IndexOfByPredicate([messageID] (
const FChatMessage& InItem)
88 if (index != INDEX_NONE)
90 m_chatMessages.RemoveAt(index);
103 return m_chatMessages.FindByPredicate([&messageId] (
const FChatMessage& msg)
120 const TMap<VoxtaServiceType, FVoxtaServiceEntryData>& services,
121 FStringView chatContext) :
123 m_sessionId(sessionId),
124 m_chatContext(chatContext),
125 m_characters(characters),
128 m_characterIds.Reserve(characters.Num());
131 m_characterIds.Emplace(character->GetId());
165 UPROPERTY(BlueprintReadOnly, Category =
"Voxta", meta = (AllowPrivateAccess =
"true", DisplayName =
"Chat ID"))
168 UPROPERTY(BlueprintReadOnly, Category =
"Voxta", meta = (AllowPrivateAccess =
"true", DisplayName =
"Session ID"))
171 UPROPERTY(BlueprintReadOnly, Category =
"Voxta", meta = (AllowPrivateAccess =
"true", DisplayName =
"Character IDs"))
172 TArray<FGuid> m_characterIds;
174 UPROPERTY(BlueprintReadOnly, Category =
"Voxta", meta = (AllowPrivateAccess =
"true", DisplayName =
"Context"))
175 FString m_chatContext;
177 UPROPERTY(BlueprintReadOnly, Category =
"Voxta", meta = (AllowPrivateAccess =
"true", DisplayName =
"Messages so far"))
182 UPROPERTY(BlueprintReadOnly, Category =
"Voxta", meta = (AllowPrivateAccess =
"true", DisplayName =
"Services"))
VoxtaServiceType
VoxtaServiceType All the possible VoxtaServer Services that the UnrealVoxta client currently supports...
Definition VoxtaServiceType.h:20
FAiCharData Read-only data struct containing all the relevant information for an AI character.
Definition AiCharData.h:21
FChatMessage Represents a single message in a chat conversation, containing both text and audio data.
Definition ChatMessage.h:16
const FGuid & GetMessageId() const
Get the unique identifier assigned to this message.
Definition ChatMessage.h:27
FGuid GetChatId() const
Get the VoxtaServer assigned ID of this chat session.
Definition ChatSession.h:144
void UpdateContext(const FString &newContext)
Update the context of the ongoing chat session.
Definition ChatSession.h:61
const TMap< VoxtaServiceType, FVoxtaServiceEntryData > & GetActiveServices() const
Get the services that were enabled when the chat session was started.
Definition ChatSession.h:51
FChatSession()=default
Default constructor.
void AddChatMessage(const FChatMessage &message)
Add a new chat message to the session.
Definition ChatSession.h:71
const TArray< FGuid > & GetCharacterIds() const
Get the list of character IDs in the chat session.
Definition ChatSession.h:160
void RemoveChatMessage(const FGuid &messageID)
Remove a chat message from the session by message ID.
Definition ChatSession.h:81
FChatMessage * GetChatMessageById(const FGuid &messageId)
Fetch a raw pointer to the ChatMessage that matches the given ID.
Definition ChatSession.h:101
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.
Definition ChatSession.h:117
const TArray< FChatMessage > & GetChatMessages()
Get the chat message history for this session.
Definition ChatSession.h:32
FGuid GetSessionId() const
Get the VoxtaServer assigned ID of this session.
Definition ChatSession.h:43
FStringView GetChatContext() const
Get the current context of the chat session.
Definition ChatSession.h:152
FVoxtaServiceEntryData Data struct representing a specific serviceEntry provided within the VoxtaServ...
Definition VoxtaServiceEntryData.h:17