Files
2025-04-07 18:31:41 -07:00

45 lines
1.4 KiB
C++

// OpenAI, Copyright LifeEXE. All Rights Reserved.
#pragma once
#include "Kismet/BlueprintAsyncActionBase.h"
#include "Provider/ResponseTypes.h"
#include "Provider/RequestTypes.h"
#include "RetrieveFineTuningJobAction.generated.h"
DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(
FOnRetrieveFineTuningJob, const FFineTuningJobObjectResponse&, Response, const FOpenAIError&, RawError);
class UOpenAIProvider;
UCLASS()
class URetrieveFineTuningJobAction : public UBlueprintAsyncActionBase
{
GENERATED_BODY()
public:
UPROPERTY(BlueprintAssignable)
FOnRetrieveFineTuningJob 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 | FineTunes")
static URetrieveFineTuningJobAction* RetrieveFineTuningJob(
const FString& FineTuningJobID, const FOpenAIAuth& Auth, const FString& URLOverride);
void TryToOverrideURL(UOpenAIProvider* Provider);
void OnRetrieveFineTuningJobCompleted(const FFineTuningJobObjectResponse& Response);
void OnRequestError(const FString& URL, const FString& Content);
private:
FString FineTuningJobID;
FOpenAIAuth Auth;
FString URLOverride{};
};