Unreal OpenAI API 1.0.0
APIOverview.h
1// OpenAI Sample, Copyright LifeEXE. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "GameFramework/Info.h"
7#include "Provider/Types/CommonTypes.h"
8#include "APIOverview.generated.h"
9
10class UOpenAIProvider;
11
12UENUM(BlueprintType)
13enum class EAPIOverviewAction : uint8
14{
15 ListModels = 0,
18 CreateCompletionRequest,
19 CreateChatCompletionRequest,
20 CreateImageDALLE2,
21 CreateImageDALLE3,
28 CreateAudioTranscriptionVerbose,
39 RetriveFineTuningJob,
54
55 SetYourOwnAPI
56};
57
58UCLASS(Blueprintable, BlueprintType)
59class OPENAI_API AAPIOverview : public AInfo
60{
61 GENERATED_BODY()
62
63public:
65
66 UPROPERTY(EditAnywhere, Category = "OpenAI")
67 EAPIOverviewAction Action;
68
69protected:
70 virtual void BeginPlay() override;
71
72private:
73 UPROPERTY()
74 UOpenAIProvider* Provider;
75
76 FOpenAIAuth Auth;
77
78 TMap<EAPIOverviewAction, TFunction<void()>> ActionMap;
79
80 void ListModels();
81 void RetrieveModel();
82 void DeleteFinedTuneModel();
83
84 void CreateCompletionRequest();
85 void CreateChatCompletionRequest();
86
87 void CreateImageDALLE2();
88 void CreateImageDALLE3();
89 void CreateImageEdit();
91
92 void CreateModerations();
93 void CreateEmbeddings();
94
95 void CreateSpeech();
97 void CreateAudioTranscriptionVerbose();
99
100 void UploadFile();
101 void DeleteFile();
102 void ListFiles();
103 void RetrieveFile();
104 void RetrieveFileContent();
105
106 void CreateFineTuningJob();
107 void ListFineTuningJobs();
110 void RetriveFineTuningJob();
111 void CancelFineTuningJob();
112
113 void ListBatch();
114 void CreateBatch();
115 void RetrieveBatch();
116 void CancelBatch();
117
118 void CreateUpload();
119 void AddUploadPart();
120 void CompleteUpload();
121 void CancelUpload();
122
123 void CreateAssistant();
124 void DeleteAssistant();
125 void ListAssistants();
126 void ModifyAssistant();
127 void RetrieveAssistant();
128
129 void OnRequestError(const FString& URL, const FString& Content);
130
131 void SetYourOwnAPI();
132};
Definition: APIOverview.h:60
Definition: OpenAIProvider.h:45
void CreateAudioTranscription(const FAudioTranscription &AudioTranscription, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:172
void RetrieveFileContent(const FString &FileID, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:261
void DeleteFile(const FString &FileID, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:245
void ListFineTuningCheckpoints(const FString &FineTuningJobID, const FOpenAIAuth &Auth, const FFineTuningQueryParameters &FineTuningQueryParameters={})
Definition: OpenAIProvider.cpp:301
void RetrieveFile(const FString &FileID, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:253
void CancelUpload(const FString &UploadId, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:395
void UploadFile(const FUploadFile &UploadFile, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:226
void DeleteAssistant(const FString &AssistantId, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:438
void ListFiles(const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:219
void CreateImageEdit(const FOpenAIImageEdit &ImageEdit, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:101
void CreateEmbeddings(const FEmbeddings &Embeddings, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:158
void CreateBatch(const FCreateBatch &CreateBatch, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:330
void CreateImageVariation(const FOpenAIImageVariation &ImageVariation, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:132
void AddUploadPart(const FString &UploadId, const FAddUploadPart &AddUploadPart, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:368
void CreateSpeech(const FSpeech &Speech, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:165
void ModifyAssistant(const FString &AssistantId, const FModifyAssistant &ModifyAssistant, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:429
void ListBatch(const FListBatch &ListBatch, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:353
void CreateAudioTranslation(const FAudioTranslation &AudioTranslation, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:196
void RetrieveBatch(const FString &BatchId, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:337
void CancelFineTuningJob(const FString &FineTuneID, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:322
void RetrieveModel(const FString &ModelName, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:37
void CreateUpload(const FCreateUpload &CreateUpload, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:361
void ListFineTuningEvents(const FString &FineTuningJobID, const FOpenAIAuth &Auth, const FFineTuningQueryParameters &FineTuningQueryParameters={})
Definition: OpenAIProvider.cpp:291
void ListAssistants(const FListAssistants &ListAssistants, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:411
void DeleteFineTunedModel(const FString &ModelID, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:47
void CompleteUpload(const FString &UploadId, const FCompleteUpload &CompleteUpload, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:387
void RetrieveAssistant(const FString &AssistantId, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:420
void CreateFineTuningJob(const FFineTuningJob &FineTuningJob, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:276
void CreateModerations(const FModerations &Moderations, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:269
void CreateAssistant(const FCreateAssistant &CreateAssistant, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:403
void ListFineTuningJobs(const FOpenAIAuth &Auth, const FFineTuningQueryParameters &FineTuningQueryParameters={})
Definition: OpenAIProvider.cpp:283
void CancelBatch(const FString &BatchId, const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:345
void ListModels(const FOpenAIAuth &Auth)
Definition: OpenAIProvider.cpp:30
Definition: CommonTypes.h:11