Class UTryllAgentComponent¶
ClassList > UTryllAgentComponent
#include <TryllAgentComponent.h>
Inherits the following classes: UActorComponent
Public Attributes¶
| Type | Name |
|---|---|
| FTryllGraphDescription | InlineGraphDescription |
| TArray< FTryllVariableDecl > | InlineVariables |
| ETryllKvCacheInitialization | KvCacheInitialization = ETryllKvCacheInitialization::AllocateOnly |
| FOnTryllAgentReady | OnAgentReady |
| FOnTryllAgentAnswerFull | OnAnswerFull |
| FOnTryllAgentAnswerText | OnAnswerText |
| FOnTryllAppendInteractionsError | OnAppendInteractionsError |
| FOnTryllAgentError | OnError |
| FOnTryllInteractionsAppended | OnInteractionsAppended |
| FOnTryllInteractionsRemoved | OnInteractionsRemoved |
| FOnTryllKvCacheEvictError | OnKvCacheEvictError |
| FOnTryllKvCacheEvicted | OnKvCacheEvicted |
| FOnTryllKvCachePrefillError | OnKvCachePrefillError |
| FOnTryllKvCachePrefilled | OnKvCachePrefilled |
| FOnTryllKvCacheStatus | OnKvCacheStatus |
| FOnTryllKvCacheStatusError | OnKvCacheStatusError |
| FOnTryllParamChanged | OnParamChanged |
| FOnTryllRemoveInteractionsError | OnRemoveInteractionsError |
| FOnTryllResumed | OnResumed |
| FOnTryllAgentTurnComplete | OnTurnComplete |
| TObjectPtr< UTryllSpeakerComponent > | Speaker = nullptr |
| TArray< FTryllVariableOverride > | VariableOverrides |
| UTryllWorkflowAsset * | WorkflowAsset = nullptr |
| ETryllWorkload | Workload = ETryllWorkload::Interactive |
| bool | bAutoCreateOnConnect = true |
| bool | bEnableDiagnostics = false |
| bool | bMaintainDialogueHistory = true |
Public Functions¶
| Type | Name |
|---|---|
| void | AppendInteractions (const TArray< FTryllDialogInteraction > & Interactions) |
| void | Cancel (ETryllCancelMode Mode=ETryllCancelMode::StopAndKeep) |
| void | ChangeParams (const FString & NodeName, UTryllNodeParamsBase * Params) |
| void | CreateAgent () |
| void | DestroyAgent () |
| void | EvictKvCache () |
| int64 | GetAgentId () const |
| void | GetKvCacheStatus () |
| FTryllAgentVariables * | GetLiveVariables () |
| UTryllNodeParamsBase * | GetNodeParamsBaseline (const FString & NodeName) const |
| TArray< FString > | GetStartNodeOptions () const |
| UTryllAgentVariables * | GetVariables () |
| bool | HasLiveAgent () const |
| bool | HasPausedToolBatch () const |
| bool | IsAgentReady () const |
| void | PrefillKvCache () |
| void | RegisterTool (const FString & ToolName, FTryllToolHandler Handler) |
| void | RegisterTool (const FString & ToolName, FTryllSimpleToolHandler Handler) |
| void | RemoveInteractionsFromEnd (int32 Count) |
| void | Resume (const FString & ResumeNode=TEXT("")) |
| void | ResumeWithToolResult (const FTryllToolResult & ToolResult, const FString & ResumeNode=TEXT("")) |
| void | ResumeWithToolResults (const TArray< FTryllToolResult > & ToolResults, const FString & ResumeNode=TEXT("")) |
| void | RetryPausedToolBatch () |
| void | SendMessage (const FString & Message) |
| UTryllAgentComponent () |
|
| bool | UnregisterTool (const FString & ToolName) |
Protected Functions¶
| Type | Name |
|---|---|
| virtual void | BeginPlay () override |
| virtual void | EndPlay (const EEndPlayReason::Type EndPlayReason) override |
Detailed Description¶
Actor component: manages one Tryll server-side agent. Attach to any Actor; Blueprint users bind to the delegates and call SendMessage().
Graph resolution order: * WorkflowAsset (if set) — designer-authored data asset in the Content Browser. This is the supported way to give the component a graph. * InlineGraphDescription — set programmatically in C++ or edited in the Details panel. Temporary: this fallback will be removed in a future release.
The component auto-creates an agent once the session is ready (if bAutoCreateOnConnect) — it queues until OnCreateSessionComplete if it spawns before the session is configured. It auto-destroys the agent on EndPlay.
Public Attributes Documentation¶
variable InlineGraphDescription¶
Fallback graph description used when WorkflowAsset is not set. Can be populated programmatically via FTryllGraphBuilder::Build().
Temporary: inline graphs will be removed in a future release — author the graph as a Workflow Asset instead.
variable InlineVariables¶
Declared per-agent Variables when WorkflowAsset is not set (WorkflowAsset->Variables is used instead when one is).
variable KvCacheInitialization¶
How language-model KV contexts are materialised at agent creation.
variable OnAgentReady¶
Fired once after the server confirms the agent has been created.
variable OnAnswerFull¶
Fired after TurnComplete with the full accumulated response text.
variable OnAnswerText¶
Fired for each streaming AnswerText chunk. * Text = the chunk (delta or accumulated, per server config). * bIsFinal = true on the last chunk before TurnComplete.
variable OnAppendInteractionsError¶
variable OnError¶
Fired on any agent-level error (send failure, server error response).
variable OnInteractionsAppended¶
variable OnInteractionsRemoved¶
variable OnKvCacheEvictError¶
variable OnKvCacheEvicted¶
variable OnKvCachePrefillError¶
variable OnKvCachePrefilled¶
variable OnKvCacheStatus¶
variable OnKvCacheStatusError¶
variable OnParamChanged¶
Fired when a ChangeParam request completes. * bSuccess = true on Ack; false on any server error. * ErrorMessage = empty on success; human-readable description on failure.
variable OnRemoveInteractionsError¶
variable OnResumed¶
Fired when a Resume request completes. * bSuccess = true on Ack; false on any server error (e.g. AgentNotPaused, UnknownNode). * ErrorMessage = empty on success; human-readable description on failure.
variable OnTurnComplete¶
Fired when TurnComplete arrives, carrying the turn outcome status.
variable Speaker¶
Optional speaker component used to play streaming TTS audio frames emitted by the agent (e.g. from a GenerateAndSpeak node).
If left unset, BeginPlay will auto-discover a UTryllSpeakerComponent on the same actor (the common case — add both components to your actor and you're done). Set this explicitly when the owning actor has more than one speaker and you need to pick a specific one.
To disable TTS playback entirely: leave this unset AND have no speaker component on the actor.
variable VariableOverrides¶
Per-instance value overrides for the workflow's declared variables (Material-Instance pattern — name/type come from the declaration; only the initial value can be overridden). Entries whose Name/Type no longer match a declared variable are skipped with a warning at agent-creation time.
variable WorkflowAsset¶
Designer-authored workflow asset. When set, its Graph takes precedence over InlineGraphDescription for agent creation.
variable Workload¶
Whether a human ever waits on this agent's turns. Set Background for world-logic/evaluator agents so the inference scheduler paces or defers their work first under GPU pressure. Purely a scheduling hint.
variable bAutoCreateOnConnect¶
Automatically create the agent once the session is ready (connected + configured).
variable bEnableDiagnostics¶
Request the server to populate TurnComplete.debug_info with workflow execution data. Authoring UI retired (Package 2): Chat and Agent Log OR this on via transient override / diagnostics-demand lease. Kept for runtime/Blueprint API and asset compatibility; default remains false (zero overhead in production).
variable bMaintainDialogueHistory¶
When true (default) the agent keeps its full dialogue history across turns. When false the history is discarded after each turn — a stateless agent, useful for technical/classification agents that should not store or project prior turns.
Public Functions Documentation¶
function AppendInteractions¶
void UTryllAgentComponent::AppendInteractions (
const TArray< FTryllDialogInteraction > & Interactions
)
Append scripted user/assistant interactions without running the graph.
function Cancel¶
Cooperatively cancel the in-flight turn. The turn ends with ETryllTurnStatus::Cancelled via OnTurnComplete. No-op if idle or the agent is not ready. Mode selects whether the partial interaction is kept (StopAndKeep, the chat "Stop" button) or discarded (StopAndDiscard).
function ChangeParams¶
Mutate a named parameter on a workflow node at runtime. The agent must not be processing a turn. On completion (success or error), OnParamChanged fires.
Use the clone-set-send idiom: auto* P = Cast<UTryllGenerateParams>(GetNodeParamsBaseline("gen")); auto* Mut = Cast<UTryllGenerateParams>(UTryllNodeParamsFactory::CloneParams(P, this)); Mut->SystemPrompt = TEXT("New prompt"); ChangeParams(TEXT("gen"), Mut);
Parameters:
NodeNameInstance name of the target node in the graph.ParamsFully specified typed params for the node (clone of baseline + edits).
function CreateAgent¶
Request creation of a server-side agent from WorkflowAsset (if set) or InlineGraphDescription. Fires OnAgentReady on success; OnError on failure. Safe to call from Blueprint Begin Play.
function DestroyAgent¶
Request destruction of the current server-side agent. OnAgentDestroyed (on the subsystem) fires on completion.
function EvictKvCache¶
Release every eligible language-model backend KV context.
function GetAgentId¶
Server-assigned agent id, or 0 if the agent has not been created yet.
function GetKvCacheStatus¶
Query aggregate language-model KV-cache lifecycle state.
function GetLiveVariables¶
C++ access to the live variables mirror: the PIE agent when ready, otherwise an editor-preview agent attached by Tryll Chat (if any). Null when neither is active. Used by Details customization for live override apply / Flush Now.
function GetNodeParamsBaseline¶
UTryllNodeParamsBase * UTryllAgentComponent::GetNodeParamsBaseline (
const FString & NodeName
) const
Return the authored params baseline for the named node. Call after OnAgentReady has fired; returns null if the node name is unknown.
function GetStartNodeOptions¶
Options provider for FTryllGraphDescription::StartNode dropdown in the Details panel.
function GetVariables¶
Blueprint/C++ access to this agent's declared per-agent Variables, or nullptr if no agent is ready. Use to Set/Get/AddToSet/RemoveFromSet/Reset declared variables from Blueprint or C++ — see UTryllAgentVariables. (C++ code that needs the raw mirror can use the agent's own FTryllAgent::GetVariables().)
function HasLiveAgent¶
True when a PIE agent or editor-preview agent is available for live variable edits.
function HasPausedToolBatch¶
True while a paused tool-call batch is retained: surfaced by the current pause and not yet cleared by a successful resume Ack, turn end/cancel, destroy, or a terminal disconnect. False when no agent is ready.
function IsAgentReady¶
True after the server has confirmed agent creation (OnAgentReady has fired).
function PrefillKvCache¶
Synchronise every eligible language-model context to its reusable prefix.
function RegisterTool [1/2]¶
Register native game-thread auto-resume sugar for a named tool.
function RegisterTool [2/2]¶
void UTryllAgentComponent::RegisterTool (
const FString & ToolName,
FTryllSimpleToolHandler Handler
)
function RemoveInteractionsFromEnd¶
Remove whole interactions from the end of the dialog.
function Resume¶
Resume a turn that is currently paused (see the subsystem's OnPaused event, fired for the Pause node / pausing ToolCall dispositions). On completion (success or error), OnResumed fires.
Parameters:
ResumeNodeEmpty continues via the paused node's pending exit route; non-empty jumps to that node by name.
function ResumeWithToolResult¶
void UTryllAgentComponent::ResumeWithToolResult (
const FTryllToolResult & ToolResult,
const FString & ResumeNode=TEXT("")
)
Resume with one result correlated to a tool-call ID.
function ResumeWithToolResults¶
void UTryllAgentComponent::ResumeWithToolResults (
const TArray< FTryllToolResult > & ToolResults,
const FString & ResumeNode=TEXT("")
)
Resume with the complete result batch for one paused tool-call pass.
function RetryPausedToolBatch¶
Re-attempt the retained paused tool-call batch: handlers that already produced a result on a previous attempt are skipped, remaining handlers run, and a fresh Resume is sent. No-op when no agent is ready or there is no retained batch.
function SendMessage¶
Send a user-turn message to the agent. Streaming tokens arrive on OnAnswerText; the turn ends with OnTurnComplete + OnAnswerFull. No-op if the agent is not yet ready (IsAgentReady() == false).
function UTryllAgentComponent¶
function UnregisterTool¶
Remove a previously registered native tool handler.
Protected Functions Documentation¶
function BeginPlay¶
function EndPlay¶
The documentation for this class was generated from the following file C:/_tryll/_monorepo3/tryll/clients/unreal/Source/TryllClient/Public/TryllAgentComponent.h