Documentation Index
Fetch the complete documentation index at: https://docs.inworld.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview > Inworld Conversation Group
Class: UInworldConversationGroup | Inherits from: UObject
Manages multi-character conversations in the Inworld system. This class orchestrates conversations between multiple AI characters and a player, handling message routing, speaker selection, conversation state management, and event history. It implements the IInworldConversationTarget interface to act as a unified conversation endpoint.
Key Features:
-
Multi-character conversation management
-
Intelligent speaker selection system
-
Rule-based speaker selection for deterministic turn order
-
Message broadcasting to all participants
-
Conversation state and history tracking
-
Player target integration
-
Event system for conversation monitoring
-
Dynamic participant management
Usage:
-
Create via static CreateConversation methods
-
Add characters using AddCharacter
-
Set player target for interaction
-
Configure rule director for deterministic speaker sequences (optional)
-
Messages sent to the group are intelligently routed to appropriate characters
-
Participants respond based on context and speaker selection algorithms
Methods
Reference
AddCharacter
Adds a character to the conversation group.
The character will receive messages sent to the group and can participate
in speaker selection for responses.
Examples
virtual void AddCharacter(UInworldCharacterComponent* CharacterComponent)
Parameters
| Parameter | Type | Description |
|---|
| CharacterComponent | UInworldCharacterComponent* | The character component to add to the conversation |
Returns
Type: virtual void
ClearHistory
Clears the group’s event history data, resetting all stored interactions.
This method ensures that the event history runtime data is wiped clean,
removing all previously recorded conversation or event entries. It logs an
error message if the event history data is null or invalid.
Examples
void ClearHistory(bool IncludeCharacters)
Parameters
| Parameter | Type | Description |
|---|
| IncludeCharacters | bool | (optional) If true (false by default), clear the history of all characters in the conversation. |
CreateConversation
Creates a new conversation group asynchronously (Blueprint version).
Examples
void CreateConversation(
UObject* WorldContextObject,
UObject* Owner,
FOnInworldConversationGroupCreated Callback,
UInworldGraphAsset* SpeakerSelectionGraphAsset
)
Parameters
| Parameter | Type | Description |
|---|
| WorldContextObject | UObject* | World context for the conversation |
| Owner | UObject* | The object that owns this conversation group |
| Callback | FOnInworldConversationGroupCreated | Delegate called when creation is complete |
| SpeakerSelectionGraphAsset | UInworldGraphAsset* | (optional) The graph asset for the speaker selection graph |
GetConversationState
Gets the current state of the conversation.
Examples
FInworldConversationState GetConversationState()
Returns
Type: FInworldConversationState
Description: The conversation state data
GetParticipants
Gets all character participants in the conversation.
Examples
TArray<UInworldCharacterComponent*> GetParticipants()
Returns
Type: TArray<UInworldCharacterComponent*>
Description: Array of character components participating in the conversation
GetPlayerTarget
Gets the current player target for the conversation.
Examples
UInworldBasePlayerComponent* GetPlayerTarget()
Returns
Type: UInworldBasePlayerComponent*
Description: The player component currently interacting with this conversation
InvokeNextResponse
Manually invokes the next character response in the conversation.
Examples
virtual void InvokeNextResponse(const FString& CharacterId)
Parameters
| Parameter | Type | Description |
|---|
| CharacterId | const FString& | Optional specific character ID to respond. If empty, uses speaker selection. |
Returns
Type: virtual void
RemoveCharacter
Removes a character from the conversation group.
Examples
virtual void RemoveCharacter(FString CharacterId)
Parameters
| Parameter | Type | Description |
|---|
| CharacterId | FString | The unique ID of the character to remove |
Returns
Type: virtual void
RemovePlayerTarget
Removes the current player target from this conversation group.
Examples
void RemovePlayerTarget()
SetPlayerTarget
Sets the player target for this conversation group.
Examples
SetRuleDirector
Sets the rule director for deterministic speaker selection in this conversation group. The rule director allows you to override the AI-driven speaker selection with a predefined sequence of speakers, useful for turn-based games or scripted dialogue scenarios.
Examples
void SetRuleDirector(USpeakerRuleDirector* InRuleDirector)
Parameters
| Parameter | Type | Description |
|---|
| InRuleDirector | USpeakerRuleDirector* | The rule director instance to use for speaker selection. This is typically set in the editor on the component. |