Back to Portal
Phase 02 / Data Injection

Input: Session Push

Message Normalization, Incremental Sync, and Multi-path Input

01 / Sync Sequence Map
            sequenceDiagram
                participant GT as Game Thread
                participant PL as Plugin Layer
                participant K as Kernel (VRAM)
                
                GT->>PL: Send Message Array (Messages)
                PL->>PL: Role Normalization (Gemma Support)
                PL->>PL: Delta Check (Incremental)
                PL->>K: Push Physical Token Delta
                Note right of K: Background Inference Starts
                PL-->>GT: Immediate Return (Non-blocking)
            
02 / Implementation Paths

Path A: Full Static API (Low Level)

For scenarios requiring custom history management and sampling.

// Physical Pointer Binding + Delta Push
FLiteRtLmUnrealApi::SendChatRequest(AgentPtr, Messages, ...);

Path B: Component Driven (Common)

Encapsulated via ULiteRtLmComponent. Handles AgentPtr hashing automatically.

// Simple BP or C++ call
MyBrainComponent->SendChatMessage(UserMessageText);
03 / Related Concepts
PROTOCOLIncremental Sync

We only push new tokens. This significantly reduces Prefill latency in long conversations by leveraging persistent KV Cache.

NORMALIZATIONGemma Role Alignment

The plugin automatically merges system prompts into the first user message to maintain compatibility with lightweight models.