Unreal OpenAI API 1.0.0
AssistantTypes.h
1// OpenAI, Copyright LifeEXE. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Provider/OpenAIOptional.h"
7#include "AssistantTypes.generated.h"
8
9UENUM(BlueprintType)
10enum class EAssistantToolType : uint8
11{
12 CodeInterpreter = 0,
13 FileSearch,
14 Function
15};
16
17USTRUCT(BlueprintType)
19{
20 GENERATED_BODY()
21
22 UPROPERTY(BlueprintReadWrite, Category = "OpenAI | Required")
23 FString Type;
24
25 // @todo: FileSearchTool
26
27 // @todo: FunctionTool
28};
29
30USTRUCT(BlueprintType)
32{
33 GENERATED_BODY()
34};
35
37// REQUEST TYPES
39
40USTRUCT(BlueprintType)
42{
43 GENERATED_BODY()
44
45
50 UPROPERTY(BlueprintReadWrite, Category = "OpenAI | Required")
51 FString Model;
52
56 UPROPERTY(BlueprintReadWrite, Category = "OpenAI | Optional")
57 FString Name;
58
62 UPROPERTY(BlueprintReadWrite, Category = "OpenAI | Optional")
63 FString Description;
64
68 UPROPERTY(BlueprintReadWrite, Category = "OpenAI | Optional")
69 FString Instructions;
70
76 UPROPERTY(BlueprintReadWrite, Category = "OpenAI | Optional")
77 TArray<FAssistantTool> Tools;
78
85 UPROPERTY(BlueprintReadWrite, Category = "OpenAI | Optional")
87
93 UPROPERTY(BlueprintReadWrite, Category = "OpenAI | Optional")
94 TMap<FString, FString> Metadata;
95
101 UPROPERTY(BlueprintReadWrite, Category = "OpenAI | Optional")
102 float Temperature{1.0f};
103
110 UPROPERTY(BlueprintReadWrite, Category = "OpenAI | Optional")
111 float Top_P{1.0f};
112
117 UPROPERTY(BlueprintReadWrite, Category = "OpenAI | Optional")
118 FOptionalString Response_Format;
119};
120
121USTRUCT(BlueprintType)
123{
124 GENERATED_BODY()
125
126
130 UPROPERTY(BlueprintReadWrite, Category = "OpenAI | Optional")
131 int32 Limit{20};
132
137 UPROPERTY(BlueprintReadWrite, Category = "OpenAI | Optional")
138 FString Order{"desc"}; // todo enum
139
145 UPROPERTY(BlueprintReadWrite, Category = "OpenAI | Optional")
147
153 UPROPERTY(BlueprintReadWrite, Category = "OpenAI | Optional")
155
156 FString ToQuery() const
157 {
158 FString Query{"?"};
159
160 Query.Append("limit=").Append(FString::FromInt(Limit)).Append("&");
161 Query.Append("order=").Append(Order).Append("&");
162
163 if (After.IsSet)
164 {
165 Query.Append("after=").Append(After.Value).Append("&");
166 }
167
168 if (Before.IsSet)
169 {
170 Query.Append("before=").Append(Before.Value).Append("&");
171 }
172
173 return Query.LeftChop(1);
174 }
175};
176
177USTRUCT(BlueprintType)
179{
180 GENERATED_BODY()
181};
182
184// RESPONSE TYPES
186
187USTRUCT(BlueprintType)
189{
190 GENERATED_BODY()
191
192 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
193 FString Id;
194
195 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
196 FString Object; //"assistant.deleted"
197
198 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
199 bool Deleted;
200};
201
205USTRUCT(BlueprintType)
207{
208 GENERATED_BODY()
209
210
213 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
214 FString Id;
215
219 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
220 FString Object;
221
225 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
226 int32 Created_At;
227
231 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
232 FString Name;
233
239 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
240 FString Model;
241
245 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
246 FString Instructions;
247
253 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
254 TArray<FAssistantTool> Tools;
255
262 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
264
270 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
271 TMap<FString, FString> Metadata;
272
278 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
279 float Temperature;
280
287 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
288 float Top_P;
289
294 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
295 FString Response_Format;
296};
297
298USTRUCT(BlueprintType)
300{
301 GENERATED_BODY()
302
303 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
304 FString Object;
305
306 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
307 TArray<FAssistantObjectResponse> Data;
308
309 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
310 FString First_Id;
311
312 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
313 FString Last_Id;
314
315 UPROPERTY(BlueprintReadOnly, Category = "OpenAI")
316 bool Has_More{};
317};
Definition: OpenAI.Build.cs:6
Definition: AssistantTypes.h:207
Definition: AssistantTypes.h:19
Definition: AssistantTypes.h:32
Definition: AssistantTypes.h:42
Definition: AssistantTypes.h:189
Definition: AssistantTypes.h:123
Definition: AssistantTypes.h:300
Definition: AssistantTypes.h:179
Definition: OpenAIOptional.h:10