5#include "CoreMinimal.h"
6#include "Kismet/BlueprintFunctionLibrary.h"
7#include "Provider/Types/AllTypesHeader.h"
8#include "OpenAIFuncLib.generated.h"
16 UFUNCTION(BlueprintPure, Category =
"OpenAI | Model")
17 static FString OpenAIAllModelToString(EAllModelEnum Model);
19 UFUNCTION(BlueprintPure, Category =
"OpenAI | Model")
20 static FString OpenAIMainModelToString(EMainModelEnum Model);
22 UFUNCTION(BlueprintPure, Category =
"OpenAI | Model")
23 static FString OpenAIModelToString(
const FOpenAIModel& OpenAIModel);
25 UFUNCTION(BlueprintPure, Category =
"OpenAI | Moderation")
26 static FString OpenAIModerationModelToString(EModerationsModelEnum Model);
28 UFUNCTION(BlueprintPure, Category =
"OpenAI | Moderations")
31 UFUNCTION(BlueprintPure, Category =
"OpenAI | Model | Vision")
32 static bool ModelSupportsVision(
const FString& Model);
34 UFUNCTION(BlueprintPure, Category =
"OpenAI| Audio")
35 static FString OpenAIAudioModelToString(EAudioModel Model);
37 UFUNCTION(BlueprintPure, Category =
"OpenAI| Audio")
38 static FString OpenAITTSModelToString(ETTSModel Model);
40 UFUNCTION(BlueprintPure, Category =
"OpenAI| Audio")
41 static FString OpenAIVoiceToString(EVoice Voice);
43 UFUNCTION(BlueprintPure, Category =
"OpenAI| Audio")
44 static FString OpenAITTSAudioFormatToString(ETTSAudioFormat Format);
46 UFUNCTION(BlueprintPure, Category =
"OpenAI | Audio")
47 static FString OpenAIAudioTranscriptToString(ETranscriptFormat TranscriptFormat);
49 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
50 static FString OpenAIImageModelToString(EImageModelEnum Model);
52 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
53 static EImageModelEnum StringToOpenAIImageModel(
const FString& Model);
55 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
56 static FString OpenAIImageSizeDalle2ToString(EImageSizeDalle2 ImageSize);
58 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
59 static EImageSizeDalle2 StringToOpenAIImageSizeDalle2(
const FString& ImageSize);
61 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
62 static FString OpenAIImageSizeDalle3ToString(EImageSizeDalle3 ImageSize);
64 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
65 static EImageSizeDalle3 StringToOpenAIImageSizeDalle3(
const FString& ImageSize);
67 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
68 static FString OpenAIImageSizeGptImage1ToString(EImageSizeGptImage1 ImageSize);
70 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
71 static EImageSizeGptImage1 StringToOpenAIImageSizeGptImage1(
const FString& ImageSize);
73 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
74 static FString OpenAIImageFormatToString(EOpenAIImageFormat ImageFormat);
76 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
77 static EOpenAIImageFormat StringToOpenAIImageFormat(
const FString& ImageFormat);
79 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
80 static FString OpenAIImageQualityToString(EOpenAIImageQuality ImageQuality);
82 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
83 static FString OpenAIImageOutputFormatToString(EOpenAIImageOutputFormat ImageOutputFormat);
85 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
86 static EOpenAIImageQuality StringToOpenAIImageQuality(
const FString& ImageQuality);
88 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
89 static FString OpenAIImageStyleToString(EOpenAIImageStyle ImageStyle);
91 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
92 static FString OpenAIImageBackgroundToString(EOpenAIImageBackground ImageBackground);
94 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
95 static FString OpenAIImageModerationToString(EOpenAIImageModeration ImageModeration);
97 UFUNCTION(BlueprintPure, Category =
"OpenAI | Image")
98 static EOpenAIImageStyle StringToOpenAIImageStyle(
const FString& ImageStyle);
100 UFUNCTION(BlueprintPure, Category =
"OpenAI | Chat")
101 static FString OpenAIChatResponseFormatToString(EChatResponseFormat ChatResponseFormat);
103 UFUNCTION(BlueprintPure, Category =
"OpenAI | Chat")
104 static FString OpenAIMessageContentTypeToString(EMessageContentType MessageContentType);
106 UFUNCTION(BlueprintPure, Category =
"OpenAI | Chat")
107 static FString OpenAIServiceTierToString(EServiceTier ServiceTier);
109 UFUNCTION(BlueprintPure, Category =
"OpenAI | Embeddings")
110 static FString OpenAIEmbeddingsEncodingFormatToString(EEmbeddingsEncodingFormat EmbeddingsEncodingFormat);
112 UFUNCTION(BlueprintPure, Category =
"OpenAI | File")
113 static FString OpenAIUploadFilePurposeToString(EUploadFilePurpose UploadFilePurpose);
115 UFUNCTION(BlueprintPure, Category =
"OpenAI | Batch")
116 static FString OpenAIBatchEndpointToString(EBatchEndpoint BatchEndpoint);
118 UFUNCTION(BlueprintPure, Category =
"OpenAI | Batch")
119 static FString OpenAIBatchCompletionWindowToString(EBatchCompletionWindow BatchCompletionWindow);
121 UFUNCTION(BlueprintPure, Category =
"OpenAI | Upload")
122 static FString OpenAIUploadStatusToString(EUploadStatus UploadStatus);
124 UFUNCTION(BlueprintPure, Category =
"OpenAI | Upload")
125 static FString OpenAIAssistantToolTypeToString(EAssistantToolType AssistantToolType);
128 UFUNCTION(BlueprintPure, Category =
"OpenAI | Common")
129 static FString OpenAIRoleToString(ERole Role);
131 UFUNCTION(BlueprintPure, Category =
"OpenAI | Common")
132 static FString OpenAIFinishReasonToString(EOpenAIFinishReason FinishReason);
134 UFUNCTION(BlueprintPure, Category =
"OpenAI | Common")
135 static EOpenAIFinishReason StringToOpenAIFinishReason(
const FString& FinishReason);
137 UFUNCTION(BlueprintPure, Category =
"OpenAI | Common")
138 static ERole StringToOpenAIRole(
const FString& Role);
140 UFUNCTION(BlueprintPure, Category =
"OpenAI | Common")
141 static FString OpenAIHeaderTypeToString(EOpenAIHttpHeaderType Type);
143 UFUNCTION(BlueprintPure, Category =
"OpenAI | Common")
147 UFUNCTION(BlueprintPure, Category =
"OpenAI | Error")
148 static EOpenAIResponseError GetErrorCode(
const FString& RawError);
150 UFUNCTION(BlueprintPure, Category =
"OpenAI | Error")
151 static FString GetErrorMessage(
const FString& RawError);
153 UFUNCTION(BlueprintPure, Category =
"OpenAI | Error")
154 static FString ResponseErrorToString(EOpenAIResponseError Code);
157 UFUNCTION(BlueprintPure, Category =
"OpenAI | Base64")
158 static FString WrapBase64(
const FString& Base64String);
160 UFUNCTION(BlueprintPure, Category =
"OpenAI | Base64")
161 static FString UnWrapBase64(
const FString& Base64String);
163 UFUNCTION(BlueprintPure, Category =
"OpenAI | Base64")
164 static FString FilePathToBase64(
const FString& FilePath);
173 UFUNCTION(BlueprintPure, Category =
"OpenAI | API")
174 static FOpenAIAuth LoadAPITokensFromFile(
const FString& FilePath);
176 UFUNCTION(BlueprintPure, Category =
"OpenAI | API")
177 static FOpenAIAuth LoadAPITokensFromFileOnce(
const FString& FilePath);
180 static FString BoolToString(
bool Value);
181 static FString RemoveWhiteSpaces(
const FString& Input);
182 static OpenAI::ServiceSecrets LoadServiceSecretsFromFile(
const FString& FilePath);
183 static bool LoadSecretByName(
const OpenAI::ServiceSecrets& Secrets,
const FString& SecretName, FString& SecretValue);
184 static FString MakeURLWithQuery(
const FString& URL,
const OpenAI::QueryPairs& Args);
Definition: OpenAIFuncLib.h:12
Definition: ModerationTypes.h:126
Definition: CommonTypes.h:11
Definition: ModelTypes.h:120