Unreal OpenAI API 1.0.0
RetrieveFileContentAction.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 "RetrieveFileContentAction.generated.h"
9
10DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams(FOnRetrieveFileContent, const FRetrieveFileContentResponse&, Response,
11 const FOpenAIResponseMetadata&, ResponseMetadata, const FOpenAIError&, RawError);
12
13class UOpenAIProvider;
14
15UCLASS()
16class URetrieveFileContentAction : public UBlueprintAsyncActionBase
17{
18 GENERATED_BODY()
19
20public:
21 UPROPERTY(BlueprintAssignable)
22 FOnRetrieveFileContent OnCompleted;
23
24 virtual void Activate() override;
25
26private:
31 UFUNCTION(BlueprintCallable, meta = (BlueprintInternalUseOnly = "true"), Category = "OpenAI | Files")
32 static URetrieveFileContentAction* RetrieveFileContent(const FString& FileID, const FOpenAIAuth& Auth, const FString& URLOverride);
33
34 void TryToOverrideURL(UOpenAIProvider* Provider);
35
36 void OnRetrieveFileContentCompleted(const FRetrieveFileContentResponse& Response, const FOpenAIResponseMetadata& ResponseMetadata);
37 void OnRequestError(const FString& URL, const FString& Content);
38
39private:
40 FOpenAIAuth Auth;
41 FString FileID;
42 FString URLOverride{};
43};
Definition: OpenAIProvider.h:45
void RetrieveFileContent(const FString &FileID, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:261
Definition: RetrieveFileContentAction.h:17
Definition: CommonTypes.h:11
Definition: CommonTypes.h:28
Definition: CommonTypes.h:49
Definition: FileTypes.h:158