Unreal OpenAI API 1.0.0
RetrieveFileAction.h
1// OpenAI, Copyright LifeEXE. All Rights Reserved.
2
3#pragma once
4
5#include "Kismet/BlueprintAsyncActionBase.h"
6#include "Provider/Types/FileTypes.h"
7#include "Provider/Types/CommonTypes.h"
8#include "RetrieveFileAction.generated.h"
9
10DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnRetrieveFile, const FRetrieveFileResponse&, Response, const FOpenAIResponseMetadata&,
11 ResponseMetadata, const FOpenAIError&, RawError);
12class UOpenAIProvider;
13
14UCLASS()
15class URetrieveFileAction : public UBlueprintAsyncActionBase
16{
17 GENERATED_BODY()
18
19public:
20 UPROPERTY(BlueprintAssignable)
21 FOnRetrieveFile OnCompleted;
22
23 virtual void Activate() override;
24
25private:
30 UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true"), Category = "OpenAI | Files")
31 static URetrieveFileAction* RetrieveFile(const FString& FileID, const FOpenAIAuth& Auth, const FString& URLOverride);
32
33 void TryToOverrideURL(UOpenAIProvider* Provider);
34
35 void OnRetrieveFileCompleted(const FRetrieveFileResponse& Response, const FOpenAIResponseMetadata& ResponseMetadata);
36 void OnRequestError(const FString& URL, const FString& Content);
37
38private:
39 FOpenAIAuth Auth;
40 FString FileID;
41 FString URLOverride{};
42};
Definition: OpenAIProvider.h:45
void RetrieveFile(const FString &FileID, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:253
Definition: RetrieveFileAction.h:16
Definition: CommonTypes.h:11
Definition: CommonTypes.h:28
Definition: CommonTypes.h:49
Definition: FileTypes.h:152