5#include "CoreMinimal.h" 
    6#include "GameFramework/Info.h" 
    7#include "Provider/Types/CommonTypes.h" 
    8#include "Provider/Types/ModelTypes.h" 
    9#include "Provider/Types/Chat/ChatCompletionChunkTypes.h" 
   10#include "ChatGPTWorld.generated.h" 
   12DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnGPTRequestUpdated, 
const FMessage&, Message);
 
   13DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnGPTRequestCompleted, 
const FMessage&, Message);
 
   17UCLASS(Blueprintable, BlueprintType)
 
   23    virtual void BeginPlay() 
override;
 
   25    UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = 
"OpenAI")
 
   26    EMainModelEnum Model{EMainModelEnum::O1};
 
   28    UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = 
"OpenAI")
 
   29    int32 MaxTokens{2000};
 
   31    UFUNCTION(BlueprintCallable, Category = 
"OpenAI")
 
   34    UFUNCTION(BlueprintCallable, Category = 
"OpenAI")
 
   35    void SetModel(
const FString& ModelName);
 
   37    UFUNCTION(BlueprintCallable, Category = 
"OpenAI")
 
   38    bool IsInProgress()
 const { 
return bIsInProgress; }
 
   40    UFUNCTION(BlueprintCallable, Category = 
"OpenAI")
 
   41    void MakeRequest(
const FMessage& Message);
 
   43    UFUNCTION(BlueprintCallable, Category = 
"OpenAI")
 
   44    FMessage GetLastMessage()
 const { 
return LastMessage; }
 
   47    UPROPERTY(BlueprintAssignable)
 
   48    FOnGPTRequestUpdated OnGPTRequestUpdated;
 
   50    UPROPERTY(BlueprintAssignable)
 
   51    FOnGPTRequestCompleted OnGPTRequestCompleted;
 
   57    TObjectPtr<UChatGPT> ChatGPT;
 
   59    bool bIsInProgress{
false};
 
   63    void OnRequestCompleted();
 
   64    void OnRequestUpdated(
const FMessage& Message, 
bool WasError);
 
Definition: ChatGPTWorld.h:19
 
Definition: ChatCommonTypes.h:75
 
Definition: CommonTypes.h:11