-
Notifications
You must be signed in to change notification settings - Fork 6
/
schema.ts
288 lines (239 loc) · 8.69 KB
/
schema.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
import type { ApiClientOptions, ApiClientResponse } from './api/client.js';
import type { Empty, OmitVersion, Replace } from './utils/types.js';
type InputQueryWrapper<T> = OmitVersion<T>; // For some reason, `requestBody` is optional in the generated schema
type InputBodyWrapper<T> = NonNullable<T>; // For some reason, `requestBody` is optional in the generated schema
type OutputWrapper<T> = NonNullable<T>; // clientErrorWrapper ensures the output is defined
// TextGenerationService
export type TextGenerationCreateInput = InputBodyWrapper<
ApiClientOptions<'POST', '/v2/text/generation'>['body']
>;
export type TextGenerationCreateOutput = OutputWrapper<
ApiClientResponse<'POST', '/v2/text/generation'>['data']
>;
export type TextGenerationCreateStreamInput = InputBodyWrapper<
ApiClientOptions<'POST', '/v2/text/generation_stream'>['body']
>;
export type TextGenerationCreateStreamOutput = OutputWrapper<
ApiClientResponse<'POST', '/v2/text/generation_stream'>['data']
>;
// TextTokenizationService
export type TextTokenizationCreateInput = InputBodyWrapper<
ApiClientOptions<'POST', '/v2/text/tokenization'>['body']
>;
export type TextTokenizationCreateOutput = OutputWrapper<
ApiClientResponse<'POST', '/v2/text/tokenization'>['data']
>;
// TextChatService
export type TextChatCreateInput = InputBodyWrapper<
ApiClientOptions<'POST', '/v2/text/chat'>['body']
>;
export type TextChatCreateOutput = OutputWrapper<
ApiClientResponse<'POST', '/v2/text/chat'>['data']
>;
export type TextChatCreateStreamInput = InputBodyWrapper<
ApiClientOptions<'POST', '/v2/text/chat_stream'>['body']
>;
export type TextChatCreateStreamOutput = OutputWrapper<
ApiClientResponse<'POST', '/v2/text/chat_stream'>['data']
>;
// TextEmbeddingService
export type TextEmbeddingCreateInput = InputBodyWrapper<
ApiClientOptions<'POST', '/v2/text/embeddings'>['body']
>;
export type TextEmbeddingCreateOutput = OutputWrapper<
ApiClientResponse<'POST', '/v2/text/embeddings'>['data']
>;
// TextSentenceSimilarityService
export type TextSentenceSimilarityCreateInput = InputBodyWrapper<
ApiClientOptions<'POST', '/v2/beta/text/sentence-similarity'>['body']
>;
export type TextSentenceSimilarityCreateOutput = OutputWrapper<
ApiClientResponse<'POST', '/v2/beta/text/sentence-similarity'>['data']
>;
// ModelService
export type ModelServiceListInput = InputQueryWrapper<
ApiClientOptions<'GET', '/v2/models'>['params']['query']
>;
export type ModelServiceListOutput = OutputWrapper<
ApiClientResponse<'GET', '/v2/models'>['data']
>;
export type ModelServiceRetrieveInput = ApiClientOptions<
'GET',
'/v2/models/{id}'
>['params']['path'];
export type ModelServiceRetrieveOutput = OutputWrapper<
ApiClientResponse<'GET', '/v2/models/{id}'>['data']
>;
// RequestService
export type RequestServiceListInput = InputQueryWrapper<
ApiClientOptions<'GET', '/v2/requests'>['params']['query']
>;
export type RequestServiceListOutput = OutputWrapper<
ApiClientResponse<'GET', '/v2/requests'>['data']
>;
export type RequestServiceDeleteInput = ApiClientOptions<
'DELETE',
'/v2/requests/{id}'
>['params']['path'];
export type RequestServiceDeleteOutput = OutputWrapper<
ApiClientResponse<'DELETE', '/v2/requests/{id}'>['data']
>;
export type RequestServiceChatInput = ApiClientOptions<
'GET',
'/v2/requests/chat/{conversation_id}'
>['params']['path'];
export type RequestServiceChatOutput = OutputWrapper<
ApiClientResponse<'GET', '/v2/requests/chat/{conversation_id}'>['data']
>;
// PromptService
export type PromptServiceListInput = InputQueryWrapper<
ApiClientOptions<'GET', '/v2/prompts'>['params']['query']
>;
export type PromptServiceListOutput = OutputWrapper<
ApiClientResponse<'GET', '/v2/prompts'>['data']
>;
export type PromptServiceRetrieveInput = ApiClientOptions<
'GET',
'/v2/prompts/{id}'
>['params']['path'];
export type PromptServiceRetrieveOutput = OutputWrapper<
ApiClientResponse<'GET', '/v2/prompts/{id}'>['data']
>;
export type PromptServiceCreateInput = InputBodyWrapper<
ApiClientOptions<'POST', '/v2/prompts'>['body']
>;
export type PromptServiceCreateOutput = OutputWrapper<
ApiClientResponse<'POST', '/v2/prompts'>['data']
>;
export type PromptServiceDeleteInput = ApiClientOptions<
'DELETE',
'/v2/prompts/{id}'
>['params']['path'];
export type PromptServiceDeleteOutput = OutputWrapper<
ApiClientResponse<'DELETE', '/v2/prompts/{id}'>['data']
>;
// TuneService
export type TuneServiceListInput = InputQueryWrapper<
ApiClientOptions<'GET', '/v2/tunes'>['params']['query']
>;
export type TuneServiceListOutput = OutputWrapper<
ApiClientResponse<'GET', '/v2/tunes'>['data']
>;
export type TuneServiceReadInput = ApiClientOptions<
'GET',
'/v2/tunes/{id}/content/{type}'
>['params']['path'];
export type TuneServiceReadOutput = Blob; // TODO Replace with proper derivation
export type TuneServiceRetrieveInput = ApiClientOptions<
'GET',
'/v2/tunes/{id}'
>['params']['path'];
export type TuneServiceRetrieveOutput = OutputWrapper<
ApiClientResponse<'GET', '/v2/tunes/{id}'>['data']
>;
export type TuneServiceCreateInput = InputBodyWrapper<
ApiClientOptions<'POST', '/v2/tunes'>['body']
>;
export type TuneServiceCreateOutput = OutputWrapper<
ApiClientResponse<'POST', '/v2/tunes'>['data']
>;
export type TuneServiceDeleteInput = ApiClientOptions<
'DELETE',
'/v2/tunes/{id}'
>['params']['path'];
export type TuneServiceDeleteOutput = OutputWrapper<
ApiClientResponse<'DELETE', '/v2/tunes/{id}'>['data']
>;
export type TuneServiceTypesInput = Empty;
export type TuneServiceTypesOutput = OutputWrapper<
ApiClientResponse<'GET', '/v2/tuning_types'>['data']
>;
// UserService
export type UserServiceCreateInput = InputBodyWrapper<
ApiClientOptions<'POST', '/v2/user'>['body']
>;
export type UserServiceCreateOutput = OutputWrapper<
ApiClientResponse<'POST', '/v2/user'>['data']
>;
export type UserServiceRetrieveInput = Empty;
export type UserServiceRetrieveOutput = OutputWrapper<
ApiClientResponse<'GET', '/v2/user'>['data']
>;
export type UserServiceUpdateInput = InputBodyWrapper<
ApiClientOptions<'PATCH', '/v2/user'>['body']
>;
export type UserServiceUpdateOutput = OutputWrapper<
ApiClientResponse<'PATCH', '/v2/user'>['data']
>;
export type UserServiceDeleteInput = Empty;
export type UserServiceDeleteOutput = OutputWrapper<
ApiClientResponse<'DELETE', '/v2/user'>['data']
>;
// FileService
export type FileServiceCreateInput = Replace<
InputBodyWrapper<ApiClientOptions<'POST', '/v2/files'>['body']>,
{ file: { content: Blob; name: string } }
>;
export type FileServiceCreateOutput = OutputWrapper<
ApiClientResponse<'POST', '/v2/files'>['data']
>;
export type FileServiceRetrieveInput = ApiClientOptions<
'GET',
'/v2/files/{id}'
>['params']['path'];
export type FileServiceRetrieveOutput = OutputWrapper<
ApiClientResponse<'GET', '/v2/files/{id}'>['data']
>;
export type FileServiceReadInput = ApiClientOptions<
'GET',
'/v2/files/{id}/content'
>['params']['path'];
export type FileServiceReadOutput = Blob; // TODO Replace with proper derivation
export type FileServiceDeleteInput = ApiClientOptions<
'DELETE',
'/v2/files/{id}'
>['params']['path'];
export type FileServiceDeleteOutput = OutputWrapper<
ApiClientResponse<'DELETE', '/v2/files/{id}'>['data']
>;
export type FileServiceListInput = InputQueryWrapper<
ApiClientOptions<'GET', '/v2/files'>['params']['query']
>;
export type FileServiceListOutput = OutputWrapper<
ApiClientResponse<'GET', '/v2/files'>['data']
>;
// SystemPromptService
export type SystemPromptServiceCreateInput = InputBodyWrapper<
ApiClientOptions<'POST', '/v2/system_prompts'>['body']
>;
export type SystemPromptServiceCreateOutput = OutputWrapper<
ApiClientResponse<'POST', '/v2/system_prompts'>['data']
>;
export type SystemPromptServiceRetrieveInput = ApiClientOptions<
'GET',
'/v2/system_prompts/{id}'
>['params']['path'];
export type SystemPromptServiceRetrieveOutput = OutputWrapper<
ApiClientResponse<'GET', '/v2/system_prompts/{id}'>['data']
>;
export type SystemPromptServiceUpdateInput = ApiClientOptions<
'PUT',
'/v2/system_prompts/{id}'
>['params']['path'] &
InputBodyWrapper<ApiClientOptions<'PUT', '/v2/system_prompts/{id}'>['body']>;
export type SystemPromptServiceUpdateOutput = OutputWrapper<
ApiClientResponse<'PUT', '/v2/system_prompts/{id}'>['data']
>;
export type SystemPromptServiceDeleteInput = ApiClientOptions<
'DELETE',
'/v2/system_prompts/{id}'
>['params']['path'];
export type SystemPromptServiceDeleteOutput = OutputWrapper<
ApiClientResponse<'DELETE', '/v2/system_prompts/{id}'>['data']
>;
export type SystemPromptServiceListInput = InputQueryWrapper<
ApiClientOptions<'GET', '/v2/system_prompts'>['params']['query']
>;
export type SystemPromptServiceListOutput = OutputWrapper<
ApiClientResponse<'GET', '/v2/system_prompts'>['data']
>;