@@ -7,7 +7,7 @@ public struct Choice
7
7
{
8
8
public string Text { get ; set ; }
9
9
public int ? Index { get ; set ; }
10
- public int ? Logpropbs { get ; set ; }
10
+ public int ? Logprobs { get ; set ; }
11
11
public string FinishReason { get ; set ; }
12
12
}
13
13
@@ -18,7 +18,7 @@ public struct Usage
18
18
public string TotalTokens { get ; set ; }
19
19
}
20
20
21
- public struct OpenAIFile
21
+ public class OpenAIFile
22
22
{
23
23
public string Id { get ; set ; }
24
24
public string Object { get ; set ; }
@@ -27,23 +27,46 @@ public struct OpenAIFile
27
27
public string Filename { get ; set ; }
28
28
public string Purpose { get ; set ; }
29
29
public object StatusDetails { get ; set ; }
30
+ public string Status { get ; set ; }
31
+ }
32
+
33
+ public class OpenAIFileResponse : OpenAIFile , IResponse
34
+ {
35
+ public ApiError Error { get ; set ; }
36
+ }
37
+
38
+ public class ApiError
39
+ {
40
+ public string Message ;
41
+ public string Type ;
42
+ public object Param ;
43
+ public object Code ;
30
44
}
31
45
#endregion
32
46
33
47
#region Models API Data Types
34
- public struct ListModelsResponse
48
+ public struct ListModelsResponse : IResponse
35
49
{
50
+ public ApiError Error { get ; set ; }
36
51
public string Object { get ; set ; }
37
- public Model [ ] Data { get ; set ; }
52
+ public OpenAIModel [ ] Data { get ; set ; }
38
53
}
39
54
40
- public struct Model
55
+ public class OpenAIModel
41
56
{
42
57
public string Id { get ; set ; }
43
58
public string Object { get ; set ; }
44
59
public string OwnedBy { get ; set ; }
60
+ public long Created { get ; set ; }
61
+ public string Root { get ; set ; }
62
+ public string Parent { get ; set ; }
45
63
public Dictionary < string , object > [ ] Permission { get ; set ; }
46
64
}
65
+
66
+ public class OpenAIModelResponse : OpenAIModel , IResponse
67
+ {
68
+ public ApiError Error { get ; set ; }
69
+ }
47
70
#endregion
48
71
49
72
#region Completions API Data Types
@@ -67,8 +90,9 @@ public sealed class CreateCompletionRequest
67
90
public string User { get ; set ; }
68
91
}
69
92
70
- public struct CreateCompletionResponse
93
+ public struct CreateCompletionResponse : IResponse
71
94
{
95
+ public ApiError Error { get ; set ; }
72
96
public string Id { get ; set ; }
73
97
public string Object { get ; set ; }
74
98
public long Created { get ; set ; }
@@ -89,8 +113,9 @@ public sealed class CreateEditRequest
89
113
public int ? N { get ; set ; } = 1 ;
90
114
}
91
115
92
- public struct CreateEditResponse
116
+ public struct CreateEditResponse : IResponse
93
117
{
118
+ public ApiError Error { get ; set ; }
94
119
public string Object { get ; set ; }
95
120
public long Created { get ; set ; }
96
121
public Choice [ ] Choices { get ; set ; }
@@ -124,8 +149,9 @@ public sealed class CreateImageVariationRequest: CreateImageRequestBase
124
149
public string Image { get ; set ; }
125
150
}
126
151
127
- public struct CreateImageResponse
152
+ public struct CreateImageResponse : IResponse
128
153
{
154
+ public ApiError Error { get ; set ; }
129
155
public long Created { get ; set ; }
130
156
public ImageData [ ] Data { get ; set ; }
131
157
}
@@ -145,8 +171,9 @@ public struct CreateEmbeddingsRequest
145
171
public string User { get ; set ; }
146
172
}
147
173
148
- public struct CreateEmbeddingsResponse
174
+ public struct CreateEmbeddingsResponse : IResponse
149
175
{
176
+ public ApiError Error { get ; set ; }
150
177
public string Object { get ; set ; }
151
178
public EmbeddingData [ ] Data ;
152
179
public string Model { get ; set ; }
@@ -162,14 +189,16 @@ public struct EmbeddingData
162
189
#endregion
163
190
164
191
#region Files API Data Types
165
- public struct ListFilesResponse
192
+ public struct ListFilesResponse : IResponse
166
193
{
194
+ public ApiError Error { get ; set ; }
167
195
public string Object { get ; set ; }
168
196
public OpenAIFile [ ] Data { get ; set ; }
169
197
}
170
198
171
- public struct DeleteResponse
199
+ public struct DeleteResponse : IResponse
172
200
{
201
+ public ApiError Error { get ; set ; }
173
202
public string Id { get ; set ; }
174
203
public string Object { get ; set ; }
175
204
public bool Deleted { get ; set ; }
@@ -199,27 +228,29 @@ public class CreateFineTuneRequest
199
228
public string Suffix { get ; set ; }
200
229
}
201
230
202
- public struct ListFineTunesResponse
231
+ public struct ListFineTunesResponse : IResponse
203
232
{
233
+ public ApiError Error { get ; set ; }
204
234
public string Object { get ; set ; }
205
235
public FineTune [ ] Data { get ; set ; }
206
236
}
207
237
208
- public struct ListFineTuneEventsResponse
238
+ public struct ListFineTuneEventsResponse : IResponse
209
239
{
240
+ public ApiError Error { get ; set ; }
210
241
public string Object { get ; set ; }
211
242
public FineTuneEvent [ ] Data { get ; set ; }
212
243
}
213
244
214
- public struct FineTune
245
+ public class FineTune
215
246
{
216
247
public string Id { get ; set ; }
217
248
public string Object { get ; set ; }
218
249
public long CreatedAt { get ; set ; }
219
250
public long UpdatedAt { get ; set ; }
220
251
public string Model { get ; set ; }
221
252
public string FineTunedModel { get ; set ; }
222
- public string OrganizationID { get ; set ; }
253
+ public string OrganizationId { get ; set ; }
223
254
public string Status { get ; set ; }
224
255
public Dictionary < string , object > Hyperparams { get ; set ; }
225
256
public OpenAIFile [ ] TrainingFiles { get ; set ; }
@@ -228,6 +259,11 @@ public struct FineTune
228
259
public FineTuneEvent [ ] Events { get ; set ; }
229
260
}
230
261
262
+ public class FineTuneResponse : FineTune , IResponse
263
+ {
264
+ public ApiError Error { get ; set ; }
265
+ }
266
+
231
267
public struct FineTuneEvent
232
268
{
233
269
public string Object { get ; set ; }
@@ -244,8 +280,9 @@ public class CreateModerationRequest
244
280
public string Model { get ; set ; } = ModerationModel . Latest ;
245
281
}
246
282
247
- public struct CreateModerationResponse
283
+ public struct CreateModerationResponse : IResponse
248
284
{
285
+ public ApiError Error { get ; set ; }
249
286
public string Id { get ; set ; }
250
287
public string Model { get ; set ; }
251
288
public ModerationResult [ ] Results { get ; set ; }
0 commit comments