@ -26,19 +26,23 @@ class AVATARCORE_AI_API UAIBaseManager : public UObject
public :
// BlueprintAssignable Events
// AI subtitle received (chunk-delta and complete answer)
UPROPERTY ( BlueprintAssignable , Category = " AvatarCoreAI|Events " )
FOnAISubtitle OnAISubtitle ;
//AI module has changed state
UPROPERTY ( BlueprintAssignable , Category = " AvatarCoreAI|Events " )
FOnAIStateChanged OnAIStateChanged ;
//AI module logging
UPROPERTY ( BlueprintAssignable , Category = " AvatarCoreAI|Events " )
FOnAILog OnAILog ;
//AI module error
UPROPERTY ( BlueprintAssignable , Category = " AvatarCoreAI|Events " )
FOnAIError OnAIError ;
//It took a very long time to start answering - we can use this to playback a filler speech
UPROPERTY ( BlueprintAssignable , Category = " AvatarCoreAI|Events " )
FOnAIDelayedAnswer OnAIDelayedAnswer ;
@ -70,6 +74,12 @@ public:
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI " )
virtual void ActivateAI ( ) { } ;
/**
* Update Session in case something has changed with the prompt or the functions to call
*/
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI " )
virtual void UpdateSession ( ) { } ;
/**
* Deinitalize AI - when going to Idle for example
*/
@ -118,15 +128,27 @@ public:
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI|Events " )
virtual void OnAIResponse ( const FString & Chunk , bool IsFinal ) ;
/**
* Add a new system instruction by name .
*/
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI " )
void AddSystemInstruction ( const FName Name , const FString NewSystemInstruction ) ;
/**
* Remove a system instruction by name .
*/
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI " )
void RemoveSystemInstruction ( const FName Name ) ;
/**
* Clear all System Instruction .
*/
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI " )
void ClearAllSystemInstructios ( ) ;
/**
* Timeout Handling
*/
void ResetRequestTimeout ( ) ;
void ClearRequestTimeout ( ) ;
UFUNCTION ( )
@ -144,9 +166,9 @@ public:
UFUNCTION ( BlueprintPure , Category = " AvatarCoreAI|Commands " )
TArray < FMCPToolInfo > GetAvailableCommands ( ) ;
/**
* Runs a command by name with the given payload , rebinding completion / failure events .
*/
/**
* Runs a command by name with the given payload , rebinding completion / failure events .
*/
void RunMCPCommand ( FString CommandName , FString Payload ) ;
// Clear all running commands
@ -166,22 +188,23 @@ protected:
UFUNCTION ( )
void CommandFailed ( const FString & Command , const FString & Payload ) ;
// MCP Event Handlers
//MCP Log Event
UFUNCTION ( )
void OnMCPLogReceived ( const FString & LogMessage ) ;
//MCP Error Event
UFUNCTION ( )
void OnMCPErrorReceived ( const FString & ErrorMessage , EMCPManagerError ErrorType ) ;
//MCP state changed
UFUNCTION ( )
void OnMCPStateChanged ( EMCPManagerState NewState ) ;
//Tracking if it takes too long until answer chunks are coming in
UFUNCTION ( )
void StartDelayedAnswerTimer ( ) ;
UFUNCTION ( )
void ClearDelayedAnswerTimer ( ) ;
UFUNCTION ( )
void OnDelayedAnswer ( ) ;