Navigation
API > API/Plugins > API/Plugins/ToolsetRegistry
Base class for an asynchronous tool call result that is analogous to a promise.
Asynchronous tools should not use this base class directly, instead they should use an either define or use an existing derivative of this base class for asynchronous results.
Asynchronous tools return derivatives of this class to indicate a pending result. When an asynchronous tool completes its operation it should perform one of the following operations:
- If successful, use MaybeBroadcastSuccessfulCompletion() from the derived class
- ideally implemented in a method called
SetValue_ - to notify listeners of theOnCompleted_ delegate, set bIsComplete to true and set the result's value. - If an error occurs, use SetError() to set the
Error_ property, set bIsComplete to true and notify listeners of theOnCompleted_ delegate.
| Name | UToolCallAsyncResult |
| Type | class |
| Header File | /Engine/Plugins/Experimental/ToolsetRegistry/Source/ToolsetRegistry/Public/ToolsetRegistry/ToolCallAsyncResult.h |
| Include Path | #include "ToolsetRegistry/ToolCallAsyncResult.h" |
Syntax
UCLASS (BlueprintType, Blueprintable, MinimalAPI)
class UToolCallAsyncResult : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UToolCallAsyncResult
Derived Classes
- UPCGExecuteGraphInstanceAsyncResult
- UToolCallAsyncResultImage
- UToolCallAsyncResultString
- UToolCallAsyncResultVoid
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| ValuePropertyName | FString | ToolsetRegistry/ToolCallAsyncResult.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsComplete | bool | Whether the associated tool call is complete and the result via Value and GetValueAsJson() or Error are available to read. | ToolsetRegistry/ToolCallAsyncResult.h |
|
| Error | FString | If this is an non-empty string, an error occurred while executing the tool that returned this instance. | ToolsetRegistry/ToolCallAsyncResult.h |
|
| OnCompleted | FToolCallAsyncResultCompleted | Notified when the tool call is completes successfully or with an error. | ToolsetRegistry/ToolCallAsyncResult.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| CompletedLock | UE::FMutex | Guards: bIsComplete. | ToolsetRegistry/ToolCallAsyncResult.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool BroadcastOnCompletedIfComplete () |
Broadcast to subscribers of the OnCompleted delegate if the result is already complete. | ToolsetRegistry/ToolCallAsyncResult.h |
|
| Get the JSON representation of the Value. | ToolsetRegistry/ToolCallAsyncResult.h |
|
|
| Complete this result with an error and notify listeners of OnCompleted. | ToolsetRegistry/ToolCallAsyncResult.h |
|
Public Virtual
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual TSharedPtr< FJsonValue > GetValueAsJson () |
Get the JSON representation of the Value. | ToolsetRegistry/ToolCallAsyncResult.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool MaybeBroadcastCompletion
(
TFunction< void()>&& SetFinalState |
Broadcast that the result is complete if it hasn't already been completed. | ToolsetRegistry/ToolCallAsyncResult.h | |
| Broadcast a successful completion with no value. | ToolsetRegistry/ToolCallAsyncResult.h | ||
bool MaybeBroadcastSuccessfulCompletion
(
ValueT&& InValue, |
Broadcast a successful completion with a value. | ToolsetRegistry/ToolCallAsyncResult.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static TSharedRef< FJsonObject > GetValueJsonSchema
(
TSubclassOf< UToolCallAsyncResult > Class |
Get the JSON schema for an async result class' value. | ToolsetRegistry/ToolCallAsyncResult.h | |
static UClass * MatchesProperty
(
TNotNull< const FProperty* > Property |
Check whether a property references an async result class. | ToolsetRegistry/ToolCallAsyncResult.h |