Class FTryllAgent¶
#include <TryllAgent.h>
Inherits the following classes: TSharedFromThis< FTryllAgent >
Public Functions¶
| Type | Name |
|---|---|
| void | ChangeParam (const FString & NodeName, const FString & ParamName, const FString & ParamValue, TFunction< void(const FTryllError &)> OnComplete=nullptr) |
| void | ClearAfterDestroyRequest () |
| FTryllAgent (TSharedPtr< FTryllConnection > InConnection, std::uint64_t InAgentId) |
|
| std::uint64_t | GetAgentId () noexcept const |
| void | HandleAnswerText (const FString & Text, bool bIsDelta, bool bIsFinal) |
| void | HandleChangeParamResult (std::uint64_t RequestId, const FTryllError & Error) |
| void | HandleError (const FTryllError & Error) |
| void | HandleTurnComplete (ETryllTurnStatus Status, const FString & DebugInfo, int32 TokensGenerated) |
| bool | IsValid () noexcept const |
| void | SendMessage (const FString & Text) |
| void | SetOnAnswerText (TFunction< void(const FString &Text, bool bIsDelta, bool bIsFinal)> Callback) |
| void | SetOnError (TFunction< void(const FTryllError &Error)> Callback) |
| void | SetOnTurnComplete (TFunction< void(ETryllTurnStatus Status, const FString &DebugInfo, int32 TokensGenerated)> Callback) |
| ~FTryllAgent () |
Detailed Description¶
Plain C++ handle for a server-side agent. Created by UTryllSubsystem after a successful CreateAgentResponse.
Ownership: typically held as TSharedPtr<FTryllAgent> by UTryllAgentComponent. Lifetime: deterministic — the owning component releases the shared_ptr; this triggers PushDestroyAgent via UTryllSubsystem::RequestDestroyAgent().
All callbacks are invoked on the game thread (from UTryllSubsystem::Tick).
Public Functions Documentation¶
function ChangeParam¶
void FTryllAgent::ChangeParam (
const FString & NodeName,
const FString & ParamName,
const FString & ParamValue,
TFunction< void(const FTryllError &)> OnComplete=nullptr
)
Mutate a named parameter on a workflow node. The agent must not be processing a turn; completion is reported via the UTryllSubsystem::RequestChangeAgentParam OnComplete callback.
function ClearAfterDestroyRequest¶
Called by UTryllSubsystem when the destroy Ack arrives; clears the local agent id.
function FTryllAgent¶
function GetAgentId¶
function HandleAnswerText¶
function HandleChangeParamResult¶
Invoked by UTryllSubsystem when a ChangeParamOk or ChangeParamErr arrives.
function HandleError¶
function HandleTurnComplete¶
void FTryllAgent::HandleTurnComplete (
ETryllTurnStatus Status,
const FString & DebugInfo,
int32 TokensGenerated
)
function IsValid¶
function SendMessage¶
Send a text message to the agent. Response arrives via the OnAnswerText / OnTurnComplete callbacks.
function SetOnAnswerText¶
void FTryllAgent::SetOnAnswerText (
TFunction< void(const FString &Text, bool bIsDelta, bool bIsFinal)> Callback
)
Streaming text callback. Matches the current AnswerText wire message: * bIsDelta = true → Text is an incremental token/chunk. * bIsDelta = false → Text is the full response accumulated so far. * bIsFinal = true → This is the last AnswerText before TurnComplete.
function SetOnError¶
Called on any send-side error (connection loss, server error response, etc.).
function SetOnTurnComplete¶
void FTryllAgent::SetOnTurnComplete (
TFunction< void(ETryllTurnStatus Status, const FString &DebugInfo, int32 TokensGenerated)> Callback
)
Called once per turn after all AnswerText chunks, carrying the turn outcome. TokensGenerated: server-reported total tokens sampled across all generation nodes in this turn (prompt tokens excluded).
function ~FTryllAgent¶
The documentation for this class was generated from the following file C:/_tryll/_monorepo/server/client-unreal/Source/TryllClient/Public/TryllAgent.h