// OpenAI, Copyright LifeEXE. All Rights Reserved. #pragma once #include "Kismet/BlueprintAsyncActionBase.h" #include "Provider/ResponseTypes.h" #include "Provider/RequestTypes.h" #include "ImageAction.generated.h" DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FOnImage, const FImageResponse&, Response, const FOpenAIError&, RawError); class UOpenAIProvider; UCLASS() class UImageAction : public UBlueprintAsyncActionBase { GENERATED_BODY() public: UPROPERTY(BlueprintAssignable) FOnImage OnCompleted; virtual void Activate() override; private: /** * @param URLOverride Allows for the specification of a custom endpoint. This is beneficial when using a proxy. * If this functionality is not required, this parameter can be left blank. */ UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true"), Category = "OpenAI | Images") static UImageAction* CreateImage(const FOpenAIImage& Image, const FOpenAIAuth& Auth, const FString& URLOverride); void TryToOverrideURL(); void OnCreateImageCompleted(const FImageResponse& Response); void OnRequestError(const FString& URL, const FString& Content); private: UPROPERTY() TObjectPtr Provider; FOpenAIImage Image; FOpenAIAuth Auth; FString URLOverride{}; };