@ -26,19 +26,23 @@ class AVATARCORE_AI_API UAIBaseManager : public UObject
public :
public :
// BlueprintAssignable Events
// AI subtitle received (chunk-delta and complete answer)
UPROPERTY ( BlueprintAssignable , Category = " AvatarCoreAI|Events " )
UPROPERTY ( BlueprintAssignable , Category = " AvatarCoreAI|Events " )
FOnAISubtitle OnAISubtitle ;
FOnAISubtitle OnAISubtitle ;
//AI module has changed state
UPROPERTY ( BlueprintAssignable , Category = " AvatarCoreAI|Events " )
UPROPERTY ( BlueprintAssignable , Category = " AvatarCoreAI|Events " )
FOnAIStateChanged OnAIStateChanged ;
FOnAIStateChanged OnAIStateChanged ;
//AI module logging
UPROPERTY ( BlueprintAssignable , Category = " AvatarCoreAI|Events " )
UPROPERTY ( BlueprintAssignable , Category = " AvatarCoreAI|Events " )
FOnAILog OnAILog ;
FOnAILog OnAILog ;
//AI module error
UPROPERTY ( BlueprintAssignable , Category = " AvatarCoreAI|Events " )
UPROPERTY ( BlueprintAssignable , Category = " AvatarCoreAI|Events " )
FOnAIError OnAIError ;
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 " )
UPROPERTY ( BlueprintAssignable , Category = " AvatarCoreAI|Events " )
FOnAIDelayedAnswer OnAIDelayedAnswer ;
FOnAIDelayedAnswer OnAIDelayedAnswer ;
@ -70,6 +74,12 @@ public:
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI " )
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI " )
virtual void ActivateAI ( ) { } ;
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
* Deinitalize AI - when going to Idle for example
*/
*/
@ -118,15 +128,27 @@ public:
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI|Events " )
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI|Events " )
virtual void OnAIResponse ( const FString & Chunk , bool IsFinal ) ;
virtual void OnAIResponse ( const FString & Chunk , bool IsFinal ) ;
/**
* Add a new system instruction by name .
*/
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI " )
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI " )
void AddSystemInstruction ( const FName Name , const FString NewSystemInstruction ) ;
void AddSystemInstruction ( const FName Name , const FString NewSystemInstruction ) ;
/**
* Remove a system instruction by name .
*/
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI " )
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI " )
void RemoveSystemInstruction ( const FName Name ) ;
void RemoveSystemInstruction ( const FName Name ) ;
/**
* Clear all System Instruction .
*/
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI " )
UFUNCTION ( BlueprintCallable , Category = " AvatarCoreAI " )
void ClearAllSystemInstructios ( ) ;
void ClearAllSystemInstructios ( ) ;
/**
* Timeout Handling
*/
void ResetRequestTimeout ( ) ;
void ResetRequestTimeout ( ) ;
void ClearRequestTimeout ( ) ;
void ClearRequestTimeout ( ) ;
UFUNCTION ( )
UFUNCTION ( )
@ -166,22 +188,23 @@ protected:
UFUNCTION ( )
UFUNCTION ( )
void CommandFailed ( const FString & Command , const FString & Payload ) ;
void CommandFailed ( const FString & Command , const FString & Payload ) ;
// MCP Event Handlers
//MCP Log Event
UFUNCTION ( )
UFUNCTION ( )
void OnMCPLogReceived ( const FString & LogMessage ) ;
void OnMCPLogReceived ( const FString & LogMessage ) ;
//MCP Error Event
UFUNCTION ( )
UFUNCTION ( )
void OnMCPErrorReceived ( const FString & ErrorMessage , EMCPManagerError ErrorType ) ;
void OnMCPErrorReceived ( const FString & ErrorMessage , EMCPManagerError ErrorType ) ;
//MCP state changed
UFUNCTION ( )
UFUNCTION ( )
void OnMCPStateChanged ( EMCPManagerState NewState ) ;
void OnMCPStateChanged ( EMCPManagerState NewState ) ;
//Tracking if it takes too long until answer chunks are coming in
UFUNCTION ( )
UFUNCTION ( )
void StartDelayedAnswerTimer ( ) ;
void StartDelayedAnswerTimer ( ) ;
UFUNCTION ( )
UFUNCTION ( )
void ClearDelayedAnswerTimer ( ) ;
void ClearDelayedAnswerTimer ( ) ;
UFUNCTION ( )
UFUNCTION ( )
void OnDelayedAnswer ( ) ;
void OnDelayedAnswer ( ) ;