@effect/ai-openai 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/Generated/package.json +6 -0
  2. package/LICENSE +21 -0
  3. package/OpenAiClient/package.json +6 -0
  4. package/OpenAiCompletions/package.json +6 -0
  5. package/OpenAiConfig/package.json +6 -0
  6. package/OpenAiTokenizer/package.json +6 -0
  7. package/README.md +1 -0
  8. package/dist/cjs/Generated.js +2702 -0
  9. package/dist/cjs/Generated.js.map +1 -0
  10. package/dist/cjs/OpenAiClient.js +153 -0
  11. package/dist/cjs/OpenAiClient.js.map +1 -0
  12. package/dist/cjs/OpenAiCompletions.js +208 -0
  13. package/dist/cjs/OpenAiCompletions.js.map +1 -0
  14. package/dist/cjs/OpenAiConfig.js +26 -0
  15. package/dist/cjs/OpenAiConfig.js.map +1 -0
  16. package/dist/cjs/OpenAiTokenizer.js +50 -0
  17. package/dist/cjs/OpenAiTokenizer.js.map +1 -0
  18. package/dist/cjs/index.js +19 -0
  19. package/dist/cjs/index.js.map +1 -0
  20. package/dist/dts/Generated.d.ts +5759 -0
  21. package/dist/dts/Generated.d.ts.map +1 -0
  22. package/dist/dts/OpenAiClient.d.ts +113 -0
  23. package/dist/dts/OpenAiClient.d.ts.map +1 -0
  24. package/dist/dts/OpenAiCompletions.d.ts +19 -0
  25. package/dist/dts/OpenAiCompletions.d.ts.map +1 -0
  26. package/dist/dts/OpenAiConfig.d.ts +55 -0
  27. package/dist/dts/OpenAiConfig.d.ts.map +1 -0
  28. package/dist/dts/OpenAiTokenizer.d.ts +10 -0
  29. package/dist/dts/OpenAiTokenizer.d.ts.map +1 -0
  30. package/dist/dts/index.d.ts +21 -0
  31. package/dist/dts/index.d.ts.map +1 -0
  32. package/dist/esm/Generated.js +2493 -0
  33. package/dist/esm/Generated.js.map +1 -0
  34. package/dist/esm/OpenAiClient.js +139 -0
  35. package/dist/esm/OpenAiClient.js.map +1 -0
  36. package/dist/esm/OpenAiCompletions.js +197 -0
  37. package/dist/esm/OpenAiCompletions.js.map +1 -0
  38. package/dist/esm/OpenAiConfig.js +16 -0
  39. package/dist/esm/OpenAiConfig.js.map +1 -0
  40. package/dist/esm/OpenAiTokenizer.js +40 -0
  41. package/dist/esm/OpenAiTokenizer.js.map +1 -0
  42. package/dist/esm/index.js +21 -0
  43. package/dist/esm/index.js.map +1 -0
  44. package/dist/esm/package.json +4 -0
  45. package/package.json +80 -0
  46. package/src/Generated.ts +3936 -0
  47. package/src/OpenAiClient.ts +291 -0
  48. package/src/OpenAiCompletions.ts +260 -0
  49. package/src/OpenAiConfig.ts +31 -0
  50. package/src/OpenAiTokenizer.ts +59 -0
  51. package/src/index.ts +24 -0
@@ -0,0 +1,2493 @@
1
+ import * as HttpClientError from "@effect/platform/HttpClientError";
2
+ import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
3
+ import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
4
+ import * as S from "@effect/schema/Schema";
5
+ import * as Effect from "effect/Effect";
6
+ export class ChatCompletionRequestMessageContentPartText extends /*#__PURE__*/S.Struct({
7
+ "type": /*#__PURE__*/S.Literal("text"),
8
+ "text": S.String
9
+ }) {}
10
+ export class ChatCompletionRequestSystemMessageContentPart extends ChatCompletionRequestMessageContentPartText {}
11
+ export class ChatCompletionRequestSystemMessage extends /*#__PURE__*/S.Struct({
12
+ "content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.NonEmptyArray(ChatCompletionRequestSystemMessageContentPart)),
13
+ "role": /*#__PURE__*/S.Literal("system"),
14
+ "name": /*#__PURE__*/S.optional(S.String)
15
+ }) {}
16
+ export class ChatCompletionRequestMessageContentPartImage extends /*#__PURE__*/S.Struct({
17
+ "type": /*#__PURE__*/S.Literal("image_url"),
18
+ "image_url": /*#__PURE__*/S.Struct({
19
+ "url": S.String,
20
+ "detail": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("auto", "low", "high"), {
21
+ default: () => "auto"
22
+ })
23
+ })
24
+ }) {}
25
+ export class ChatCompletionRequestUserMessageContentPart extends /*#__PURE__*/S.Union(ChatCompletionRequestMessageContentPartText, ChatCompletionRequestMessageContentPartImage) {}
26
+ export class ChatCompletionRequestUserMessage extends /*#__PURE__*/S.Struct({
27
+ "content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.NonEmptyArray(ChatCompletionRequestUserMessageContentPart)),
28
+ "role": /*#__PURE__*/S.Literal("user"),
29
+ "name": /*#__PURE__*/S.optional(S.String)
30
+ }) {}
31
+ export class ChatCompletionRequestMessageContentPartRefusal extends /*#__PURE__*/S.Struct({
32
+ "type": /*#__PURE__*/S.Literal("refusal"),
33
+ "refusal": S.String
34
+ }) {}
35
+ export class ChatCompletionRequestAssistantMessageContentPart extends /*#__PURE__*/S.Union(ChatCompletionRequestMessageContentPartText, ChatCompletionRequestMessageContentPartRefusal) {}
36
+ export class ChatCompletionMessageToolCall extends /*#__PURE__*/S.Struct({
37
+ "id": S.String,
38
+ "type": /*#__PURE__*/S.Literal("function"),
39
+ "function": /*#__PURE__*/S.Struct({
40
+ "name": S.String,
41
+ "arguments": S.String
42
+ })
43
+ }) {}
44
+ export class ChatCompletionMessageToolCalls extends /*#__PURE__*/S.Array(ChatCompletionMessageToolCall) {}
45
+ export class ChatCompletionRequestAssistantMessage extends /*#__PURE__*/S.Struct({
46
+ "content": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.NonEmptyArray(ChatCompletionRequestAssistantMessageContentPart)), {
47
+ nullable: true
48
+ }),
49
+ "refusal": /*#__PURE__*/S.optionalWith(S.String, {
50
+ nullable: true
51
+ }),
52
+ "role": /*#__PURE__*/S.Literal("assistant"),
53
+ "name": /*#__PURE__*/S.optional(S.String),
54
+ "tool_calls": /*#__PURE__*/S.optional(ChatCompletionMessageToolCalls),
55
+ "function_call": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Struct({
56
+ "arguments": S.String,
57
+ "name": S.String
58
+ }), {
59
+ nullable: true
60
+ })
61
+ }) {}
62
+ export class ChatCompletionRequestToolMessageContentPart extends ChatCompletionRequestMessageContentPartText {}
63
+ export class ChatCompletionRequestToolMessage extends /*#__PURE__*/S.Struct({
64
+ "role": /*#__PURE__*/S.Literal("tool"),
65
+ "content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.NonEmptyArray(ChatCompletionRequestToolMessageContentPart)),
66
+ "tool_call_id": S.String
67
+ }) {}
68
+ export class ChatCompletionRequestFunctionMessage extends /*#__PURE__*/S.Struct({
69
+ "role": /*#__PURE__*/S.Literal("function"),
70
+ "content": /*#__PURE__*/S.NullOr(S.String),
71
+ "name": S.String
72
+ }) {}
73
+ export class ChatCompletionRequestMessage extends /*#__PURE__*/S.Union(ChatCompletionRequestSystemMessage, ChatCompletionRequestUserMessage, ChatCompletionRequestAssistantMessage, ChatCompletionRequestToolMessage, ChatCompletionRequestFunctionMessage) {}
74
+ export class ResponseFormatText extends /*#__PURE__*/S.Struct({
75
+ "type": /*#__PURE__*/S.Literal("text")
76
+ }) {}
77
+ export class ResponseFormatJsonObject extends /*#__PURE__*/S.Struct({
78
+ "type": /*#__PURE__*/S.Literal("json_object")
79
+ }) {}
80
+ export class ResponseFormatJsonSchemaSchema extends /*#__PURE__*/S.Record({
81
+ key: S.String,
82
+ value: S.Unknown
83
+ }) {}
84
+ export class ResponseFormatJsonSchema extends /*#__PURE__*/S.Struct({
85
+ "type": /*#__PURE__*/S.Literal("json_schema"),
86
+ "json_schema": /*#__PURE__*/S.Struct({
87
+ "description": /*#__PURE__*/S.optional(S.String),
88
+ "name": S.String,
89
+ "schema": /*#__PURE__*/S.optional(ResponseFormatJsonSchemaSchema),
90
+ "strict": /*#__PURE__*/S.optionalWith(S.Boolean, {
91
+ nullable: true,
92
+ default: () => false
93
+ })
94
+ })
95
+ }) {}
96
+ export class ChatCompletionStreamOptions extends /*#__PURE__*/S.Struct({
97
+ "include_usage": /*#__PURE__*/S.optional(S.Boolean)
98
+ }) {}
99
+ export class FunctionParameters extends /*#__PURE__*/S.Record({
100
+ key: S.String,
101
+ value: S.Unknown
102
+ }) {}
103
+ export class FunctionObject extends /*#__PURE__*/S.Struct({
104
+ "description": /*#__PURE__*/S.optional(S.String),
105
+ "name": S.String,
106
+ "parameters": /*#__PURE__*/S.optional(FunctionParameters),
107
+ "strict": /*#__PURE__*/S.optionalWith(S.Boolean, {
108
+ nullable: true,
109
+ default: () => false
110
+ })
111
+ }) {}
112
+ export class ChatCompletionTool extends /*#__PURE__*/S.Struct({
113
+ "type": /*#__PURE__*/S.Literal("function"),
114
+ "function": FunctionObject
115
+ }) {}
116
+ export class ChatCompletionNamedToolChoice extends /*#__PURE__*/S.Struct({
117
+ "type": /*#__PURE__*/S.Literal("function"),
118
+ "function": /*#__PURE__*/S.Struct({
119
+ "name": S.String
120
+ })
121
+ }) {}
122
+ export class ChatCompletionToolChoiceOption extends /*#__PURE__*/S.Union( /*#__PURE__*/S.Literal("none", "auto", "required"), ChatCompletionNamedToolChoice) {}
123
+ export class ParallelToolCalls extends S.Boolean {}
124
+ export class ChatCompletionFunctionCallOption extends /*#__PURE__*/S.Struct({
125
+ "name": S.String
126
+ }) {}
127
+ export class ChatCompletionFunctions extends /*#__PURE__*/S.Struct({
128
+ "description": /*#__PURE__*/S.optional(S.String),
129
+ "name": S.String,
130
+ "parameters": /*#__PURE__*/S.optional(FunctionParameters)
131
+ }) {}
132
+ export class CreateChatCompletionRequest extends /*#__PURE__*/S.Class("CreateChatCompletionRequest")({
133
+ "messages": /*#__PURE__*/S.NonEmptyArray(ChatCompletionRequestMessage),
134
+ "model": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Literal("o1-preview", "o1-preview-2024-09-12", "o1-mini", "o1-mini-2024-09-12", "gpt-4o", "gpt-4o-2024-08-06", "gpt-4o-2024-05-13", "gpt-4o-2024-08-06", "chatgpt-4o-latest", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", "gpt-4-turbo-preview", "gpt-4-1106-preview", "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", "gpt-4-32k", "gpt-4-32k-0314", "gpt-4-32k-0613", "gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-0301", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-1106", "gpt-3.5-turbo-0125", "gpt-3.5-turbo-16k-0613")),
135
+ "frequency_penalty": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(-2), /*#__PURE__*/S.lessThanOrEqualTo(2)), {
136
+ nullable: true,
137
+ default: () => 0
138
+ }),
139
+ "logit_bias": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Record({
140
+ key: S.String,
141
+ value: S.Unknown
142
+ }), {
143
+ nullable: true
144
+ }),
145
+ "logprobs": /*#__PURE__*/S.optionalWith(S.Boolean, {
146
+ nullable: true,
147
+ default: () => false
148
+ }),
149
+ "top_logprobs": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(20)), {
150
+ nullable: true
151
+ }),
152
+ "max_tokens": /*#__PURE__*/S.optionalWith(S.Int, {
153
+ nullable: true
154
+ }),
155
+ "max_completion_tokens": /*#__PURE__*/S.optionalWith(S.Int, {
156
+ nullable: true
157
+ }),
158
+ "n": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(128)), {
159
+ nullable: true,
160
+ default: () => 1
161
+ }),
162
+ "presence_penalty": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(-2), /*#__PURE__*/S.lessThanOrEqualTo(2)), {
163
+ nullable: true,
164
+ default: () => 0
165
+ }),
166
+ "response_format": /*#__PURE__*/S.optional( /*#__PURE__*/S.Union(ResponseFormatText, ResponseFormatJsonObject, ResponseFormatJsonSchema)),
167
+ "seed": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(-9223372036854776000), /*#__PURE__*/S.lessThanOrEqualTo(9223372036854776000)), {
168
+ nullable: true
169
+ }),
170
+ "service_tier": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("auto", "default"), {
171
+ nullable: true
172
+ }),
173
+ "stop": /*#__PURE__*/S.optional( /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.minItems(1), /*#__PURE__*/S.maxItems(4)))),
174
+ "stream": /*#__PURE__*/S.optionalWith(S.Boolean, {
175
+ nullable: true,
176
+ default: () => false
177
+ }),
178
+ "stream_options": /*#__PURE__*/S.optionalWith(ChatCompletionStreamOptions, {
179
+ nullable: true
180
+ }),
181
+ "temperature": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(2)), {
182
+ nullable: true,
183
+ default: () => 1
184
+ }),
185
+ "top_p": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
186
+ nullable: true,
187
+ default: () => 1
188
+ }),
189
+ "tools": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(ChatCompletionTool)),
190
+ "tool_choice": /*#__PURE__*/S.optional(ChatCompletionToolChoiceOption),
191
+ "parallel_tool_calls": /*#__PURE__*/S.optionalWith(ParallelToolCalls, {
192
+ default: () => true
193
+ }),
194
+ "user": /*#__PURE__*/S.optional(S.String),
195
+ "function_call": /*#__PURE__*/S.optional( /*#__PURE__*/S.Union( /*#__PURE__*/S.Literal("none", "auto"), ChatCompletionFunctionCallOption)),
196
+ "functions": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(ChatCompletionFunctions).pipe( /*#__PURE__*/S.minItems(1), /*#__PURE__*/S.maxItems(128)))
197
+ }) {}
198
+ export class ChatCompletionResponseMessage extends /*#__PURE__*/S.Struct({
199
+ "content": /*#__PURE__*/S.NullOr(S.String),
200
+ "refusal": /*#__PURE__*/S.NullOr(S.String),
201
+ "tool_calls": /*#__PURE__*/S.optional(ChatCompletionMessageToolCalls),
202
+ "role": /*#__PURE__*/S.Literal("assistant"),
203
+ "function_call": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
204
+ "arguments": S.String,
205
+ "name": S.String
206
+ }))
207
+ }) {}
208
+ export class ChatCompletionTokenLogprob extends /*#__PURE__*/S.Struct({
209
+ "token": S.String,
210
+ "logprob": S.Number,
211
+ "bytes": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Array(S.Int)),
212
+ "top_logprobs": /*#__PURE__*/S.Array( /*#__PURE__*/S.Struct({
213
+ "token": S.String,
214
+ "logprob": S.Number,
215
+ "bytes": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Array(S.Int))
216
+ }))
217
+ }) {}
218
+ export class CompletionUsage extends /*#__PURE__*/S.Struct({
219
+ "completion_tokens": S.Int,
220
+ "prompt_tokens": S.Int,
221
+ "total_tokens": S.Int,
222
+ "completion_tokens_details": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
223
+ "reasoning_tokens": /*#__PURE__*/S.optional(S.Int)
224
+ }))
225
+ }) {}
226
+ export class CreateChatCompletionResponse extends /*#__PURE__*/S.Class("CreateChatCompletionResponse")({
227
+ "id": S.String,
228
+ "choices": /*#__PURE__*/S.Array( /*#__PURE__*/S.Struct({
229
+ "finish_reason": /*#__PURE__*/S.Literal("stop", "length", "tool_calls", "content_filter", "function_call"),
230
+ "index": S.Int,
231
+ "message": ChatCompletionResponseMessage,
232
+ "logprobs": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Struct({
233
+ "content": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Array(ChatCompletionTokenLogprob)),
234
+ "refusal": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Array(ChatCompletionTokenLogprob))
235
+ }))
236
+ })),
237
+ "created": S.Int,
238
+ "model": S.String,
239
+ "service_tier": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("scale", "default"), {
240
+ nullable: true
241
+ }),
242
+ "system_fingerprint": /*#__PURE__*/S.optional(S.String),
243
+ "object": /*#__PURE__*/S.Literal("chat.completion"),
244
+ "usage": /*#__PURE__*/S.optional(CompletionUsage)
245
+ }) {}
246
+ export class CreateCompletionRequest extends /*#__PURE__*/S.Class("CreateCompletionRequest")({
247
+ "model": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Literal("gpt-3.5-turbo-instruct", "davinci-002", "babbage-002")),
248
+ "prompt": /*#__PURE__*/S.NullOr(S.Union(S.String, S.Array(S.String), S.NonEmptyArray(S.Int), S.NonEmptyArray(S.NonEmptyArray(S.Int)))).pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "<|endoftext|>")),
249
+ "best_of": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(20)), {
250
+ nullable: true,
251
+ default: () => 1
252
+ }),
253
+ "echo": /*#__PURE__*/S.optionalWith(S.Boolean, {
254
+ nullable: true,
255
+ default: () => false
256
+ }),
257
+ "frequency_penalty": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(-2), /*#__PURE__*/S.lessThanOrEqualTo(2)), {
258
+ nullable: true,
259
+ default: () => 0
260
+ }),
261
+ "logit_bias": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Record({
262
+ key: S.String,
263
+ value: S.Unknown
264
+ }), {
265
+ nullable: true
266
+ }),
267
+ "logprobs": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(5)), {
268
+ nullable: true
269
+ }),
270
+ "max_tokens": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)), {
271
+ nullable: true,
272
+ default: () => 16
273
+ }),
274
+ "n": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(128)), {
275
+ nullable: true,
276
+ default: () => 1
277
+ }),
278
+ "presence_penalty": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(-2), /*#__PURE__*/S.lessThanOrEqualTo(2)), {
279
+ nullable: true,
280
+ default: () => 0
281
+ }),
282
+ "seed": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(-9223372036854776000), /*#__PURE__*/S.lessThanOrEqualTo(9223372036854776000)), {
283
+ nullable: true
284
+ }),
285
+ "stop": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.minItems(1), /*#__PURE__*/S.maxItems(4))), {
286
+ nullable: true
287
+ }),
288
+ "stream": /*#__PURE__*/S.optionalWith(S.Boolean, {
289
+ nullable: true,
290
+ default: () => false
291
+ }),
292
+ "stream_options": /*#__PURE__*/S.optionalWith(ChatCompletionStreamOptions, {
293
+ nullable: true
294
+ }),
295
+ "suffix": /*#__PURE__*/S.optionalWith(S.String, {
296
+ nullable: true
297
+ }),
298
+ "temperature": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(2)), {
299
+ nullable: true,
300
+ default: () => 1
301
+ }),
302
+ "top_p": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
303
+ nullable: true,
304
+ default: () => 1
305
+ }),
306
+ "user": /*#__PURE__*/S.optional(S.String)
307
+ }) {}
308
+ export class CreateCompletionResponse extends /*#__PURE__*/S.Class("CreateCompletionResponse")({
309
+ "id": S.String,
310
+ "choices": /*#__PURE__*/S.Array( /*#__PURE__*/S.Struct({
311
+ "finish_reason": /*#__PURE__*/S.Literal("stop", "length", "content_filter"),
312
+ "index": S.Int,
313
+ "logprobs": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Struct({
314
+ "text_offset": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.Int)),
315
+ "token_logprobs": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.Number)),
316
+ "tokens": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String)),
317
+ "top_logprobs": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array( /*#__PURE__*/S.Record({
318
+ key: S.String,
319
+ value: S.Unknown
320
+ })))
321
+ })),
322
+ "text": S.String
323
+ })),
324
+ "created": S.Int,
325
+ "model": S.String,
326
+ "system_fingerprint": /*#__PURE__*/S.optional(S.String),
327
+ "object": /*#__PURE__*/S.Literal("text_completion"),
328
+ "usage": /*#__PURE__*/S.optional(CompletionUsage)
329
+ }) {}
330
+ export class CreateImageRequest extends /*#__PURE__*/S.Class("CreateImageRequest")({
331
+ "prompt": S.String,
332
+ "model": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Literal("dall-e-2", "dall-e-3")), {
333
+ nullable: true,
334
+ default: () => "dall-e-2"
335
+ }),
336
+ "n": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(10)), {
337
+ nullable: true,
338
+ default: () => 1
339
+ }),
340
+ "quality": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("standard", "hd"), {
341
+ default: () => "standard"
342
+ }),
343
+ "response_format": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("url", "b64_json"), {
344
+ nullable: true,
345
+ default: () => "url"
346
+ }),
347
+ "size": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("256x256", "512x512", "1024x1024", "1792x1024", "1024x1792"), {
348
+ nullable: true,
349
+ default: () => "1024x1024"
350
+ }),
351
+ "style": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("vivid", "natural"), {
352
+ nullable: true,
353
+ default: () => "vivid"
354
+ }),
355
+ "user": /*#__PURE__*/S.optional(S.String)
356
+ }) {}
357
+ export class Image extends /*#__PURE__*/S.Struct({
358
+ "b64_json": /*#__PURE__*/S.optional(S.String),
359
+ "url": /*#__PURE__*/S.optional(S.String),
360
+ "revised_prompt": /*#__PURE__*/S.optional(S.String)
361
+ }) {}
362
+ export class ImagesResponse extends /*#__PURE__*/S.Class("ImagesResponse")({
363
+ "created": S.Int,
364
+ "data": /*#__PURE__*/S.Array(Image)
365
+ }) {}
366
+ export class CreateEmbeddingRequest extends /*#__PURE__*/S.Class("CreateEmbeddingRequest")({
367
+ "input": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.minItems(1), /*#__PURE__*/S.maxItems(2048)), /*#__PURE__*/S.Array(S.Int).pipe( /*#__PURE__*/S.minItems(1), /*#__PURE__*/S.maxItems(2048)), /*#__PURE__*/S.Array(S.NonEmptyArray(S.Int)).pipe( /*#__PURE__*/S.minItems(1), /*#__PURE__*/S.maxItems(2048))),
368
+ "model": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Literal("text-embedding-ada-002", "text-embedding-3-small", "text-embedding-3-large")),
369
+ "encoding_format": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("float", "base64"), {
370
+ default: () => "float"
371
+ }),
372
+ "dimensions": /*#__PURE__*/S.optional( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1))),
373
+ "user": /*#__PURE__*/S.optional(S.String)
374
+ }) {}
375
+ export class Embedding extends /*#__PURE__*/S.Struct({
376
+ "index": S.Int,
377
+ "embedding": /*#__PURE__*/S.Array(S.Number),
378
+ "object": /*#__PURE__*/S.Literal("embedding")
379
+ }) {}
380
+ export class CreateEmbeddingResponse extends /*#__PURE__*/S.Class("CreateEmbeddingResponse")({
381
+ "data": /*#__PURE__*/S.Array(Embedding),
382
+ "model": S.String,
383
+ "object": /*#__PURE__*/S.Literal("list"),
384
+ "usage": /*#__PURE__*/S.Struct({
385
+ "prompt_tokens": S.Int,
386
+ "total_tokens": S.Int
387
+ })
388
+ }) {}
389
+ export class CreateSpeechRequest extends /*#__PURE__*/S.Class("CreateSpeechRequest")({
390
+ "model": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Literal("tts-1", "tts-1-hd")),
391
+ "input": /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.maxLength(4096)),
392
+ "voice": /*#__PURE__*/S.Literal("alloy", "echo", "fable", "onyx", "nova", "shimmer"),
393
+ "response_format": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("mp3", "opus", "aac", "flac", "wav", "pcm"), {
394
+ default: () => "mp3"
395
+ }),
396
+ "speed": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0.25), /*#__PURE__*/S.lessThanOrEqualTo(4)), {
397
+ default: () => 1
398
+ })
399
+ }) {}
400
+ export class CreateTranscriptionResponseJson extends /*#__PURE__*/S.Struct({
401
+ "text": S.String
402
+ }) {}
403
+ export class TranscriptionWord extends /*#__PURE__*/S.Struct({
404
+ "word": S.String,
405
+ "start": S.Number,
406
+ "end": S.Number
407
+ }) {}
408
+ export class TranscriptionSegment extends /*#__PURE__*/S.Struct({
409
+ "id": S.Int,
410
+ "seek": S.Int,
411
+ "start": S.Number,
412
+ "end": S.Number,
413
+ "text": S.String,
414
+ "tokens": /*#__PURE__*/S.Array(S.Int),
415
+ "temperature": S.Number,
416
+ "avg_logprob": S.Number,
417
+ "compression_ratio": S.Number,
418
+ "no_speech_prob": S.Number
419
+ }) {}
420
+ export class CreateTranscriptionResponseVerboseJson extends /*#__PURE__*/S.Struct({
421
+ "language": S.String,
422
+ "duration": S.String,
423
+ "text": S.String,
424
+ "words": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(TranscriptionWord)),
425
+ "segments": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(TranscriptionSegment))
426
+ }) {}
427
+ export class CreateTranscription200 extends /*#__PURE__*/S.Union(CreateTranscriptionResponseJson, CreateTranscriptionResponseVerboseJson) {}
428
+ export class CreateTranslationResponseJson extends /*#__PURE__*/S.Struct({
429
+ "text": S.String
430
+ }) {}
431
+ export class CreateTranslationResponseVerboseJson extends /*#__PURE__*/S.Struct({
432
+ "language": S.String,
433
+ "duration": S.String,
434
+ "text": S.String,
435
+ "segments": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(TranscriptionSegment))
436
+ }) {}
437
+ export class CreateTranslation200 extends /*#__PURE__*/S.Union(CreateTranslationResponseJson, CreateTranslationResponseVerboseJson) {}
438
+ export class ListFilesParams extends /*#__PURE__*/S.Struct({
439
+ "purpose": /*#__PURE__*/S.optional(S.String)
440
+ }) {}
441
+ export class OpenAIFile extends /*#__PURE__*/S.Struct({
442
+ "id": S.String,
443
+ "bytes": S.Int,
444
+ "created_at": S.Int,
445
+ "filename": S.String,
446
+ "object": /*#__PURE__*/S.Literal("file"),
447
+ "purpose": /*#__PURE__*/S.Literal("assistants", "assistants_output", "batch", "batch_output", "fine-tune", "fine-tune-results", "vision"),
448
+ "status": /*#__PURE__*/S.Literal("uploaded", "processed", "error"),
449
+ "status_details": /*#__PURE__*/S.optional(S.String)
450
+ }) {}
451
+ export class ListFilesResponse extends /*#__PURE__*/S.Class("ListFilesResponse")({
452
+ "data": /*#__PURE__*/S.Array(OpenAIFile),
453
+ "object": /*#__PURE__*/S.Literal("list")
454
+ }) {}
455
+ export class DeleteFileResponse extends /*#__PURE__*/S.Class("DeleteFileResponse")({
456
+ "id": S.String,
457
+ "object": /*#__PURE__*/S.Literal("file"),
458
+ "deleted": S.Boolean
459
+ }) {}
460
+ export class DownloadFile200 extends S.String {}
461
+ export class CreateUploadRequest extends /*#__PURE__*/S.Class("CreateUploadRequest")({
462
+ "filename": S.String,
463
+ "purpose": /*#__PURE__*/S.Literal("assistants", "batch", "fine-tune", "vision"),
464
+ "bytes": S.Int,
465
+ "mime_type": S.String
466
+ }) {}
467
+ export class Upload extends /*#__PURE__*/S.Class("Upload")({
468
+ "id": S.String,
469
+ "created_at": S.Int,
470
+ "filename": S.String,
471
+ "bytes": S.Int,
472
+ "purpose": S.String,
473
+ "status": /*#__PURE__*/S.Literal("pending", "completed", "cancelled", "expired"),
474
+ "expires_at": S.Int,
475
+ "object": /*#__PURE__*/S.optional( /*#__PURE__*/S.Literal("upload")),
476
+ "file": /*#__PURE__*/S.optional(OpenAIFile)
477
+ }) {}
478
+ export class UploadPart extends /*#__PURE__*/S.Class("UploadPart")({
479
+ "id": S.String,
480
+ "created_at": S.Int,
481
+ "upload_id": S.String,
482
+ "object": /*#__PURE__*/S.Literal("upload.part")
483
+ }) {}
484
+ export class CompleteUploadRequest extends /*#__PURE__*/S.Class("CompleteUploadRequest")({
485
+ "part_ids": /*#__PURE__*/S.Array(S.String),
486
+ "md5": /*#__PURE__*/S.optional(S.String)
487
+ }) {}
488
+ export class ListPaginatedFineTuningJobsParams extends /*#__PURE__*/S.Struct({
489
+ "after": /*#__PURE__*/S.optional(S.String),
490
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
491
+ default: () => 20
492
+ })
493
+ }) {}
494
+ export class FineTuningIntegration extends /*#__PURE__*/S.Struct({
495
+ "type": /*#__PURE__*/S.Literal("wandb"),
496
+ "wandb": /*#__PURE__*/S.Struct({
497
+ "project": S.String,
498
+ "name": /*#__PURE__*/S.optionalWith(S.String, {
499
+ nullable: true
500
+ }),
501
+ "entity": /*#__PURE__*/S.optionalWith(S.String, {
502
+ nullable: true
503
+ }),
504
+ "tags": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String))
505
+ })
506
+ }) {}
507
+ export class FineTuningJob extends /*#__PURE__*/S.Struct({
508
+ "id": S.String,
509
+ "created_at": S.Int,
510
+ "error": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Struct({
511
+ "code": S.String,
512
+ "message": S.String,
513
+ "param": /*#__PURE__*/S.NullOr(S.String)
514
+ })),
515
+ "fine_tuned_model": /*#__PURE__*/S.NullOr(S.String),
516
+ "finished_at": /*#__PURE__*/S.NullOr(S.Int),
517
+ "hyperparameters": /*#__PURE__*/S.Struct({
518
+ "n_epochs": /*#__PURE__*/S.Union(S.Literal("auto"), S.Int.pipe(S.greaterThanOrEqualTo(1), S.lessThanOrEqualTo(50))).pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => "auto"))
519
+ }),
520
+ "model": S.String,
521
+ "object": /*#__PURE__*/S.Literal("fine_tuning.job"),
522
+ "organization_id": S.String,
523
+ "result_files": /*#__PURE__*/S.Array(S.String),
524
+ "status": /*#__PURE__*/S.Literal("validating_files", "queued", "running", "succeeded", "failed", "cancelled"),
525
+ "trained_tokens": /*#__PURE__*/S.NullOr(S.Int),
526
+ "training_file": S.String,
527
+ "validation_file": /*#__PURE__*/S.NullOr(S.String),
528
+ "integrations": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(FineTuningIntegration).pipe( /*#__PURE__*/S.maxItems(5)), {
529
+ nullable: true
530
+ }),
531
+ "seed": S.Int,
532
+ "estimated_finish": /*#__PURE__*/S.optionalWith(S.Int, {
533
+ nullable: true
534
+ })
535
+ }) {}
536
+ export class ListPaginatedFineTuningJobsResponse extends /*#__PURE__*/S.Class("ListPaginatedFineTuningJobsResponse")({
537
+ "data": /*#__PURE__*/S.Array(FineTuningJob),
538
+ "has_more": S.Boolean,
539
+ "object": /*#__PURE__*/S.Literal("list")
540
+ }) {}
541
+ export class CreateFineTuningJobRequest extends /*#__PURE__*/S.Class("CreateFineTuningJobRequest")({
542
+ "model": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Literal("babbage-002", "davinci-002", "gpt-3.5-turbo", "gpt-4o-mini")),
543
+ "training_file": S.String,
544
+ "hyperparameters": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
545
+ "batch_size": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union( /*#__PURE__*/S.Literal("auto"), /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(256))), {
546
+ default: () => "auto"
547
+ }),
548
+ "learning_rate_multiplier": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union( /*#__PURE__*/S.Literal("auto"), /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThan(0))), {
549
+ default: () => "auto"
550
+ }),
551
+ "n_epochs": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union( /*#__PURE__*/S.Literal("auto"), /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(50))), {
552
+ default: () => "auto"
553
+ })
554
+ })),
555
+ "suffix": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.minLength(1), /*#__PURE__*/S.maxLength(64)), {
556
+ nullable: true
557
+ }),
558
+ "validation_file": /*#__PURE__*/S.optionalWith(S.String, {
559
+ nullable: true
560
+ }),
561
+ "integrations": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array( /*#__PURE__*/S.Struct({
562
+ "type": /*#__PURE__*/S.Literal("wandb"),
563
+ "wandb": /*#__PURE__*/S.Struct({
564
+ "project": S.String,
565
+ "name": /*#__PURE__*/S.optionalWith(S.String, {
566
+ nullable: true
567
+ }),
568
+ "entity": /*#__PURE__*/S.optionalWith(S.String, {
569
+ nullable: true
570
+ }),
571
+ "tags": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String))
572
+ })
573
+ })), {
574
+ nullable: true
575
+ }),
576
+ "seed": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(2147483647)), {
577
+ nullable: true
578
+ })
579
+ }) {}
580
+ export class ListFineTuningEventsParams extends /*#__PURE__*/S.Struct({
581
+ "after": /*#__PURE__*/S.optional(S.String),
582
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
583
+ default: () => 20
584
+ })
585
+ }) {}
586
+ export class FineTuningJobEvent extends /*#__PURE__*/S.Struct({
587
+ "id": S.String,
588
+ "created_at": S.Int,
589
+ "level": /*#__PURE__*/S.Literal("info", "warn", "error"),
590
+ "message": S.String,
591
+ "object": /*#__PURE__*/S.Literal("fine_tuning.job.event")
592
+ }) {}
593
+ export class ListFineTuningJobEventsResponse extends /*#__PURE__*/S.Class("ListFineTuningJobEventsResponse")({
594
+ "data": /*#__PURE__*/S.Array(FineTuningJobEvent),
595
+ "object": /*#__PURE__*/S.Literal("list")
596
+ }) {}
597
+ export class ListFineTuningJobCheckpointsParams extends /*#__PURE__*/S.Struct({
598
+ "after": /*#__PURE__*/S.optional(S.String),
599
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
600
+ default: () => 10
601
+ })
602
+ }) {}
603
+ export class FineTuningJobCheckpoint extends /*#__PURE__*/S.Struct({
604
+ "id": S.String,
605
+ "created_at": S.Int,
606
+ "fine_tuned_model_checkpoint": S.String,
607
+ "step_number": S.Int,
608
+ "metrics": /*#__PURE__*/S.Struct({
609
+ "step": /*#__PURE__*/S.optional(S.Number),
610
+ "train_loss": /*#__PURE__*/S.optional(S.Number),
611
+ "train_mean_token_accuracy": /*#__PURE__*/S.optional(S.Number),
612
+ "valid_loss": /*#__PURE__*/S.optional(S.Number),
613
+ "valid_mean_token_accuracy": /*#__PURE__*/S.optional(S.Number),
614
+ "full_valid_loss": /*#__PURE__*/S.optional(S.Number),
615
+ "full_valid_mean_token_accuracy": /*#__PURE__*/S.optional(S.Number)
616
+ }),
617
+ "fine_tuning_job_id": S.String,
618
+ "object": /*#__PURE__*/S.Literal("fine_tuning.job.checkpoint")
619
+ }) {}
620
+ export class ListFineTuningJobCheckpointsResponse extends /*#__PURE__*/S.Class("ListFineTuningJobCheckpointsResponse")({
621
+ "data": /*#__PURE__*/S.Array(FineTuningJobCheckpoint),
622
+ "object": /*#__PURE__*/S.Literal("list"),
623
+ "first_id": /*#__PURE__*/S.optionalWith(S.String, {
624
+ nullable: true
625
+ }),
626
+ "last_id": /*#__PURE__*/S.optionalWith(S.String, {
627
+ nullable: true
628
+ }),
629
+ "has_more": S.Boolean
630
+ }) {}
631
+ export class Model extends /*#__PURE__*/S.Struct({
632
+ "id": S.String,
633
+ "created": S.Int,
634
+ "object": /*#__PURE__*/S.Literal("model"),
635
+ "owned_by": S.String
636
+ }) {}
637
+ export class ListModelsResponse extends /*#__PURE__*/S.Class("ListModelsResponse")({
638
+ "object": /*#__PURE__*/S.Literal("list"),
639
+ "data": /*#__PURE__*/S.Array(Model)
640
+ }) {}
641
+ export class DeleteModelResponse extends /*#__PURE__*/S.Class("DeleteModelResponse")({
642
+ "id": S.String,
643
+ "deleted": S.Boolean,
644
+ "object": S.String
645
+ }) {}
646
+ export class CreateModerationRequest extends /*#__PURE__*/S.Class("CreateModerationRequest")({
647
+ "input": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Array(S.String), /*#__PURE__*/S.Array( /*#__PURE__*/S.Union( /*#__PURE__*/S.Struct({
648
+ "type": /*#__PURE__*/S.Literal("image_url"),
649
+ "image_url": /*#__PURE__*/S.Struct({
650
+ "url": S.String
651
+ })
652
+ }), /*#__PURE__*/S.Struct({
653
+ "type": /*#__PURE__*/S.Literal("text"),
654
+ "text": S.String
655
+ })))),
656
+ "model": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Literal("omni-moderation-latest", "omni-moderation-2024-09-26", "text-moderation-latest", "text-moderation-stable")), {
657
+ default: () => "omni-moderation-latest"
658
+ })
659
+ }) {}
660
+ export class CreateModerationResponse extends /*#__PURE__*/S.Class("CreateModerationResponse")({
661
+ "id": S.String,
662
+ "model": S.String,
663
+ "results": /*#__PURE__*/S.Array( /*#__PURE__*/S.Struct({
664
+ "flagged": S.Boolean,
665
+ "categories": /*#__PURE__*/S.Struct({
666
+ "hate": S.Boolean,
667
+ "hate/threatening": S.Boolean,
668
+ "harassment": S.Boolean,
669
+ "harassment/threatening": S.Boolean,
670
+ "illicit": S.Boolean,
671
+ "illicit/violent": S.Boolean,
672
+ "self-harm": S.Boolean,
673
+ "self-harm/intent": S.Boolean,
674
+ "self-harm/instructions": S.Boolean,
675
+ "sexual": S.Boolean,
676
+ "sexual/minors": S.Boolean,
677
+ "violence": S.Boolean,
678
+ "violence/graphic": S.Boolean
679
+ }),
680
+ "category_scores": /*#__PURE__*/S.Struct({
681
+ "hate": S.Number,
682
+ "hate/threatening": S.Number,
683
+ "harassment": S.Number,
684
+ "harassment/threatening": S.Number,
685
+ "illicit": S.Number,
686
+ "illicit/violent": S.Number,
687
+ "self-harm": S.Number,
688
+ "self-harm/intent": S.Number,
689
+ "self-harm/instructions": S.Number,
690
+ "sexual": S.Number,
691
+ "sexual/minors": S.Number,
692
+ "violence": S.Number,
693
+ "violence/graphic": S.Number
694
+ }),
695
+ "category_applied_input_types": /*#__PURE__*/S.Struct({
696
+ "hate": /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("text")),
697
+ "hate/threatening": /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("text")),
698
+ "harassment": /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("text")),
699
+ "harassment/threatening": /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("text")),
700
+ "illicit": /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("text")),
701
+ "illicit/violent": /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("text")),
702
+ "self-harm": /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("text", "image")),
703
+ "self-harm/intent": /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("text", "image")),
704
+ "self-harm/instructions": /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("text", "image")),
705
+ "sexual": /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("text", "image")),
706
+ "sexual/minors": /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("text")),
707
+ "violence": /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("text", "image")),
708
+ "violence/graphic": /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("text", "image"))
709
+ })
710
+ }))
711
+ }) {}
712
+ export class ListAssistantsParams extends /*#__PURE__*/S.Struct({
713
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
714
+ default: () => 20
715
+ }),
716
+ "order": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("asc", "desc"), {
717
+ default: () => "desc"
718
+ }),
719
+ "after": /*#__PURE__*/S.optional(S.String),
720
+ "before": /*#__PURE__*/S.optional(S.String)
721
+ }) {}
722
+ export class AssistantToolsCode extends /*#__PURE__*/S.Struct({
723
+ "type": /*#__PURE__*/S.Literal("code_interpreter")
724
+ }) {}
725
+ export class FileSearchRankingOptions extends /*#__PURE__*/S.Struct({
726
+ "ranker": /*#__PURE__*/S.optional( /*#__PURE__*/S.Literal("auto", "default_2024_08_21")),
727
+ "score_threshold": /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1))
728
+ }) {}
729
+ export class AssistantToolsFileSearch extends /*#__PURE__*/S.Struct({
730
+ "type": /*#__PURE__*/S.Literal("file_search"),
731
+ "file_search": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
732
+ "max_num_results": /*#__PURE__*/S.optional( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(50))),
733
+ "ranking_options": /*#__PURE__*/S.optional(FileSearchRankingOptions)
734
+ }))
735
+ }) {}
736
+ export class AssistantToolsFunction extends /*#__PURE__*/S.Struct({
737
+ "type": /*#__PURE__*/S.Literal("function"),
738
+ "function": FunctionObject
739
+ }) {}
740
+ export class AssistantsApiResponseFormatOption extends /*#__PURE__*/S.Union( /*#__PURE__*/S.Literal("auto"), ResponseFormatText, ResponseFormatJsonObject, ResponseFormatJsonSchema) {}
741
+ export class AssistantObject extends /*#__PURE__*/S.Struct({
742
+ "id": S.String,
743
+ "object": /*#__PURE__*/S.Literal("assistant"),
744
+ "created_at": S.Int,
745
+ "name": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.maxLength(256))),
746
+ "description": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.maxLength(512))),
747
+ "model": S.String,
748
+ "instructions": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.maxLength(256000))),
749
+ "tools": /*#__PURE__*/S.Array(S.Union(AssistantToolsCode, AssistantToolsFileSearch, AssistantToolsFunction)).pipe(S.maxItems(128)).pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => [])),
750
+ "tool_resources": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Struct({
751
+ "code_interpreter": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
752
+ "file_ids": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.maxItems(20)), {
753
+ default: () => []
754
+ })
755
+ })),
756
+ "file_search": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
757
+ "vector_store_ids": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.maxItems(1)))
758
+ }))
759
+ }), {
760
+ nullable: true
761
+ }),
762
+ "metadata": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Record({
763
+ key: S.String,
764
+ value: S.Unknown
765
+ })),
766
+ "temperature": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(2)), {
767
+ nullable: true,
768
+ default: () => 1
769
+ }),
770
+ "top_p": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
771
+ nullable: true,
772
+ default: () => 1
773
+ }),
774
+ "response_format": /*#__PURE__*/S.optional(AssistantsApiResponseFormatOption)
775
+ }) {}
776
+ export class ListAssistantsResponse extends /*#__PURE__*/S.Class("ListAssistantsResponse")({
777
+ "object": S.String,
778
+ "data": /*#__PURE__*/S.Array(AssistantObject),
779
+ "first_id": S.String,
780
+ "last_id": S.String,
781
+ "has_more": S.Boolean
782
+ }) {}
783
+ export class CreateAssistantRequest extends /*#__PURE__*/S.Class("CreateAssistantRequest")({
784
+ "model": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Literal("gpt-4o", "gpt-4o-2024-08-06", "gpt-4o-2024-05-13", "gpt-4o-2024-08-06", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", "gpt-4-turbo-preview", "gpt-4-1106-preview", "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", "gpt-4-32k", "gpt-4-32k-0314", "gpt-4-32k-0613", "gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-1106", "gpt-3.5-turbo-0125", "gpt-3.5-turbo-16k-0613")),
785
+ "name": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.maxLength(256)), {
786
+ nullable: true
787
+ }),
788
+ "description": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.maxLength(512)), {
789
+ nullable: true
790
+ }),
791
+ "instructions": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.maxLength(256000)), {
792
+ nullable: true
793
+ }),
794
+ "tools": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(S.Union(AssistantToolsCode, AssistantToolsFileSearch, AssistantToolsFunction)).pipe( /*#__PURE__*/S.maxItems(128)), {
795
+ default: () => []
796
+ }),
797
+ "tool_resources": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Struct({
798
+ "code_interpreter": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
799
+ "file_ids": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.maxItems(20)), {
800
+ default: () => []
801
+ })
802
+ })),
803
+ "file_search": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
804
+ "vector_store_ids": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.maxItems(1))),
805
+ "vector_stores": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.Struct({
806
+ "file_ids": S.optional(S.Array(S.String).pipe(S.maxItems(10000))),
807
+ "chunking_strategy": S.optional(S.Record({
808
+ key: S.String,
809
+ value: S.Unknown
810
+ })),
811
+ "metadata": S.optional(S.Record({
812
+ key: S.String,
813
+ value: S.Unknown
814
+ }))
815
+ })).pipe( /*#__PURE__*/S.maxItems(1)))
816
+ }))
817
+ }), {
818
+ nullable: true
819
+ }),
820
+ "metadata": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Record({
821
+ key: S.String,
822
+ value: S.Unknown
823
+ }), {
824
+ nullable: true
825
+ }),
826
+ "temperature": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(2)), {
827
+ nullable: true,
828
+ default: () => 1
829
+ }),
830
+ "top_p": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
831
+ nullable: true,
832
+ default: () => 1
833
+ }),
834
+ "response_format": /*#__PURE__*/S.optional(AssistantsApiResponseFormatOption)
835
+ }) {}
836
+ export class ModifyAssistantRequest extends /*#__PURE__*/S.Class("ModifyAssistantRequest")({
837
+ "model": /*#__PURE__*/S.optional(S.String),
838
+ "name": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.maxLength(256)), {
839
+ nullable: true
840
+ }),
841
+ "description": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.maxLength(512)), {
842
+ nullable: true
843
+ }),
844
+ "instructions": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.String.pipe( /*#__PURE__*/S.maxLength(256000)), {
845
+ nullable: true
846
+ }),
847
+ "tools": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(S.Union(AssistantToolsCode, AssistantToolsFileSearch, AssistantToolsFunction)).pipe( /*#__PURE__*/S.maxItems(128)), {
848
+ default: () => []
849
+ }),
850
+ "tool_resources": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Struct({
851
+ "code_interpreter": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
852
+ "file_ids": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.maxItems(20)), {
853
+ default: () => []
854
+ })
855
+ })),
856
+ "file_search": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
857
+ "vector_store_ids": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.maxItems(1)))
858
+ }))
859
+ }), {
860
+ nullable: true
861
+ }),
862
+ "metadata": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Record({
863
+ key: S.String,
864
+ value: S.Unknown
865
+ }), {
866
+ nullable: true
867
+ }),
868
+ "temperature": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(2)), {
869
+ nullable: true,
870
+ default: () => 1
871
+ }),
872
+ "top_p": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
873
+ nullable: true,
874
+ default: () => 1
875
+ }),
876
+ "response_format": /*#__PURE__*/S.optional(AssistantsApiResponseFormatOption)
877
+ }) {}
878
+ export class DeleteAssistantResponse extends /*#__PURE__*/S.Class("DeleteAssistantResponse")({
879
+ "id": S.String,
880
+ "deleted": S.Boolean,
881
+ "object": /*#__PURE__*/S.Literal("assistant.deleted")
882
+ }) {}
883
+ export class MessageContentImageFileObject extends /*#__PURE__*/S.Struct({
884
+ "type": /*#__PURE__*/S.Literal("image_file"),
885
+ "image_file": /*#__PURE__*/S.Struct({
886
+ "file_id": S.String,
887
+ "detail": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("auto", "low", "high"), {
888
+ default: () => "auto"
889
+ })
890
+ })
891
+ }) {}
892
+ export class MessageContentImageUrlObject extends /*#__PURE__*/S.Struct({
893
+ "type": /*#__PURE__*/S.Literal("image_url"),
894
+ "image_url": /*#__PURE__*/S.Struct({
895
+ "url": S.String,
896
+ "detail": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("auto", "low", "high"), {
897
+ default: () => "auto"
898
+ })
899
+ })
900
+ }) {}
901
+ export class MessageRequestContentTextObject extends /*#__PURE__*/S.Struct({
902
+ "type": /*#__PURE__*/S.Literal("text"),
903
+ "text": S.String
904
+ }) {}
905
+ export class AssistantToolsFileSearchTypeOnly extends /*#__PURE__*/S.Struct({
906
+ "type": /*#__PURE__*/S.Literal("file_search")
907
+ }) {}
908
+ export class CreateMessageRequest extends /*#__PURE__*/S.Struct({
909
+ "role": /*#__PURE__*/S.Literal("user", "assistant"),
910
+ "content": /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.NonEmptyArray( /*#__PURE__*/S.Union(MessageContentImageFileObject, MessageContentImageUrlObject, MessageRequestContentTextObject))),
911
+ "attachments": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array( /*#__PURE__*/S.Struct({
912
+ "file_id": /*#__PURE__*/S.optional(S.String),
913
+ "tools": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(AssistantToolsCode, AssistantToolsFileSearchTypeOnly)))
914
+ })), {
915
+ nullable: true
916
+ }),
917
+ "metadata": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Record({
918
+ key: S.String,
919
+ value: S.Unknown
920
+ }), {
921
+ nullable: true
922
+ })
923
+ }) {}
924
+ export class CreateThreadRequest extends /*#__PURE__*/S.Class("CreateThreadRequest")({
925
+ "messages": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(CreateMessageRequest)),
926
+ "tool_resources": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Struct({
927
+ "code_interpreter": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
928
+ "file_ids": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.maxItems(20)), {
929
+ default: () => []
930
+ })
931
+ })),
932
+ "file_search": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
933
+ "vector_store_ids": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.maxItems(1))),
934
+ "vector_stores": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.Struct({
935
+ "file_ids": S.optional(S.Array(S.String).pipe(S.maxItems(10000))),
936
+ "chunking_strategy": S.optional(S.Record({
937
+ key: S.String,
938
+ value: S.Unknown
939
+ })),
940
+ "metadata": S.optional(S.Record({
941
+ key: S.String,
942
+ value: S.Unknown
943
+ }))
944
+ })).pipe( /*#__PURE__*/S.maxItems(1)))
945
+ }))
946
+ }), {
947
+ nullable: true
948
+ }),
949
+ "metadata": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Record({
950
+ key: S.String,
951
+ value: S.Unknown
952
+ }), {
953
+ nullable: true
954
+ })
955
+ }) {}
956
+ export class ThreadObject extends /*#__PURE__*/S.Class("ThreadObject")({
957
+ "id": S.String,
958
+ "object": /*#__PURE__*/S.Literal("thread"),
959
+ "created_at": S.Int,
960
+ "tool_resources": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Struct({
961
+ "code_interpreter": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
962
+ "file_ids": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.maxItems(20)), {
963
+ default: () => []
964
+ })
965
+ })),
966
+ "file_search": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
967
+ "vector_store_ids": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.maxItems(1)))
968
+ }))
969
+ })),
970
+ "metadata": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Record({
971
+ key: S.String,
972
+ value: S.Unknown
973
+ }))
974
+ }) {}
975
+ export class ModifyThreadRequest extends /*#__PURE__*/S.Class("ModifyThreadRequest")({
976
+ "tool_resources": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Struct({
977
+ "code_interpreter": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
978
+ "file_ids": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.maxItems(20)), {
979
+ default: () => []
980
+ })
981
+ })),
982
+ "file_search": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
983
+ "vector_store_ids": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.maxItems(1)))
984
+ }))
985
+ }), {
986
+ nullable: true
987
+ }),
988
+ "metadata": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Record({
989
+ key: S.String,
990
+ value: S.Unknown
991
+ }), {
992
+ nullable: true
993
+ })
994
+ }) {}
995
+ export class DeleteThreadResponse extends /*#__PURE__*/S.Class("DeleteThreadResponse")({
996
+ "id": S.String,
997
+ "deleted": S.Boolean,
998
+ "object": /*#__PURE__*/S.Literal("thread.deleted")
999
+ }) {}
1000
+ export class ListMessagesParams extends /*#__PURE__*/S.Struct({
1001
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
1002
+ default: () => 20
1003
+ }),
1004
+ "order": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("asc", "desc"), {
1005
+ default: () => "desc"
1006
+ }),
1007
+ "after": /*#__PURE__*/S.optional(S.String),
1008
+ "before": /*#__PURE__*/S.optional(S.String),
1009
+ "run_id": /*#__PURE__*/S.optional(S.String)
1010
+ }) {}
1011
+ export class MessageContentTextAnnotationsFileCitationObject extends /*#__PURE__*/S.Struct({
1012
+ "type": /*#__PURE__*/S.Literal("file_citation"),
1013
+ "text": S.String,
1014
+ "file_citation": /*#__PURE__*/S.Struct({
1015
+ "file_id": S.String
1016
+ }),
1017
+ "start_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
1018
+ "end_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0))
1019
+ }) {}
1020
+ export class MessageContentTextAnnotationsFilePathObject extends /*#__PURE__*/S.Struct({
1021
+ "type": /*#__PURE__*/S.Literal("file_path"),
1022
+ "text": S.String,
1023
+ "file_path": /*#__PURE__*/S.Struct({
1024
+ "file_id": S.String
1025
+ }),
1026
+ "start_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0)),
1027
+ "end_index": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0))
1028
+ }) {}
1029
+ export class MessageContentTextObject extends /*#__PURE__*/S.Struct({
1030
+ "type": /*#__PURE__*/S.Literal("text"),
1031
+ "text": /*#__PURE__*/S.Struct({
1032
+ "value": S.String,
1033
+ "annotations": /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(MessageContentTextAnnotationsFileCitationObject, MessageContentTextAnnotationsFilePathObject))
1034
+ })
1035
+ }) {}
1036
+ export class MessageContentRefusalObject extends /*#__PURE__*/S.Struct({
1037
+ "type": /*#__PURE__*/S.Literal("refusal"),
1038
+ "refusal": S.String
1039
+ }) {}
1040
+ export class MessageObject extends /*#__PURE__*/S.Struct({
1041
+ "id": S.String,
1042
+ "object": /*#__PURE__*/S.Literal("thread.message"),
1043
+ "created_at": S.Int,
1044
+ "thread_id": S.String,
1045
+ "status": /*#__PURE__*/S.Literal("in_progress", "incomplete", "completed"),
1046
+ "incomplete_details": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Struct({
1047
+ "reason": /*#__PURE__*/S.Literal("content_filter", "max_tokens", "run_cancelled", "run_expired", "run_failed")
1048
+ })),
1049
+ "completed_at": /*#__PURE__*/S.NullOr(S.Int),
1050
+ "incomplete_at": /*#__PURE__*/S.NullOr(S.Int),
1051
+ "role": /*#__PURE__*/S.Literal("user", "assistant"),
1052
+ "content": /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(MessageContentImageFileObject, MessageContentImageUrlObject, MessageContentTextObject, MessageContentRefusalObject)),
1053
+ "assistant_id": /*#__PURE__*/S.NullOr(S.String),
1054
+ "run_id": /*#__PURE__*/S.NullOr(S.String),
1055
+ "attachments": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Array( /*#__PURE__*/S.Struct({
1056
+ "file_id": /*#__PURE__*/S.optional(S.String),
1057
+ "tools": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(AssistantToolsCode, AssistantToolsFileSearchTypeOnly)))
1058
+ }))),
1059
+ "metadata": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Record({
1060
+ key: S.String,
1061
+ value: S.Unknown
1062
+ }))
1063
+ }) {}
1064
+ export class ListMessagesResponse extends /*#__PURE__*/S.Class("ListMessagesResponse")({
1065
+ "object": S.String,
1066
+ "data": /*#__PURE__*/S.Array(MessageObject),
1067
+ "first_id": S.String,
1068
+ "last_id": S.String,
1069
+ "has_more": S.Boolean
1070
+ }) {}
1071
+ export class ModifyMessageRequest extends /*#__PURE__*/S.Class("ModifyMessageRequest")({
1072
+ "metadata": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Record({
1073
+ key: S.String,
1074
+ value: S.Unknown
1075
+ }), {
1076
+ nullable: true
1077
+ })
1078
+ }) {}
1079
+ export class DeleteMessageResponse extends /*#__PURE__*/S.Class("DeleteMessageResponse")({
1080
+ "id": S.String,
1081
+ "deleted": S.Boolean,
1082
+ "object": /*#__PURE__*/S.Literal("thread.message.deleted")
1083
+ }) {}
1084
+ export class TruncationObject extends /*#__PURE__*/S.Struct({
1085
+ "type": /*#__PURE__*/S.Literal("auto", "last_messages"),
1086
+ "last_messages": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1)), {
1087
+ nullable: true
1088
+ })
1089
+ }) {}
1090
+ export class AssistantsNamedToolChoice extends /*#__PURE__*/S.Struct({
1091
+ "type": /*#__PURE__*/S.Literal("function", "code_interpreter", "file_search"),
1092
+ "function": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1093
+ "name": S.String
1094
+ }))
1095
+ }) {}
1096
+ export class AssistantsApiToolChoiceOption extends /*#__PURE__*/S.Union( /*#__PURE__*/S.Literal("none", "auto", "required"), AssistantsNamedToolChoice) {}
1097
+ export class CreateThreadAndRunRequest extends /*#__PURE__*/S.Class("CreateThreadAndRunRequest")({
1098
+ "assistant_id": S.String,
1099
+ "thread": /*#__PURE__*/S.optional(CreateThreadRequest),
1100
+ "model": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Literal("gpt-4o", "gpt-4o-2024-08-06", "gpt-4o-2024-05-13", "gpt-4o-2024-08-06", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", "gpt-4-turbo-preview", "gpt-4-1106-preview", "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", "gpt-4-32k", "gpt-4-32k-0314", "gpt-4-32k-0613", "gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-1106", "gpt-3.5-turbo-0125", "gpt-3.5-turbo-16k-0613")), {
1101
+ nullable: true
1102
+ }),
1103
+ "instructions": /*#__PURE__*/S.optionalWith(S.String, {
1104
+ nullable: true
1105
+ }),
1106
+ "tools": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(S.Union(AssistantToolsCode, AssistantToolsFileSearch, AssistantToolsFunction)).pipe( /*#__PURE__*/S.maxItems(20)), {
1107
+ nullable: true
1108
+ }),
1109
+ "tool_resources": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Struct({
1110
+ "code_interpreter": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1111
+ "file_ids": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.maxItems(20)), {
1112
+ default: () => []
1113
+ })
1114
+ })),
1115
+ "file_search": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1116
+ "vector_store_ids": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.maxItems(1)))
1117
+ }))
1118
+ }), {
1119
+ nullable: true
1120
+ }),
1121
+ "metadata": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Record({
1122
+ key: S.String,
1123
+ value: S.Unknown
1124
+ }), {
1125
+ nullable: true
1126
+ }),
1127
+ "temperature": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(2)), {
1128
+ nullable: true,
1129
+ default: () => 1
1130
+ }),
1131
+ "top_p": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
1132
+ nullable: true,
1133
+ default: () => 1
1134
+ }),
1135
+ "stream": /*#__PURE__*/S.optionalWith(S.Boolean, {
1136
+ nullable: true
1137
+ }),
1138
+ "max_prompt_tokens": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(256)), {
1139
+ nullable: true
1140
+ }),
1141
+ "max_completion_tokens": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(256)), {
1142
+ nullable: true
1143
+ }),
1144
+ "truncation_strategy": /*#__PURE__*/S.optional(TruncationObject),
1145
+ "tool_choice": /*#__PURE__*/S.optional(AssistantsApiToolChoiceOption),
1146
+ "parallel_tool_calls": /*#__PURE__*/S.optionalWith(ParallelToolCalls, {
1147
+ default: () => true
1148
+ }),
1149
+ "response_format": /*#__PURE__*/S.optional(AssistantsApiResponseFormatOption)
1150
+ }) {}
1151
+ export class RunToolCallObject extends /*#__PURE__*/S.Struct({
1152
+ "id": S.String,
1153
+ "type": /*#__PURE__*/S.Literal("function"),
1154
+ "function": /*#__PURE__*/S.Struct({
1155
+ "name": S.String,
1156
+ "arguments": S.String
1157
+ })
1158
+ }) {}
1159
+ export class RunCompletionUsage extends /*#__PURE__*/S.Struct({
1160
+ "completion_tokens": S.Int,
1161
+ "prompt_tokens": S.Int,
1162
+ "total_tokens": S.Int
1163
+ }) {}
1164
+ export class RunObject extends /*#__PURE__*/S.Class("RunObject")({
1165
+ "id": S.String,
1166
+ "object": /*#__PURE__*/S.Literal("thread.run"),
1167
+ "created_at": S.Int,
1168
+ "thread_id": S.String,
1169
+ "assistant_id": S.String,
1170
+ "status": /*#__PURE__*/S.Literal("queued", "in_progress", "requires_action", "cancelling", "cancelled", "failed", "completed", "incomplete", "expired"),
1171
+ "required_action": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Struct({
1172
+ "type": /*#__PURE__*/S.Literal("submit_tool_outputs"),
1173
+ "submit_tool_outputs": /*#__PURE__*/S.Struct({
1174
+ "tool_calls": /*#__PURE__*/S.Array(RunToolCallObject)
1175
+ })
1176
+ })),
1177
+ "last_error": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Struct({
1178
+ "code": /*#__PURE__*/S.Literal("server_error", "rate_limit_exceeded", "invalid_prompt"),
1179
+ "message": S.String
1180
+ })),
1181
+ "expires_at": /*#__PURE__*/S.NullOr(S.Int),
1182
+ "started_at": /*#__PURE__*/S.NullOr(S.Int),
1183
+ "cancelled_at": /*#__PURE__*/S.NullOr(S.Int),
1184
+ "failed_at": /*#__PURE__*/S.NullOr(S.Int),
1185
+ "completed_at": /*#__PURE__*/S.NullOr(S.Int),
1186
+ "incomplete_details": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Struct({
1187
+ "reason": /*#__PURE__*/S.optional( /*#__PURE__*/S.Literal("max_completion_tokens", "max_prompt_tokens"))
1188
+ })),
1189
+ "model": S.String,
1190
+ "instructions": S.String,
1191
+ "tools": /*#__PURE__*/S.Array(S.Union(AssistantToolsCode, AssistantToolsFileSearch, AssistantToolsFunction)).pipe(S.maxItems(20)).pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => [])),
1192
+ "metadata": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Record({
1193
+ key: S.String,
1194
+ value: S.Unknown
1195
+ })),
1196
+ "usage": /*#__PURE__*/S.NullOr(RunCompletionUsage),
1197
+ "temperature": /*#__PURE__*/S.optionalWith(S.Number, {
1198
+ nullable: true
1199
+ }),
1200
+ "top_p": /*#__PURE__*/S.optionalWith(S.Number, {
1201
+ nullable: true
1202
+ }),
1203
+ "max_prompt_tokens": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(256))),
1204
+ "max_completion_tokens": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(256))),
1205
+ "truncation_strategy": TruncationObject,
1206
+ "tool_choice": AssistantsApiToolChoiceOption,
1207
+ "parallel_tool_calls": /*#__PURE__*/ParallelToolCalls.pipe(S.propertySignature, /*#__PURE__*/S.withConstructorDefault(() => true)),
1208
+ "response_format": AssistantsApiResponseFormatOption
1209
+ }) {}
1210
+ export class ListRunsParams extends /*#__PURE__*/S.Struct({
1211
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
1212
+ default: () => 20
1213
+ }),
1214
+ "order": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("asc", "desc"), {
1215
+ default: () => "desc"
1216
+ }),
1217
+ "after": /*#__PURE__*/S.optional(S.String),
1218
+ "before": /*#__PURE__*/S.optional(S.String)
1219
+ }) {}
1220
+ export class ListRunsResponse extends /*#__PURE__*/S.Class("ListRunsResponse")({
1221
+ "object": S.String,
1222
+ "data": /*#__PURE__*/S.Array(RunObject),
1223
+ "first_id": S.String,
1224
+ "last_id": S.String,
1225
+ "has_more": S.Boolean
1226
+ }) {}
1227
+ export class CreateRunParams extends /*#__PURE__*/S.Struct({
1228
+ "include[]": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("step_details.tool_calls[*].file_search.results[*].content")))
1229
+ }) {}
1230
+ export class CreateRunRequest extends /*#__PURE__*/S.Class("CreateRunRequest")({
1231
+ "assistant_id": S.String,
1232
+ "model": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Union(S.String, /*#__PURE__*/S.Literal("gpt-4o", "gpt-4o-2024-08-06", "gpt-4o-2024-05-13", "gpt-4o-2024-08-06", "gpt-4o-mini", "gpt-4o-mini-2024-07-18", "gpt-4-turbo", "gpt-4-turbo-2024-04-09", "gpt-4-0125-preview", "gpt-4-turbo-preview", "gpt-4-1106-preview", "gpt-4-vision-preview", "gpt-4", "gpt-4-0314", "gpt-4-0613", "gpt-4-32k", "gpt-4-32k-0314", "gpt-4-32k-0613", "gpt-3.5-turbo", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-1106", "gpt-3.5-turbo-0125", "gpt-3.5-turbo-16k-0613")), {
1233
+ nullable: true
1234
+ }),
1235
+ "instructions": /*#__PURE__*/S.optionalWith(S.String, {
1236
+ nullable: true
1237
+ }),
1238
+ "additional_instructions": /*#__PURE__*/S.optionalWith(S.String, {
1239
+ nullable: true
1240
+ }),
1241
+ "additional_messages": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(CreateMessageRequest), {
1242
+ nullable: true
1243
+ }),
1244
+ "tools": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Array(S.Union(AssistantToolsCode, AssistantToolsFileSearch, AssistantToolsFunction)).pipe( /*#__PURE__*/S.maxItems(20)), {
1245
+ nullable: true
1246
+ }),
1247
+ "metadata": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Record({
1248
+ key: S.String,
1249
+ value: S.Unknown
1250
+ }), {
1251
+ nullable: true
1252
+ }),
1253
+ "temperature": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(2)), {
1254
+ nullable: true,
1255
+ default: () => 1
1256
+ }),
1257
+ "top_p": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)), {
1258
+ nullable: true,
1259
+ default: () => 1
1260
+ }),
1261
+ "stream": /*#__PURE__*/S.optionalWith(S.Boolean, {
1262
+ nullable: true
1263
+ }),
1264
+ "max_prompt_tokens": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(256)), {
1265
+ nullable: true
1266
+ }),
1267
+ "max_completion_tokens": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(256)), {
1268
+ nullable: true
1269
+ }),
1270
+ "truncation_strategy": /*#__PURE__*/S.optional(TruncationObject),
1271
+ "tool_choice": /*#__PURE__*/S.optional(AssistantsApiToolChoiceOption),
1272
+ "parallel_tool_calls": /*#__PURE__*/S.optionalWith(ParallelToolCalls, {
1273
+ default: () => true
1274
+ }),
1275
+ "response_format": /*#__PURE__*/S.optional(AssistantsApiResponseFormatOption)
1276
+ }) {}
1277
+ export class ModifyRunRequest extends /*#__PURE__*/S.Class("ModifyRunRequest")({
1278
+ "metadata": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Record({
1279
+ key: S.String,
1280
+ value: S.Unknown
1281
+ }), {
1282
+ nullable: true
1283
+ })
1284
+ }) {}
1285
+ export class SubmitToolOutputsRunRequest extends /*#__PURE__*/S.Class("SubmitToolOutputsRunRequest")({
1286
+ "tool_outputs": /*#__PURE__*/S.Array( /*#__PURE__*/S.Struct({
1287
+ "tool_call_id": /*#__PURE__*/S.optional(S.String),
1288
+ "output": /*#__PURE__*/S.optional(S.String)
1289
+ })),
1290
+ "stream": /*#__PURE__*/S.optionalWith(S.Boolean, {
1291
+ nullable: true
1292
+ })
1293
+ }) {}
1294
+ export class ListRunStepsParams extends /*#__PURE__*/S.Struct({
1295
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
1296
+ default: () => 20
1297
+ }),
1298
+ "order": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("asc", "desc"), {
1299
+ default: () => "desc"
1300
+ }),
1301
+ "after": /*#__PURE__*/S.optional(S.String),
1302
+ "before": /*#__PURE__*/S.optional(S.String),
1303
+ "include[]": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("step_details.tool_calls[*].file_search.results[*].content")))
1304
+ }) {}
1305
+ export class RunStepDetailsMessageCreationObject extends /*#__PURE__*/S.Struct({
1306
+ "type": /*#__PURE__*/S.Literal("message_creation"),
1307
+ "message_creation": /*#__PURE__*/S.Struct({
1308
+ "message_id": S.String
1309
+ })
1310
+ }) {}
1311
+ export class RunStepDetailsToolCallsCodeOutputLogsObject extends /*#__PURE__*/S.Struct({
1312
+ "type": /*#__PURE__*/S.Literal("logs"),
1313
+ "logs": S.String
1314
+ }) {}
1315
+ export class RunStepDetailsToolCallsCodeOutputImageObject extends /*#__PURE__*/S.Struct({
1316
+ "type": /*#__PURE__*/S.Literal("image"),
1317
+ "image": /*#__PURE__*/S.Struct({
1318
+ "file_id": S.String
1319
+ })
1320
+ }) {}
1321
+ export class RunStepDetailsToolCallsCodeObject extends /*#__PURE__*/S.Struct({
1322
+ "id": S.String,
1323
+ "type": /*#__PURE__*/S.Literal("code_interpreter"),
1324
+ "code_interpreter": /*#__PURE__*/S.Struct({
1325
+ "input": S.String,
1326
+ "outputs": /*#__PURE__*/S.Array( /*#__PURE__*/S.Record({
1327
+ key: S.String,
1328
+ value: S.Unknown
1329
+ }))
1330
+ })
1331
+ }) {}
1332
+ export class RunStepDetailsToolCallsFileSearchRankingOptionsObject extends /*#__PURE__*/S.Struct({
1333
+ "ranker": /*#__PURE__*/S.Literal("default_2024_08_21"),
1334
+ "score_threshold": /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1))
1335
+ }) {}
1336
+ export class RunStepDetailsToolCallsFileSearchResultObject extends /*#__PURE__*/S.Struct({
1337
+ "file_id": S.String,
1338
+ "file_name": S.String,
1339
+ "score": /*#__PURE__*/S.Number.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(0), /*#__PURE__*/S.lessThanOrEqualTo(1)),
1340
+ "content": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array( /*#__PURE__*/S.Struct({
1341
+ "type": /*#__PURE__*/S.optional( /*#__PURE__*/S.Literal("text")),
1342
+ "text": /*#__PURE__*/S.optional(S.String)
1343
+ })))
1344
+ }) {}
1345
+ export class RunStepDetailsToolCallsFileSearchObject extends /*#__PURE__*/S.Struct({
1346
+ "id": S.String,
1347
+ "type": /*#__PURE__*/S.Literal("file_search"),
1348
+ "file_search": /*#__PURE__*/S.Struct({
1349
+ "ranking_options": /*#__PURE__*/S.optional(RunStepDetailsToolCallsFileSearchRankingOptionsObject),
1350
+ "results": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(RunStepDetailsToolCallsFileSearchResultObject))
1351
+ })
1352
+ }) {}
1353
+ export class RunStepDetailsToolCallsFunctionObject extends /*#__PURE__*/S.Struct({
1354
+ "id": S.String,
1355
+ "type": /*#__PURE__*/S.Literal("function"),
1356
+ "function": /*#__PURE__*/S.Struct({
1357
+ "name": S.String,
1358
+ "arguments": S.String,
1359
+ "output": /*#__PURE__*/S.NullOr(S.String)
1360
+ })
1361
+ }) {}
1362
+ export class RunStepDetailsToolCallsObject extends /*#__PURE__*/S.Struct({
1363
+ "type": /*#__PURE__*/S.Literal("tool_calls"),
1364
+ "tool_calls": /*#__PURE__*/S.Array( /*#__PURE__*/S.Union(RunStepDetailsToolCallsCodeObject, RunStepDetailsToolCallsFileSearchObject, RunStepDetailsToolCallsFunctionObject))
1365
+ }) {}
1366
+ export class RunStepCompletionUsage extends /*#__PURE__*/S.Struct({
1367
+ "completion_tokens": S.Int,
1368
+ "prompt_tokens": S.Int,
1369
+ "total_tokens": S.Int
1370
+ }) {}
1371
+ export class RunStepObject extends /*#__PURE__*/S.Struct({
1372
+ "id": S.String,
1373
+ "object": /*#__PURE__*/S.Literal("thread.run.step"),
1374
+ "created_at": S.Int,
1375
+ "assistant_id": S.String,
1376
+ "thread_id": S.String,
1377
+ "run_id": S.String,
1378
+ "type": /*#__PURE__*/S.Literal("message_creation", "tool_calls"),
1379
+ "status": /*#__PURE__*/S.Literal("in_progress", "cancelled", "failed", "completed", "expired"),
1380
+ "step_details": /*#__PURE__*/S.Record({
1381
+ key: S.String,
1382
+ value: S.Unknown
1383
+ }),
1384
+ "last_error": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Struct({
1385
+ "code": /*#__PURE__*/S.Literal("server_error", "rate_limit_exceeded"),
1386
+ "message": S.String
1387
+ })),
1388
+ "expired_at": /*#__PURE__*/S.NullOr(S.Int),
1389
+ "cancelled_at": /*#__PURE__*/S.NullOr(S.Int),
1390
+ "failed_at": /*#__PURE__*/S.NullOr(S.Int),
1391
+ "completed_at": /*#__PURE__*/S.NullOr(S.Int),
1392
+ "metadata": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Record({
1393
+ key: S.String,
1394
+ value: S.Unknown
1395
+ })),
1396
+ "usage": /*#__PURE__*/S.NullOr(RunStepCompletionUsage)
1397
+ }) {}
1398
+ export class ListRunStepsResponse extends /*#__PURE__*/S.Class("ListRunStepsResponse")({
1399
+ "object": S.String,
1400
+ "data": /*#__PURE__*/S.Array(RunStepObject),
1401
+ "first_id": S.String,
1402
+ "last_id": S.String,
1403
+ "has_more": S.Boolean
1404
+ }) {}
1405
+ export class GetRunStepParams extends /*#__PURE__*/S.Struct({
1406
+ "include[]": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array( /*#__PURE__*/S.Literal("step_details.tool_calls[*].file_search.results[*].content")))
1407
+ }) {}
1408
+ export class ListVectorStoresParams extends /*#__PURE__*/S.Struct({
1409
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
1410
+ default: () => 20
1411
+ }),
1412
+ "order": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("asc", "desc"), {
1413
+ default: () => "desc"
1414
+ }),
1415
+ "after": /*#__PURE__*/S.optional(S.String),
1416
+ "before": /*#__PURE__*/S.optional(S.String)
1417
+ }) {}
1418
+ export class VectorStoreExpirationAfter extends /*#__PURE__*/S.Struct({
1419
+ "anchor": /*#__PURE__*/S.Literal("last_active_at"),
1420
+ "days": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(1), /*#__PURE__*/S.lessThanOrEqualTo(365))
1421
+ }) {}
1422
+ export class VectorStoreObject extends /*#__PURE__*/S.Struct({
1423
+ "id": S.String,
1424
+ "object": /*#__PURE__*/S.Literal("vector_store"),
1425
+ "created_at": S.Int,
1426
+ "name": S.String,
1427
+ "usage_bytes": S.Int,
1428
+ "file_counts": /*#__PURE__*/S.Struct({
1429
+ "in_progress": S.Int,
1430
+ "completed": S.Int,
1431
+ "failed": S.Int,
1432
+ "cancelled": S.Int,
1433
+ "total": S.Int
1434
+ }),
1435
+ "status": /*#__PURE__*/S.Literal("expired", "in_progress", "completed"),
1436
+ "expires_after": /*#__PURE__*/S.optional(VectorStoreExpirationAfter),
1437
+ "expires_at": /*#__PURE__*/S.optionalWith(S.Int, {
1438
+ nullable: true
1439
+ }),
1440
+ "last_active_at": /*#__PURE__*/S.NullOr(S.Int),
1441
+ "metadata": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Record({
1442
+ key: S.String,
1443
+ value: S.Unknown
1444
+ }))
1445
+ }) {}
1446
+ export class ListVectorStoresResponse extends /*#__PURE__*/S.Class("ListVectorStoresResponse")({
1447
+ "object": S.String,
1448
+ "data": /*#__PURE__*/S.Array(VectorStoreObject),
1449
+ "first_id": S.String,
1450
+ "last_id": S.String,
1451
+ "has_more": S.Boolean
1452
+ }) {}
1453
+ export class AutoChunkingStrategyRequestParam extends /*#__PURE__*/S.Struct({
1454
+ "type": /*#__PURE__*/S.Literal("auto")
1455
+ }) {}
1456
+ export class StaticChunkingStrategy extends /*#__PURE__*/S.Struct({
1457
+ "max_chunk_size_tokens": /*#__PURE__*/S.Int.pipe( /*#__PURE__*/S.greaterThanOrEqualTo(100), /*#__PURE__*/S.lessThanOrEqualTo(4096)),
1458
+ "chunk_overlap_tokens": S.Int
1459
+ }) {}
1460
+ export class StaticChunkingStrategyRequestParam extends /*#__PURE__*/S.Struct({
1461
+ "type": /*#__PURE__*/S.Literal("static"),
1462
+ "static": StaticChunkingStrategy
1463
+ }) {}
1464
+ export class CreateVectorStoreRequest extends /*#__PURE__*/S.Class("CreateVectorStoreRequest")({
1465
+ "file_ids": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.maxItems(500))),
1466
+ "name": /*#__PURE__*/S.optional(S.String),
1467
+ "expires_after": /*#__PURE__*/S.optional(VectorStoreExpirationAfter),
1468
+ "chunking_strategy": /*#__PURE__*/S.optional( /*#__PURE__*/S.Record({
1469
+ key: S.String,
1470
+ value: S.Unknown
1471
+ })),
1472
+ "metadata": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Record({
1473
+ key: S.String,
1474
+ value: S.Unknown
1475
+ }), {
1476
+ nullable: true
1477
+ })
1478
+ }) {}
1479
+ export class UpdateVectorStoreRequest extends /*#__PURE__*/S.Class("UpdateVectorStoreRequest")({
1480
+ "name": /*#__PURE__*/S.optionalWith(S.String, {
1481
+ nullable: true
1482
+ }),
1483
+ "expires_after": /*#__PURE__*/S.optional(VectorStoreExpirationAfter),
1484
+ "metadata": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Record({
1485
+ key: S.String,
1486
+ value: S.Unknown
1487
+ }), {
1488
+ nullable: true
1489
+ })
1490
+ }) {}
1491
+ export class DeleteVectorStoreResponse extends /*#__PURE__*/S.Class("DeleteVectorStoreResponse")({
1492
+ "id": S.String,
1493
+ "deleted": S.Boolean,
1494
+ "object": /*#__PURE__*/S.Literal("vector_store.deleted")
1495
+ }) {}
1496
+ export class ListVectorStoreFilesParams extends /*#__PURE__*/S.Struct({
1497
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
1498
+ default: () => 20
1499
+ }),
1500
+ "order": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("asc", "desc"), {
1501
+ default: () => "desc"
1502
+ }),
1503
+ "after": /*#__PURE__*/S.optional(S.String),
1504
+ "before": /*#__PURE__*/S.optional(S.String),
1505
+ "filter": /*#__PURE__*/S.optional( /*#__PURE__*/S.Literal("in_progress", "completed", "failed", "cancelled"))
1506
+ }) {}
1507
+ export class StaticChunkingStrategyResponseParam extends /*#__PURE__*/S.Struct({
1508
+ "type": /*#__PURE__*/S.Literal("static"),
1509
+ "static": StaticChunkingStrategy
1510
+ }) {}
1511
+ export class OtherChunkingStrategyResponseParam extends /*#__PURE__*/S.Struct({
1512
+ "type": /*#__PURE__*/S.Literal("other")
1513
+ }) {}
1514
+ export class VectorStoreFileObject extends /*#__PURE__*/S.Struct({
1515
+ "id": S.String,
1516
+ "object": /*#__PURE__*/S.Literal("vector_store.file"),
1517
+ "usage_bytes": S.Int,
1518
+ "created_at": S.Int,
1519
+ "vector_store_id": S.String,
1520
+ "status": /*#__PURE__*/S.Literal("in_progress", "completed", "cancelled", "failed"),
1521
+ "last_error": /*#__PURE__*/S.NullOr( /*#__PURE__*/S.Struct({
1522
+ "code": /*#__PURE__*/S.Literal("server_error", "unsupported_file", "invalid_file"),
1523
+ "message": S.String
1524
+ })),
1525
+ "chunking_strategy": /*#__PURE__*/S.optional( /*#__PURE__*/S.Record({
1526
+ key: S.String,
1527
+ value: S.Unknown
1528
+ }))
1529
+ }) {}
1530
+ export class ListVectorStoreFilesResponse extends /*#__PURE__*/S.Class("ListVectorStoreFilesResponse")({
1531
+ "object": S.String,
1532
+ "data": /*#__PURE__*/S.Array(VectorStoreFileObject),
1533
+ "first_id": S.String,
1534
+ "last_id": S.String,
1535
+ "has_more": S.Boolean
1536
+ }) {}
1537
+ export class ChunkingStrategyRequestParam extends /*#__PURE__*/S.Record({
1538
+ key: S.String,
1539
+ value: S.Unknown
1540
+ }) {}
1541
+ export class CreateVectorStoreFileRequest extends /*#__PURE__*/S.Class("CreateVectorStoreFileRequest")({
1542
+ "file_id": S.String,
1543
+ "chunking_strategy": /*#__PURE__*/S.optional(ChunkingStrategyRequestParam)
1544
+ }) {}
1545
+ export class DeleteVectorStoreFileResponse extends /*#__PURE__*/S.Class("DeleteVectorStoreFileResponse")({
1546
+ "id": S.String,
1547
+ "deleted": S.Boolean,
1548
+ "object": /*#__PURE__*/S.Literal("vector_store.file.deleted")
1549
+ }) {}
1550
+ export class CreateVectorStoreFileBatchRequest extends /*#__PURE__*/S.Class("CreateVectorStoreFileBatchRequest")({
1551
+ "file_ids": /*#__PURE__*/S.Array(S.String).pipe( /*#__PURE__*/S.minItems(1), /*#__PURE__*/S.maxItems(500)),
1552
+ "chunking_strategy": /*#__PURE__*/S.optional(ChunkingStrategyRequestParam)
1553
+ }) {}
1554
+ export class VectorStoreFileBatchObject extends /*#__PURE__*/S.Class("VectorStoreFileBatchObject")({
1555
+ "id": S.String,
1556
+ "object": /*#__PURE__*/S.Literal("vector_store.files_batch"),
1557
+ "created_at": S.Int,
1558
+ "vector_store_id": S.String,
1559
+ "status": /*#__PURE__*/S.Literal("in_progress", "completed", "cancelled", "failed"),
1560
+ "file_counts": /*#__PURE__*/S.Struct({
1561
+ "in_progress": S.Int,
1562
+ "completed": S.Int,
1563
+ "failed": S.Int,
1564
+ "cancelled": S.Int,
1565
+ "total": S.Int
1566
+ })
1567
+ }) {}
1568
+ export class ListFilesInVectorStoreBatchParams extends /*#__PURE__*/S.Struct({
1569
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
1570
+ default: () => 20
1571
+ }),
1572
+ "order": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Literal("asc", "desc"), {
1573
+ default: () => "desc"
1574
+ }),
1575
+ "after": /*#__PURE__*/S.optional(S.String),
1576
+ "before": /*#__PURE__*/S.optional(S.String),
1577
+ "filter": /*#__PURE__*/S.optional( /*#__PURE__*/S.Literal("in_progress", "completed", "failed", "cancelled"))
1578
+ }) {}
1579
+ export class ListBatchesParams extends /*#__PURE__*/S.Struct({
1580
+ "after": /*#__PURE__*/S.optional(S.String),
1581
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
1582
+ default: () => 20
1583
+ })
1584
+ }) {}
1585
+ export class Batch extends /*#__PURE__*/S.Struct({
1586
+ "id": S.String,
1587
+ "object": /*#__PURE__*/S.Literal("batch"),
1588
+ "endpoint": S.String,
1589
+ "errors": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1590
+ "object": /*#__PURE__*/S.optional(S.String),
1591
+ "data": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array( /*#__PURE__*/S.Struct({
1592
+ "code": /*#__PURE__*/S.optional(S.String),
1593
+ "message": /*#__PURE__*/S.optional(S.String),
1594
+ "param": /*#__PURE__*/S.optionalWith(S.String, {
1595
+ nullable: true
1596
+ }),
1597
+ "line": /*#__PURE__*/S.optionalWith(S.Int, {
1598
+ nullable: true
1599
+ })
1600
+ })))
1601
+ })),
1602
+ "input_file_id": S.String,
1603
+ "completion_window": S.String,
1604
+ "status": /*#__PURE__*/S.Literal("validating", "failed", "in_progress", "finalizing", "completed", "expired", "cancelling", "cancelled"),
1605
+ "output_file_id": /*#__PURE__*/S.optional(S.String),
1606
+ "error_file_id": /*#__PURE__*/S.optional(S.String),
1607
+ "created_at": S.Int,
1608
+ "in_progress_at": /*#__PURE__*/S.optional(S.Int),
1609
+ "expires_at": /*#__PURE__*/S.optional(S.Int),
1610
+ "finalizing_at": /*#__PURE__*/S.optional(S.Int),
1611
+ "completed_at": /*#__PURE__*/S.optional(S.Int),
1612
+ "failed_at": /*#__PURE__*/S.optional(S.Int),
1613
+ "expired_at": /*#__PURE__*/S.optional(S.Int),
1614
+ "cancelling_at": /*#__PURE__*/S.optional(S.Int),
1615
+ "cancelled_at": /*#__PURE__*/S.optional(S.Int),
1616
+ "request_counts": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1617
+ "total": S.Int,
1618
+ "completed": S.Int,
1619
+ "failed": S.Int
1620
+ })),
1621
+ "metadata": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Record({
1622
+ key: S.String,
1623
+ value: S.Unknown
1624
+ }), {
1625
+ nullable: true
1626
+ })
1627
+ }) {}
1628
+ export class ListBatchesResponse extends /*#__PURE__*/S.Class("ListBatchesResponse")({
1629
+ "data": /*#__PURE__*/S.Array(Batch),
1630
+ "first_id": /*#__PURE__*/S.optional(S.String),
1631
+ "last_id": /*#__PURE__*/S.optional(S.String),
1632
+ "has_more": S.Boolean,
1633
+ "object": /*#__PURE__*/S.Literal("list")
1634
+ }) {}
1635
+ export class CreateBatchRequest extends /*#__PURE__*/S.Class("CreateBatchRequest")({
1636
+ "input_file_id": S.String,
1637
+ "endpoint": /*#__PURE__*/S.Literal("/v1/chat/completions", "/v1/embeddings", "/v1/completions"),
1638
+ "completion_window": /*#__PURE__*/S.Literal("24h"),
1639
+ "metadata": /*#__PURE__*/S.optionalWith( /*#__PURE__*/S.Record({
1640
+ key: S.String,
1641
+ value: S.Unknown
1642
+ }), {
1643
+ nullable: true
1644
+ })
1645
+ }) {}
1646
+ export class AuditLogEventType extends /*#__PURE__*/S.Literal("api_key.created", "api_key.updated", "api_key.deleted", "invite.sent", "invite.accepted", "invite.deleted", "login.succeeded", "login.failed", "logout.succeeded", "logout.failed", "organization.updated", "project.created", "project.updated", "project.archived", "service_account.created", "service_account.updated", "service_account.deleted", "user.added", "user.updated", "user.deleted") {}
1647
+ export class ListAuditLogsParams extends /*#__PURE__*/S.Struct({
1648
+ "effective_at[gt]": /*#__PURE__*/S.optional(S.Int),
1649
+ "effective_at[gte]": /*#__PURE__*/S.optional(S.Int),
1650
+ "effective_at[lt]": /*#__PURE__*/S.optional(S.Int),
1651
+ "effective_at[lte]": /*#__PURE__*/S.optional(S.Int),
1652
+ "project_ids[]": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String)),
1653
+ "event_types[]": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(AuditLogEventType)),
1654
+ "actor_ids[]": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String)),
1655
+ "actor_emails[]": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String)),
1656
+ "resource_ids[]": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String)),
1657
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
1658
+ default: () => 20
1659
+ }),
1660
+ "after": /*#__PURE__*/S.optional(S.String),
1661
+ "before": /*#__PURE__*/S.optional(S.String)
1662
+ }) {}
1663
+ export class AuditLogActorUser extends /*#__PURE__*/S.Struct({
1664
+ "id": /*#__PURE__*/S.optional(S.String),
1665
+ "email": /*#__PURE__*/S.optional(S.String)
1666
+ }) {}
1667
+ export class AuditLogActorSession extends /*#__PURE__*/S.Struct({
1668
+ "user": /*#__PURE__*/S.optional(AuditLogActorUser),
1669
+ "ip_address": /*#__PURE__*/S.optional(S.String)
1670
+ }) {}
1671
+ export class AuditLogActorServiceAccount extends /*#__PURE__*/S.Struct({
1672
+ "id": /*#__PURE__*/S.optional(S.String)
1673
+ }) {}
1674
+ export class AuditLogActorApiKey extends /*#__PURE__*/S.Struct({
1675
+ "id": /*#__PURE__*/S.optional(S.String),
1676
+ "type": /*#__PURE__*/S.optional( /*#__PURE__*/S.Literal("user", "service_account")),
1677
+ "user": /*#__PURE__*/S.optional(AuditLogActorUser),
1678
+ "service_account": /*#__PURE__*/S.optional(AuditLogActorServiceAccount)
1679
+ }) {}
1680
+ export class AuditLogActor extends /*#__PURE__*/S.Struct({
1681
+ "type": /*#__PURE__*/S.optional( /*#__PURE__*/S.Literal("session", "api_key")),
1682
+ "session": /*#__PURE__*/S.optional( /*#__PURE__*/S.Record({
1683
+ key: S.String,
1684
+ value: S.Unknown
1685
+ })),
1686
+ "api_key": /*#__PURE__*/S.optional( /*#__PURE__*/S.Record({
1687
+ key: S.String,
1688
+ value: S.Unknown
1689
+ }))
1690
+ }) {}
1691
+ export class AuditLog extends /*#__PURE__*/S.Struct({
1692
+ "id": S.String,
1693
+ "type": AuditLogEventType,
1694
+ "effective_at": S.Int,
1695
+ "project": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1696
+ "id": /*#__PURE__*/S.optional(S.String),
1697
+ "name": /*#__PURE__*/S.optional(S.String)
1698
+ })),
1699
+ "actor": AuditLogActor,
1700
+ "api_key.created": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1701
+ "id": /*#__PURE__*/S.optional(S.String),
1702
+ "data": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1703
+ "scopes": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String))
1704
+ }))
1705
+ })),
1706
+ "api_key.updated": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1707
+ "id": /*#__PURE__*/S.optional(S.String),
1708
+ "changes_requested": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1709
+ "scopes": /*#__PURE__*/S.optional( /*#__PURE__*/S.Array(S.String))
1710
+ }))
1711
+ })),
1712
+ "api_key.deleted": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1713
+ "id": /*#__PURE__*/S.optional(S.String)
1714
+ })),
1715
+ "invite.sent": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1716
+ "id": /*#__PURE__*/S.optional(S.String),
1717
+ "data": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1718
+ "email": /*#__PURE__*/S.optional(S.String),
1719
+ "role": /*#__PURE__*/S.optional(S.String)
1720
+ }))
1721
+ })),
1722
+ "invite.accepted": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1723
+ "id": /*#__PURE__*/S.optional(S.String)
1724
+ })),
1725
+ "invite.deleted": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1726
+ "id": /*#__PURE__*/S.optional(S.String)
1727
+ })),
1728
+ "login.failed": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1729
+ "error_code": /*#__PURE__*/S.optional(S.String),
1730
+ "error_message": /*#__PURE__*/S.optional(S.String)
1731
+ })),
1732
+ "logout.failed": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1733
+ "error_code": /*#__PURE__*/S.optional(S.String),
1734
+ "error_message": /*#__PURE__*/S.optional(S.String)
1735
+ })),
1736
+ "organization.updated": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1737
+ "id": /*#__PURE__*/S.optional(S.String),
1738
+ "changes_requested": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1739
+ "title": /*#__PURE__*/S.optional(S.String),
1740
+ "description": /*#__PURE__*/S.optional(S.String),
1741
+ "name": /*#__PURE__*/S.optional(S.String),
1742
+ "settings": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1743
+ "threads_ui_visibility": /*#__PURE__*/S.optional(S.String),
1744
+ "usage_dashboard_visibility": /*#__PURE__*/S.optional(S.String)
1745
+ }))
1746
+ }))
1747
+ })),
1748
+ "project.created": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1749
+ "id": /*#__PURE__*/S.optional(S.String),
1750
+ "data": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1751
+ "name": /*#__PURE__*/S.optional(S.String),
1752
+ "title": /*#__PURE__*/S.optional(S.String)
1753
+ }))
1754
+ })),
1755
+ "project.updated": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1756
+ "id": /*#__PURE__*/S.optional(S.String),
1757
+ "changes_requested": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1758
+ "title": /*#__PURE__*/S.optional(S.String)
1759
+ }))
1760
+ })),
1761
+ "project.archived": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1762
+ "id": /*#__PURE__*/S.optional(S.String)
1763
+ })),
1764
+ "service_account.created": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1765
+ "id": /*#__PURE__*/S.optional(S.String),
1766
+ "data": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1767
+ "role": /*#__PURE__*/S.optional(S.String)
1768
+ }))
1769
+ })),
1770
+ "service_account.updated": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1771
+ "id": /*#__PURE__*/S.optional(S.String),
1772
+ "changes_requested": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1773
+ "role": /*#__PURE__*/S.optional(S.String)
1774
+ }))
1775
+ })),
1776
+ "service_account.deleted": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1777
+ "id": /*#__PURE__*/S.optional(S.String)
1778
+ })),
1779
+ "user.added": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1780
+ "id": /*#__PURE__*/S.optional(S.String),
1781
+ "data": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1782
+ "role": /*#__PURE__*/S.optional(S.String)
1783
+ }))
1784
+ })),
1785
+ "user.updated": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1786
+ "id": /*#__PURE__*/S.optional(S.String),
1787
+ "changes_requested": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1788
+ "role": /*#__PURE__*/S.optional(S.String)
1789
+ }))
1790
+ })),
1791
+ "user.deleted": /*#__PURE__*/S.optional( /*#__PURE__*/S.Struct({
1792
+ "id": /*#__PURE__*/S.optional(S.String)
1793
+ }))
1794
+ }) {}
1795
+ export class ListAuditLogsResponse extends /*#__PURE__*/S.Class("ListAuditLogsResponse")({
1796
+ "object": /*#__PURE__*/S.Literal("list"),
1797
+ "data": /*#__PURE__*/S.Array(AuditLog),
1798
+ "first_id": S.String,
1799
+ "last_id": S.String,
1800
+ "has_more": S.Boolean
1801
+ }) {}
1802
+ export class ListInvitesParams extends /*#__PURE__*/S.Struct({
1803
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
1804
+ default: () => 20
1805
+ }),
1806
+ "after": /*#__PURE__*/S.optional(S.String)
1807
+ }) {}
1808
+ export class Invite extends /*#__PURE__*/S.Struct({
1809
+ "object": /*#__PURE__*/S.Literal("organization.invite"),
1810
+ "id": S.String,
1811
+ "email": S.String,
1812
+ "role": /*#__PURE__*/S.Literal("owner", "reader"),
1813
+ "status": /*#__PURE__*/S.Literal("accepted", "expired", "pending"),
1814
+ "invited_at": S.Int,
1815
+ "expires_at": S.Int,
1816
+ "accepted_at": /*#__PURE__*/S.optional(S.Int)
1817
+ }) {}
1818
+ export class InviteListResponse extends /*#__PURE__*/S.Class("InviteListResponse")({
1819
+ "object": /*#__PURE__*/S.Literal("list"),
1820
+ "data": /*#__PURE__*/S.Array(Invite),
1821
+ "first_id": /*#__PURE__*/S.optional(S.String),
1822
+ "last_id": /*#__PURE__*/S.optional(S.String),
1823
+ "has_more": /*#__PURE__*/S.optional(S.Boolean)
1824
+ }) {}
1825
+ export class InviteRequest extends /*#__PURE__*/S.Class("InviteRequest")({
1826
+ "email": S.String,
1827
+ "role": /*#__PURE__*/S.Literal("reader", "owner")
1828
+ }) {}
1829
+ export class InviteDeleteResponse extends /*#__PURE__*/S.Class("InviteDeleteResponse")({
1830
+ "object": /*#__PURE__*/S.Literal("organization.invite.deleted"),
1831
+ "id": S.String,
1832
+ "deleted": S.Boolean
1833
+ }) {}
1834
+ export class ListUsersParams extends /*#__PURE__*/S.Struct({
1835
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
1836
+ default: () => 20
1837
+ }),
1838
+ "after": /*#__PURE__*/S.optional(S.String)
1839
+ }) {}
1840
+ export class User extends /*#__PURE__*/S.Struct({
1841
+ "object": /*#__PURE__*/S.Literal("organization.user"),
1842
+ "id": S.String,
1843
+ "name": S.String,
1844
+ "email": S.String,
1845
+ "role": /*#__PURE__*/S.Literal("owner", "reader"),
1846
+ "added_at": S.Int
1847
+ }) {}
1848
+ export class UserListResponse extends /*#__PURE__*/S.Class("UserListResponse")({
1849
+ "object": /*#__PURE__*/S.Literal("list"),
1850
+ "data": /*#__PURE__*/S.Array(User),
1851
+ "first_id": S.String,
1852
+ "last_id": S.String,
1853
+ "has_more": S.Boolean
1854
+ }) {}
1855
+ export class UserRoleUpdateRequest extends /*#__PURE__*/S.Class("UserRoleUpdateRequest")({
1856
+ "role": /*#__PURE__*/S.Literal("owner", "reader")
1857
+ }) {}
1858
+ export class UserDeleteResponse extends /*#__PURE__*/S.Class("UserDeleteResponse")({
1859
+ "object": /*#__PURE__*/S.Literal("organization.user.deleted"),
1860
+ "id": S.String,
1861
+ "deleted": S.Boolean
1862
+ }) {}
1863
+ export class ListProjectsParams extends /*#__PURE__*/S.Struct({
1864
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
1865
+ default: () => 20
1866
+ }),
1867
+ "after": /*#__PURE__*/S.optional(S.String),
1868
+ "include_archived": /*#__PURE__*/S.optionalWith(S.Boolean, {
1869
+ default: () => false
1870
+ })
1871
+ }) {}
1872
+ export class Project extends /*#__PURE__*/S.Struct({
1873
+ "id": S.String,
1874
+ "object": /*#__PURE__*/S.Literal("organization.project"),
1875
+ "name": S.String,
1876
+ "created_at": S.Int,
1877
+ "archived_at": /*#__PURE__*/S.optionalWith(S.Int, {
1878
+ nullable: true
1879
+ }),
1880
+ "status": /*#__PURE__*/S.Literal("active", "archived")
1881
+ }) {}
1882
+ export class ProjectListResponse extends /*#__PURE__*/S.Class("ProjectListResponse")({
1883
+ "object": /*#__PURE__*/S.Literal("list"),
1884
+ "data": /*#__PURE__*/S.Array(Project),
1885
+ "first_id": S.String,
1886
+ "last_id": S.String,
1887
+ "has_more": S.Boolean
1888
+ }) {}
1889
+ export class ProjectCreateRequest extends /*#__PURE__*/S.Class("ProjectCreateRequest")({
1890
+ "name": S.String
1891
+ }) {}
1892
+ export class ProjectUpdateRequest extends /*#__PURE__*/S.Class("ProjectUpdateRequest")({
1893
+ "name": S.String
1894
+ }) {}
1895
+ export class Error extends /*#__PURE__*/S.Struct({
1896
+ "code": /*#__PURE__*/S.NullOr(S.String),
1897
+ "message": S.String,
1898
+ "param": /*#__PURE__*/S.NullOr(S.String),
1899
+ "type": S.String
1900
+ }) {}
1901
+ export class ErrorResponse extends /*#__PURE__*/S.Class("ErrorResponse")({
1902
+ "error": Error
1903
+ }) {}
1904
+ export class ListProjectUsersParams extends /*#__PURE__*/S.Struct({
1905
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
1906
+ default: () => 20
1907
+ }),
1908
+ "after": /*#__PURE__*/S.optional(S.String)
1909
+ }) {}
1910
+ export class ProjectUser extends /*#__PURE__*/S.Struct({
1911
+ "object": /*#__PURE__*/S.Literal("organization.project.user"),
1912
+ "id": S.String,
1913
+ "name": S.String,
1914
+ "email": S.String,
1915
+ "role": /*#__PURE__*/S.Literal("owner", "member"),
1916
+ "added_at": S.Int
1917
+ }) {}
1918
+ export class ProjectUserListResponse extends /*#__PURE__*/S.Class("ProjectUserListResponse")({
1919
+ "object": S.String,
1920
+ "data": /*#__PURE__*/S.Array(ProjectUser),
1921
+ "first_id": S.String,
1922
+ "last_id": S.String,
1923
+ "has_more": S.Boolean
1924
+ }) {}
1925
+ export class ProjectUserCreateRequest extends /*#__PURE__*/S.Class("ProjectUserCreateRequest")({
1926
+ "user_id": S.String,
1927
+ "role": /*#__PURE__*/S.Literal("owner", "member")
1928
+ }) {}
1929
+ export class ProjectUserUpdateRequest extends /*#__PURE__*/S.Class("ProjectUserUpdateRequest")({
1930
+ "role": /*#__PURE__*/S.Literal("owner", "member")
1931
+ }) {}
1932
+ export class ProjectUserDeleteResponse extends /*#__PURE__*/S.Class("ProjectUserDeleteResponse")({
1933
+ "object": /*#__PURE__*/S.Literal("organization.project.user.deleted"),
1934
+ "id": S.String,
1935
+ "deleted": S.Boolean
1936
+ }) {}
1937
+ export class ListProjectServiceAccountsParams extends /*#__PURE__*/S.Struct({
1938
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
1939
+ default: () => 20
1940
+ }),
1941
+ "after": /*#__PURE__*/S.optional(S.String)
1942
+ }) {}
1943
+ export class ProjectServiceAccount extends /*#__PURE__*/S.Struct({
1944
+ "object": /*#__PURE__*/S.Literal("organization.project.service_account"),
1945
+ "id": S.String,
1946
+ "name": S.String,
1947
+ "role": /*#__PURE__*/S.Literal("owner", "member"),
1948
+ "created_at": S.Int
1949
+ }) {}
1950
+ export class ProjectServiceAccountListResponse extends /*#__PURE__*/S.Class("ProjectServiceAccountListResponse")({
1951
+ "object": /*#__PURE__*/S.Literal("list"),
1952
+ "data": /*#__PURE__*/S.Array(ProjectServiceAccount),
1953
+ "first_id": S.String,
1954
+ "last_id": S.String,
1955
+ "has_more": S.Boolean
1956
+ }) {}
1957
+ export class ProjectServiceAccountCreateRequest extends /*#__PURE__*/S.Class("ProjectServiceAccountCreateRequest")({
1958
+ "name": S.String
1959
+ }) {}
1960
+ export class ProjectServiceAccountApiKey extends /*#__PURE__*/S.Struct({
1961
+ "object": /*#__PURE__*/S.Literal("organization.project.service_account.api_key"),
1962
+ "value": S.String,
1963
+ "name": S.String,
1964
+ "created_at": S.Int,
1965
+ "id": S.String
1966
+ }) {}
1967
+ export class ProjectServiceAccountCreateResponse extends /*#__PURE__*/S.Class("ProjectServiceAccountCreateResponse")({
1968
+ "object": /*#__PURE__*/S.Literal("organization.project.service_account"),
1969
+ "id": S.String,
1970
+ "name": S.String,
1971
+ "role": /*#__PURE__*/S.Literal("member"),
1972
+ "created_at": S.Int,
1973
+ "api_key": ProjectServiceAccountApiKey
1974
+ }) {}
1975
+ export class ProjectServiceAccountDeleteResponse extends /*#__PURE__*/S.Class("ProjectServiceAccountDeleteResponse")({
1976
+ "object": /*#__PURE__*/S.Literal("organization.project.service_account.deleted"),
1977
+ "id": S.String,
1978
+ "deleted": S.Boolean
1979
+ }) {}
1980
+ export class ListProjectApiKeysParams extends /*#__PURE__*/S.Struct({
1981
+ "limit": /*#__PURE__*/S.optionalWith(S.Int, {
1982
+ default: () => 20
1983
+ }),
1984
+ "after": /*#__PURE__*/S.optional(S.String)
1985
+ }) {}
1986
+ export class ProjectApiKey extends /*#__PURE__*/S.Struct({
1987
+ "object": /*#__PURE__*/S.Literal("organization.project.api_key"),
1988
+ "redacted_value": S.String,
1989
+ "name": S.String,
1990
+ "created_at": S.Int,
1991
+ "id": S.String,
1992
+ "owner": /*#__PURE__*/S.Struct({
1993
+ "type": /*#__PURE__*/S.optional( /*#__PURE__*/S.Literal("user", "service_account")),
1994
+ "user": /*#__PURE__*/S.optional(ProjectUser),
1995
+ "service_account": /*#__PURE__*/S.optional(ProjectServiceAccount)
1996
+ })
1997
+ }) {}
1998
+ export class ProjectApiKeyListResponse extends /*#__PURE__*/S.Class("ProjectApiKeyListResponse")({
1999
+ "object": /*#__PURE__*/S.Literal("list"),
2000
+ "data": /*#__PURE__*/S.Array(ProjectApiKey),
2001
+ "first_id": S.String,
2002
+ "last_id": S.String,
2003
+ "has_more": S.Boolean
2004
+ }) {}
2005
+ export class ProjectApiKeyDeleteResponse extends /*#__PURE__*/S.Class("ProjectApiKeyDeleteResponse")({
2006
+ "object": /*#__PURE__*/S.Literal("organization.project.api_key.deleted"),
2007
+ "id": S.String,
2008
+ "deleted": S.Boolean
2009
+ }) {}
2010
+ export const make = httpClient => {
2011
+ const unexpectedStatus = (request, response) => Effect.flatMap(Effect.orElseSucceed(response.text, () => "Unexpected status code"), description => Effect.fail(new HttpClientError.ResponseError({
2012
+ request,
2013
+ response,
2014
+ reason: "StatusCode",
2015
+ description
2016
+ })));
2017
+ const decodeError = (response, schema) => Effect.flatMap(HttpClientResponse.schemaBodyJson(schema)(response), Effect.fail);
2018
+ return {
2019
+ "createChatCompletion": options => HttpClientRequest.make("POST")(`/chat/completions`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2020
+ "200": r => HttpClientResponse.schemaBodyJson(CreateChatCompletionResponse)(r),
2021
+ orElse: response => unexpectedStatus(request, response)
2022
+ }))), Effect.scoped),
2023
+ "createCompletion": options => HttpClientRequest.make("POST")(`/completions`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2024
+ "200": r => HttpClientResponse.schemaBodyJson(CreateCompletionResponse)(r),
2025
+ orElse: response => unexpectedStatus(request, response)
2026
+ }))), Effect.scoped),
2027
+ "createImage": options => HttpClientRequest.make("POST")(`/images/generations`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2028
+ "200": r => HttpClientResponse.schemaBodyJson(ImagesResponse)(r),
2029
+ orElse: response => unexpectedStatus(request, response)
2030
+ }))), Effect.scoped),
2031
+ "createImageEdit": options => HttpClientRequest.make("POST")(`/images/edits`).pipe(HttpClientRequest.bodyFormData(options), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2032
+ "200": r => HttpClientResponse.schemaBodyJson(ImagesResponse)(r),
2033
+ orElse: response => unexpectedStatus(request, response)
2034
+ }))), Effect.scoped),
2035
+ "createImageVariation": options => HttpClientRequest.make("POST")(`/images/variations`).pipe(HttpClientRequest.bodyFormData(options), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2036
+ "200": r => HttpClientResponse.schemaBodyJson(ImagesResponse)(r),
2037
+ orElse: response => unexpectedStatus(request, response)
2038
+ }))), Effect.scoped),
2039
+ "createEmbedding": options => HttpClientRequest.make("POST")(`/embeddings`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2040
+ "200": r => HttpClientResponse.schemaBodyJson(CreateEmbeddingResponse)(r),
2041
+ orElse: response => unexpectedStatus(request, response)
2042
+ }))), Effect.scoped),
2043
+ "createSpeech": options => HttpClientRequest.make("POST")(`/audio/speech`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2044
+ orElse: response => unexpectedStatus(request, response)
2045
+ }))), Effect.scoped),
2046
+ "createTranscription": options => HttpClientRequest.make("POST")(`/audio/transcriptions`).pipe(HttpClientRequest.bodyFormData(options), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2047
+ "200": r => HttpClientResponse.schemaBodyJson(CreateTranscription200)(r),
2048
+ orElse: response => unexpectedStatus(request, response)
2049
+ }))), Effect.scoped),
2050
+ "createTranslation": options => HttpClientRequest.make("POST")(`/audio/translations`).pipe(HttpClientRequest.bodyFormData(options), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2051
+ "200": r => HttpClientResponse.schemaBodyJson(CreateTranslation200)(r),
2052
+ orElse: response => unexpectedStatus(request, response)
2053
+ }))), Effect.scoped),
2054
+ "listFiles": options => HttpClientRequest.make("GET")(`/files`).pipe(HttpClientRequest.setUrlParams({
2055
+ "purpose": options["purpose"]
2056
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2057
+ "200": r => HttpClientResponse.schemaBodyJson(ListFilesResponse)(r),
2058
+ orElse: response => unexpectedStatus(request, response)
2059
+ }))), Effect.scoped),
2060
+ "createFile": options => HttpClientRequest.make("POST")(`/files`).pipe(HttpClientRequest.bodyFormData(options), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2061
+ "200": r => HttpClientResponse.schemaBodyJson(OpenAIFile)(r),
2062
+ orElse: response => unexpectedStatus(request, response)
2063
+ }))), Effect.scoped),
2064
+ "retrieveFile": fileId => HttpClientRequest.make("GET")(`/files/${fileId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2065
+ "200": r => HttpClientResponse.schemaBodyJson(OpenAIFile)(r),
2066
+ orElse: response => unexpectedStatus(request, response)
2067
+ }))), Effect.scoped),
2068
+ "deleteFile": fileId => HttpClientRequest.make("DELETE")(`/files/${fileId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2069
+ "200": r => HttpClientResponse.schemaBodyJson(DeleteFileResponse)(r),
2070
+ orElse: response => unexpectedStatus(request, response)
2071
+ }))), Effect.scoped),
2072
+ "downloadFile": fileId => HttpClientRequest.make("GET")(`/files/${fileId}/content`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2073
+ "200": r => HttpClientResponse.schemaBodyJson(DownloadFile200)(r),
2074
+ orElse: response => unexpectedStatus(request, response)
2075
+ }))), Effect.scoped),
2076
+ "createUpload": options => HttpClientRequest.make("POST")(`/uploads`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2077
+ "200": r => HttpClientResponse.schemaBodyJson(Upload)(r),
2078
+ orElse: response => unexpectedStatus(request, response)
2079
+ }))), Effect.scoped),
2080
+ "addUploadPart": (uploadId, options) => HttpClientRequest.make("POST")(`/uploads/${uploadId}/parts`).pipe(HttpClientRequest.bodyFormData(options), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2081
+ "200": r => HttpClientResponse.schemaBodyJson(UploadPart)(r),
2082
+ orElse: response => unexpectedStatus(request, response)
2083
+ }))), Effect.scoped),
2084
+ "completeUpload": (uploadId, options) => HttpClientRequest.make("POST")(`/uploads/${uploadId}/complete`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2085
+ "200": r => HttpClientResponse.schemaBodyJson(Upload)(r),
2086
+ orElse: response => unexpectedStatus(request, response)
2087
+ }))), Effect.scoped),
2088
+ "cancelUpload": uploadId => HttpClientRequest.make("POST")(`/uploads/${uploadId}/cancel`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2089
+ "200": r => HttpClientResponse.schemaBodyJson(Upload)(r),
2090
+ orElse: response => unexpectedStatus(request, response)
2091
+ }))), Effect.scoped),
2092
+ "listPaginatedFineTuningJobs": options => HttpClientRequest.make("GET")(`/fine_tuning/jobs`).pipe(HttpClientRequest.setUrlParams({
2093
+ "after": options["after"],
2094
+ "limit": options["limit"]
2095
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2096
+ "200": r => HttpClientResponse.schemaBodyJson(ListPaginatedFineTuningJobsResponse)(r),
2097
+ orElse: response => unexpectedStatus(request, response)
2098
+ }))), Effect.scoped),
2099
+ "createFineTuningJob": options => HttpClientRequest.make("POST")(`/fine_tuning/jobs`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2100
+ "200": r => HttpClientResponse.schemaBodyJson(FineTuningJob)(r),
2101
+ orElse: response => unexpectedStatus(request, response)
2102
+ }))), Effect.scoped),
2103
+ "retrieveFineTuningJob": fineTuningJobId => HttpClientRequest.make("GET")(`/fine_tuning/jobs/${fineTuningJobId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2104
+ "200": r => HttpClientResponse.schemaBodyJson(FineTuningJob)(r),
2105
+ orElse: response => unexpectedStatus(request, response)
2106
+ }))), Effect.scoped),
2107
+ "listFineTuningEvents": (fineTuningJobId, options) => HttpClientRequest.make("GET")(`/fine_tuning/jobs/${fineTuningJobId}/events`).pipe(HttpClientRequest.setUrlParams({
2108
+ "after": options["after"],
2109
+ "limit": options["limit"]
2110
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2111
+ "200": r => HttpClientResponse.schemaBodyJson(ListFineTuningJobEventsResponse)(r),
2112
+ orElse: response => unexpectedStatus(request, response)
2113
+ }))), Effect.scoped),
2114
+ "cancelFineTuningJob": fineTuningJobId => HttpClientRequest.make("POST")(`/fine_tuning/jobs/${fineTuningJobId}/cancel`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2115
+ "200": r => HttpClientResponse.schemaBodyJson(FineTuningJob)(r),
2116
+ orElse: response => unexpectedStatus(request, response)
2117
+ }))), Effect.scoped),
2118
+ "listFineTuningJobCheckpoints": (fineTuningJobId, options) => HttpClientRequest.make("GET")(`/fine_tuning/jobs/${fineTuningJobId}/checkpoints`).pipe(HttpClientRequest.setUrlParams({
2119
+ "after": options["after"],
2120
+ "limit": options["limit"]
2121
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2122
+ "200": r => HttpClientResponse.schemaBodyJson(ListFineTuningJobCheckpointsResponse)(r),
2123
+ orElse: response => unexpectedStatus(request, response)
2124
+ }))), Effect.scoped),
2125
+ "listModels": () => HttpClientRequest.make("GET")(`/models`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2126
+ "200": r => HttpClientResponse.schemaBodyJson(ListModelsResponse)(r),
2127
+ orElse: response => unexpectedStatus(request, response)
2128
+ }))), Effect.scoped),
2129
+ "retrieveModel": model => HttpClientRequest.make("GET")(`/models/${model}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2130
+ "200": r => HttpClientResponse.schemaBodyJson(Model)(r),
2131
+ orElse: response => unexpectedStatus(request, response)
2132
+ }))), Effect.scoped),
2133
+ "deleteModel": model => HttpClientRequest.make("DELETE")(`/models/${model}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2134
+ "200": r => HttpClientResponse.schemaBodyJson(DeleteModelResponse)(r),
2135
+ orElse: response => unexpectedStatus(request, response)
2136
+ }))), Effect.scoped),
2137
+ "createModeration": options => HttpClientRequest.make("POST")(`/moderations`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2138
+ "200": r => HttpClientResponse.schemaBodyJson(CreateModerationResponse)(r),
2139
+ orElse: response => unexpectedStatus(request, response)
2140
+ }))), Effect.scoped),
2141
+ "listAssistants": options => HttpClientRequest.make("GET")(`/assistants`).pipe(HttpClientRequest.setUrlParams({
2142
+ "limit": options["limit"],
2143
+ "order": options["order"],
2144
+ "after": options["after"],
2145
+ "before": options["before"]
2146
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2147
+ "200": r => HttpClientResponse.schemaBodyJson(ListAssistantsResponse)(r),
2148
+ orElse: response => unexpectedStatus(request, response)
2149
+ }))), Effect.scoped),
2150
+ "createAssistant": options => HttpClientRequest.make("POST")(`/assistants`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2151
+ "200": r => HttpClientResponse.schemaBodyJson(AssistantObject)(r),
2152
+ orElse: response => unexpectedStatus(request, response)
2153
+ }))), Effect.scoped),
2154
+ "getAssistant": assistantId => HttpClientRequest.make("GET")(`/assistants/${assistantId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2155
+ "200": r => HttpClientResponse.schemaBodyJson(AssistantObject)(r),
2156
+ orElse: response => unexpectedStatus(request, response)
2157
+ }))), Effect.scoped),
2158
+ "modifyAssistant": (assistantId, options) => HttpClientRequest.make("POST")(`/assistants/${assistantId}`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2159
+ "200": r => HttpClientResponse.schemaBodyJson(AssistantObject)(r),
2160
+ orElse: response => unexpectedStatus(request, response)
2161
+ }))), Effect.scoped),
2162
+ "deleteAssistant": assistantId => HttpClientRequest.make("DELETE")(`/assistants/${assistantId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2163
+ "200": r => HttpClientResponse.schemaBodyJson(DeleteAssistantResponse)(r),
2164
+ orElse: response => unexpectedStatus(request, response)
2165
+ }))), Effect.scoped),
2166
+ "createThread": options => HttpClientRequest.make("POST")(`/threads`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2167
+ "200": r => HttpClientResponse.schemaBodyJson(ThreadObject)(r),
2168
+ orElse: response => unexpectedStatus(request, response)
2169
+ }))), Effect.scoped),
2170
+ "getThread": threadId => HttpClientRequest.make("GET")(`/threads/${threadId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2171
+ "200": r => HttpClientResponse.schemaBodyJson(ThreadObject)(r),
2172
+ orElse: response => unexpectedStatus(request, response)
2173
+ }))), Effect.scoped),
2174
+ "modifyThread": (threadId, options) => HttpClientRequest.make("POST")(`/threads/${threadId}`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2175
+ "200": r => HttpClientResponse.schemaBodyJson(ThreadObject)(r),
2176
+ orElse: response => unexpectedStatus(request, response)
2177
+ }))), Effect.scoped),
2178
+ "deleteThread": threadId => HttpClientRequest.make("DELETE")(`/threads/${threadId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2179
+ "200": r => HttpClientResponse.schemaBodyJson(DeleteThreadResponse)(r),
2180
+ orElse: response => unexpectedStatus(request, response)
2181
+ }))), Effect.scoped),
2182
+ "listMessages": (threadId, options) => HttpClientRequest.make("GET")(`/threads/${threadId}/messages`).pipe(HttpClientRequest.setUrlParams({
2183
+ "limit": options["limit"],
2184
+ "order": options["order"],
2185
+ "after": options["after"],
2186
+ "before": options["before"],
2187
+ "run_id": options["run_id"]
2188
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2189
+ "200": r => HttpClientResponse.schemaBodyJson(ListMessagesResponse)(r),
2190
+ orElse: response => unexpectedStatus(request, response)
2191
+ }))), Effect.scoped),
2192
+ "createMessage": (threadId, options) => HttpClientRequest.make("POST")(`/threads/${threadId}/messages`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2193
+ "200": r => HttpClientResponse.schemaBodyJson(MessageObject)(r),
2194
+ orElse: response => unexpectedStatus(request, response)
2195
+ }))), Effect.scoped),
2196
+ "getMessage": (threadId, messageId) => HttpClientRequest.make("GET")(`/threads/${threadId}/messages/${messageId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2197
+ "200": r => HttpClientResponse.schemaBodyJson(MessageObject)(r),
2198
+ orElse: response => unexpectedStatus(request, response)
2199
+ }))), Effect.scoped),
2200
+ "modifyMessage": (threadId, messageId, options) => HttpClientRequest.make("POST")(`/threads/${threadId}/messages/${messageId}`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2201
+ "200": r => HttpClientResponse.schemaBodyJson(MessageObject)(r),
2202
+ orElse: response => unexpectedStatus(request, response)
2203
+ }))), Effect.scoped),
2204
+ "deleteMessage": (threadId, messageId) => HttpClientRequest.make("DELETE")(`/threads/${threadId}/messages/${messageId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2205
+ "200": r => HttpClientResponse.schemaBodyJson(DeleteMessageResponse)(r),
2206
+ orElse: response => unexpectedStatus(request, response)
2207
+ }))), Effect.scoped),
2208
+ "createThreadAndRun": options => HttpClientRequest.make("POST")(`/threads/runs`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2209
+ "200": r => HttpClientResponse.schemaBodyJson(RunObject)(r),
2210
+ orElse: response => unexpectedStatus(request, response)
2211
+ }))), Effect.scoped),
2212
+ "listRuns": (threadId, options) => HttpClientRequest.make("GET")(`/threads/${threadId}/runs`).pipe(HttpClientRequest.setUrlParams({
2213
+ "limit": options["limit"],
2214
+ "order": options["order"],
2215
+ "after": options["after"],
2216
+ "before": options["before"]
2217
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2218
+ "200": r => HttpClientResponse.schemaBodyJson(ListRunsResponse)(r),
2219
+ orElse: response => unexpectedStatus(request, response)
2220
+ }))), Effect.scoped),
2221
+ "createRun": (threadId, options) => HttpClientRequest.make("POST")(`/threads/${threadId}/runs`).pipe(HttpClientRequest.setUrlParams({
2222
+ "include[]": options.params["include[]"]
2223
+ }), req => Effect.orDie(HttpClientRequest.bodyJson(req, options.payload)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2224
+ "200": r => HttpClientResponse.schemaBodyJson(RunObject)(r),
2225
+ orElse: response => unexpectedStatus(request, response)
2226
+ }))), Effect.scoped),
2227
+ "getRun": (threadId, runId) => HttpClientRequest.make("GET")(`/threads/${threadId}/runs/${runId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2228
+ "200": r => HttpClientResponse.schemaBodyJson(RunObject)(r),
2229
+ orElse: response => unexpectedStatus(request, response)
2230
+ }))), Effect.scoped),
2231
+ "modifyRun": (threadId, runId, options) => HttpClientRequest.make("POST")(`/threads/${threadId}/runs/${runId}`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2232
+ "200": r => HttpClientResponse.schemaBodyJson(RunObject)(r),
2233
+ orElse: response => unexpectedStatus(request, response)
2234
+ }))), Effect.scoped),
2235
+ "submitToolOuputsToRun": (threadId, runId, options) => HttpClientRequest.make("POST")(`/threads/${threadId}/runs/${runId}/submit_tool_outputs`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2236
+ "200": r => HttpClientResponse.schemaBodyJson(RunObject)(r),
2237
+ orElse: response => unexpectedStatus(request, response)
2238
+ }))), Effect.scoped),
2239
+ "cancelRun": (threadId, runId) => HttpClientRequest.make("POST")(`/threads/${threadId}/runs/${runId}/cancel`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2240
+ "200": r => HttpClientResponse.schemaBodyJson(RunObject)(r),
2241
+ orElse: response => unexpectedStatus(request, response)
2242
+ }))), Effect.scoped),
2243
+ "listRunSteps": (threadId, runId, options) => HttpClientRequest.make("GET")(`/threads/${threadId}/runs/${runId}/steps`).pipe(HttpClientRequest.setUrlParams({
2244
+ "limit": options["limit"],
2245
+ "order": options["order"],
2246
+ "after": options["after"],
2247
+ "before": options["before"],
2248
+ "include[]": options["include[]"]
2249
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2250
+ "200": r => HttpClientResponse.schemaBodyJson(ListRunStepsResponse)(r),
2251
+ orElse: response => unexpectedStatus(request, response)
2252
+ }))), Effect.scoped),
2253
+ "getRunStep": (threadId, runId, stepId, options) => HttpClientRequest.make("GET")(`/threads/${threadId}/runs/${runId}/steps/${stepId}`).pipe(HttpClientRequest.setUrlParams({
2254
+ "include[]": options["include[]"]
2255
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2256
+ "200": r => HttpClientResponse.schemaBodyJson(RunStepObject)(r),
2257
+ orElse: response => unexpectedStatus(request, response)
2258
+ }))), Effect.scoped),
2259
+ "listVectorStores": options => HttpClientRequest.make("GET")(`/vector_stores`).pipe(HttpClientRequest.setUrlParams({
2260
+ "limit": options["limit"],
2261
+ "order": options["order"],
2262
+ "after": options["after"],
2263
+ "before": options["before"]
2264
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2265
+ "200": r => HttpClientResponse.schemaBodyJson(ListVectorStoresResponse)(r),
2266
+ orElse: response => unexpectedStatus(request, response)
2267
+ }))), Effect.scoped),
2268
+ "createVectorStore": options => HttpClientRequest.make("POST")(`/vector_stores`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2269
+ "200": r => HttpClientResponse.schemaBodyJson(VectorStoreObject)(r),
2270
+ orElse: response => unexpectedStatus(request, response)
2271
+ }))), Effect.scoped),
2272
+ "getVectorStore": vectorStoreId => HttpClientRequest.make("GET")(`/vector_stores/${vectorStoreId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2273
+ "200": r => HttpClientResponse.schemaBodyJson(VectorStoreObject)(r),
2274
+ orElse: response => unexpectedStatus(request, response)
2275
+ }))), Effect.scoped),
2276
+ "modifyVectorStore": (vectorStoreId, options) => HttpClientRequest.make("POST")(`/vector_stores/${vectorStoreId}`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2277
+ "200": r => HttpClientResponse.schemaBodyJson(VectorStoreObject)(r),
2278
+ orElse: response => unexpectedStatus(request, response)
2279
+ }))), Effect.scoped),
2280
+ "deleteVectorStore": vectorStoreId => HttpClientRequest.make("DELETE")(`/vector_stores/${vectorStoreId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2281
+ "200": r => HttpClientResponse.schemaBodyJson(DeleteVectorStoreResponse)(r),
2282
+ orElse: response => unexpectedStatus(request, response)
2283
+ }))), Effect.scoped),
2284
+ "listVectorStoreFiles": (vectorStoreId, options) => HttpClientRequest.make("GET")(`/vector_stores/${vectorStoreId}/files`).pipe(HttpClientRequest.setUrlParams({
2285
+ "limit": options["limit"],
2286
+ "order": options["order"],
2287
+ "after": options["after"],
2288
+ "before": options["before"],
2289
+ "filter": options["filter"]
2290
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2291
+ "200": r => HttpClientResponse.schemaBodyJson(ListVectorStoreFilesResponse)(r),
2292
+ orElse: response => unexpectedStatus(request, response)
2293
+ }))), Effect.scoped),
2294
+ "createVectorStoreFile": (vectorStoreId, options) => HttpClientRequest.make("POST")(`/vector_stores/${vectorStoreId}/files`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2295
+ "200": r => HttpClientResponse.schemaBodyJson(VectorStoreFileObject)(r),
2296
+ orElse: response => unexpectedStatus(request, response)
2297
+ }))), Effect.scoped),
2298
+ "getVectorStoreFile": (vectorStoreId, fileId) => HttpClientRequest.make("GET")(`/vector_stores/${vectorStoreId}/files/${fileId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2299
+ "200": r => HttpClientResponse.schemaBodyJson(VectorStoreFileObject)(r),
2300
+ orElse: response => unexpectedStatus(request, response)
2301
+ }))), Effect.scoped),
2302
+ "deleteVectorStoreFile": (vectorStoreId, fileId) => HttpClientRequest.make("DELETE")(`/vector_stores/${vectorStoreId}/files/${fileId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2303
+ "200": r => HttpClientResponse.schemaBodyJson(DeleteVectorStoreFileResponse)(r),
2304
+ orElse: response => unexpectedStatus(request, response)
2305
+ }))), Effect.scoped),
2306
+ "createVectorStoreFileBatch": (vectorStoreId, options) => HttpClientRequest.make("POST")(`/vector_stores/${vectorStoreId}/file_batches`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2307
+ "200": r => HttpClientResponse.schemaBodyJson(VectorStoreFileBatchObject)(r),
2308
+ orElse: response => unexpectedStatus(request, response)
2309
+ }))), Effect.scoped),
2310
+ "getVectorStoreFileBatch": (vectorStoreId, batchId) => HttpClientRequest.make("GET")(`/vector_stores/${vectorStoreId}/file_batches/${batchId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2311
+ "200": r => HttpClientResponse.schemaBodyJson(VectorStoreFileBatchObject)(r),
2312
+ orElse: response => unexpectedStatus(request, response)
2313
+ }))), Effect.scoped),
2314
+ "cancelVectorStoreFileBatch": (vectorStoreId, batchId) => HttpClientRequest.make("POST")(`/vector_stores/${vectorStoreId}/file_batches/${batchId}/cancel`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2315
+ "200": r => HttpClientResponse.schemaBodyJson(VectorStoreFileBatchObject)(r),
2316
+ orElse: response => unexpectedStatus(request, response)
2317
+ }))), Effect.scoped),
2318
+ "listFilesInVectorStoreBatch": (vectorStoreId, batchId, options) => HttpClientRequest.make("GET")(`/vector_stores/${vectorStoreId}/file_batches/${batchId}/files`).pipe(HttpClientRequest.setUrlParams({
2319
+ "limit": options["limit"],
2320
+ "order": options["order"],
2321
+ "after": options["after"],
2322
+ "before": options["before"],
2323
+ "filter": options["filter"]
2324
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2325
+ "200": r => HttpClientResponse.schemaBodyJson(ListVectorStoreFilesResponse)(r),
2326
+ orElse: response => unexpectedStatus(request, response)
2327
+ }))), Effect.scoped),
2328
+ "listBatches": options => HttpClientRequest.make("GET")(`/batches`).pipe(HttpClientRequest.setUrlParams({
2329
+ "after": options["after"],
2330
+ "limit": options["limit"]
2331
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2332
+ "200": r => HttpClientResponse.schemaBodyJson(ListBatchesResponse)(r),
2333
+ orElse: response => unexpectedStatus(request, response)
2334
+ }))), Effect.scoped),
2335
+ "createBatch": options => HttpClientRequest.make("POST")(`/batches`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2336
+ "200": r => HttpClientResponse.schemaBodyJson(Batch)(r),
2337
+ orElse: response => unexpectedStatus(request, response)
2338
+ }))), Effect.scoped),
2339
+ "retrieveBatch": batchId => HttpClientRequest.make("GET")(`/batches/${batchId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2340
+ "200": r => HttpClientResponse.schemaBodyJson(Batch)(r),
2341
+ orElse: response => unexpectedStatus(request, response)
2342
+ }))), Effect.scoped),
2343
+ "cancelBatch": batchId => HttpClientRequest.make("POST")(`/batches/${batchId}/cancel`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2344
+ "200": r => HttpClientResponse.schemaBodyJson(Batch)(r),
2345
+ orElse: response => unexpectedStatus(request, response)
2346
+ }))), Effect.scoped),
2347
+ "listAuditLogs": options => HttpClientRequest.make("GET")(`/organization/audit_logs`).pipe(HttpClientRequest.setUrlParams({
2348
+ "effective_at[gt]": options["effective_at[gt]"],
2349
+ "effective_at[gte]": options["effective_at[gte]"],
2350
+ "effective_at[lt]": options["effective_at[lt]"],
2351
+ "effective_at[lte]": options["effective_at[lte]"],
2352
+ "project_ids[]": options["project_ids[]"],
2353
+ "event_types[]": options["event_types[]"],
2354
+ "actor_ids[]": options["actor_ids[]"],
2355
+ "actor_emails[]": options["actor_emails[]"],
2356
+ "resource_ids[]": options["resource_ids[]"],
2357
+ "limit": options["limit"],
2358
+ "after": options["after"],
2359
+ "before": options["before"]
2360
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2361
+ "200": r => HttpClientResponse.schemaBodyJson(ListAuditLogsResponse)(r),
2362
+ orElse: response => unexpectedStatus(request, response)
2363
+ }))), Effect.scoped),
2364
+ "listInvites": options => HttpClientRequest.make("GET")(`/organization/invites`).pipe(HttpClientRequest.setUrlParams({
2365
+ "limit": options["limit"],
2366
+ "after": options["after"]
2367
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2368
+ "200": r => HttpClientResponse.schemaBodyJson(InviteListResponse)(r),
2369
+ orElse: response => unexpectedStatus(request, response)
2370
+ }))), Effect.scoped),
2371
+ "inviteUser": options => HttpClientRequest.make("POST")(`/organization/invites`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2372
+ "200": r => HttpClientResponse.schemaBodyJson(Invite)(r),
2373
+ orElse: response => unexpectedStatus(request, response)
2374
+ }))), Effect.scoped),
2375
+ "retrieveInvite": inviteId => HttpClientRequest.make("GET")(`/organization/invites/${inviteId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2376
+ "200": r => HttpClientResponse.schemaBodyJson(Invite)(r),
2377
+ orElse: response => unexpectedStatus(request, response)
2378
+ }))), Effect.scoped),
2379
+ "deleteInvite": inviteId => HttpClientRequest.make("DELETE")(`/organization/invites/${inviteId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2380
+ "200": r => HttpClientResponse.schemaBodyJson(InviteDeleteResponse)(r),
2381
+ orElse: response => unexpectedStatus(request, response)
2382
+ }))), Effect.scoped),
2383
+ "listUsers": options => HttpClientRequest.make("GET")(`/organization/users`).pipe(HttpClientRequest.setUrlParams({
2384
+ "limit": options["limit"],
2385
+ "after": options["after"]
2386
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2387
+ "200": r => HttpClientResponse.schemaBodyJson(UserListResponse)(r),
2388
+ orElse: response => unexpectedStatus(request, response)
2389
+ }))), Effect.scoped),
2390
+ "retrieveUser": userId => HttpClientRequest.make("GET")(`/organization/users/${userId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2391
+ "200": r => HttpClientResponse.schemaBodyJson(User)(r),
2392
+ orElse: response => unexpectedStatus(request, response)
2393
+ }))), Effect.scoped),
2394
+ "modifyUser": (userId, options) => HttpClientRequest.make("POST")(`/organization/users/${userId}`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2395
+ "200": r => HttpClientResponse.schemaBodyJson(User)(r),
2396
+ orElse: response => unexpectedStatus(request, response)
2397
+ }))), Effect.scoped),
2398
+ "deleteUser": userId => HttpClientRequest.make("DELETE")(`/organization/users/${userId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2399
+ "200": r => HttpClientResponse.schemaBodyJson(UserDeleteResponse)(r),
2400
+ orElse: response => unexpectedStatus(request, response)
2401
+ }))), Effect.scoped),
2402
+ "listProjects": options => HttpClientRequest.make("GET")(`/organization/projects`).pipe(HttpClientRequest.setUrlParams({
2403
+ "limit": options["limit"],
2404
+ "after": options["after"],
2405
+ "include_archived": options["include_archived"]
2406
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2407
+ "200": r => HttpClientResponse.schemaBodyJson(ProjectListResponse)(r),
2408
+ orElse: response => unexpectedStatus(request, response)
2409
+ }))), Effect.scoped),
2410
+ "createProject": options => HttpClientRequest.make("POST")(`/organization/projects`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2411
+ "200": r => HttpClientResponse.schemaBodyJson(Project)(r),
2412
+ orElse: response => unexpectedStatus(request, response)
2413
+ }))), Effect.scoped),
2414
+ "retrieveProject": projectId => HttpClientRequest.make("GET")(`/organization/projects/${projectId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2415
+ "200": r => HttpClientResponse.schemaBodyJson(Project)(r),
2416
+ orElse: response => unexpectedStatus(request, response)
2417
+ }))), Effect.scoped),
2418
+ "modifyProject": (projectId, options) => HttpClientRequest.make("POST")(`/organization/projects/${projectId}`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2419
+ "200": r => HttpClientResponse.schemaBodyJson(Project)(r),
2420
+ "400": r => decodeError(r, ErrorResponse),
2421
+ orElse: response => unexpectedStatus(request, response)
2422
+ }))), Effect.scoped),
2423
+ "archiveProject": projectId => HttpClientRequest.make("POST")(`/organization/projects/${projectId}/archive`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2424
+ "200": r => HttpClientResponse.schemaBodyJson(Project)(r),
2425
+ orElse: response => unexpectedStatus(request, response)
2426
+ }))), Effect.scoped),
2427
+ "listProjectUsers": (projectId, options) => HttpClientRequest.make("GET")(`/organization/projects/${projectId}/users`).pipe(HttpClientRequest.setUrlParams({
2428
+ "limit": options["limit"],
2429
+ "after": options["after"]
2430
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2431
+ "200": r => HttpClientResponse.schemaBodyJson(ProjectUserListResponse)(r),
2432
+ "400": r => decodeError(r, ErrorResponse),
2433
+ orElse: response => unexpectedStatus(request, response)
2434
+ }))), Effect.scoped),
2435
+ "createProjectUser": (projectId, options) => HttpClientRequest.make("POST")(`/organization/projects/${projectId}/users`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2436
+ "200": r => HttpClientResponse.schemaBodyJson(ProjectUser)(r),
2437
+ "400": r => decodeError(r, ErrorResponse),
2438
+ orElse: response => unexpectedStatus(request, response)
2439
+ }))), Effect.scoped),
2440
+ "retrieveProjectUser": (projectId, userId) => HttpClientRequest.make("GET")(`/organization/projects/${projectId}/users/${userId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2441
+ "200": r => HttpClientResponse.schemaBodyJson(ProjectUser)(r),
2442
+ orElse: response => unexpectedStatus(request, response)
2443
+ }))), Effect.scoped),
2444
+ "modifyProjectUser": (projectId, userId, options) => HttpClientRequest.make("POST")(`/organization/projects/${projectId}/users/${userId}`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2445
+ "200": r => HttpClientResponse.schemaBodyJson(ProjectUser)(r),
2446
+ "400": r => decodeError(r, ErrorResponse),
2447
+ orElse: response => unexpectedStatus(request, response)
2448
+ }))), Effect.scoped),
2449
+ "deleteProjectUser": (projectId, userId) => HttpClientRequest.make("DELETE")(`/organization/projects/${projectId}/users/${userId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2450
+ "200": r => HttpClientResponse.schemaBodyJson(ProjectUserDeleteResponse)(r),
2451
+ "400": r => decodeError(r, ErrorResponse),
2452
+ orElse: response => unexpectedStatus(request, response)
2453
+ }))), Effect.scoped),
2454
+ "listProjectServiceAccounts": (projectId, options) => HttpClientRequest.make("GET")(`/organization/projects/${projectId}/service_accounts`).pipe(HttpClientRequest.setUrlParams({
2455
+ "limit": options["limit"],
2456
+ "after": options["after"]
2457
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2458
+ "200": r => HttpClientResponse.schemaBodyJson(ProjectServiceAccountListResponse)(r),
2459
+ "400": r => decodeError(r, ErrorResponse),
2460
+ orElse: response => unexpectedStatus(request, response)
2461
+ }))), Effect.scoped),
2462
+ "createProjectServiceAccount": (projectId, options) => HttpClientRequest.make("POST")(`/organization/projects/${projectId}/service_accounts`).pipe(req => Effect.orDie(HttpClientRequest.bodyJson(req, options)), Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2463
+ "200": r => HttpClientResponse.schemaBodyJson(ProjectServiceAccountCreateResponse)(r),
2464
+ "400": r => decodeError(r, ErrorResponse),
2465
+ orElse: response => unexpectedStatus(request, response)
2466
+ }))), Effect.scoped),
2467
+ "retrieveProjectServiceAccount": (projectId, serviceAccountId) => HttpClientRequest.make("GET")(`/organization/projects/${projectId}/service_accounts/${serviceAccountId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2468
+ "200": r => HttpClientResponse.schemaBodyJson(ProjectServiceAccount)(r),
2469
+ orElse: response => unexpectedStatus(request, response)
2470
+ }))), Effect.scoped),
2471
+ "deleteProjectServiceAccount": (projectId, serviceAccountId) => HttpClientRequest.make("DELETE")(`/organization/projects/${projectId}/service_accounts/${serviceAccountId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2472
+ "200": r => HttpClientResponse.schemaBodyJson(ProjectServiceAccountDeleteResponse)(r),
2473
+ orElse: response => unexpectedStatus(request, response)
2474
+ }))), Effect.scoped),
2475
+ "listProjectApiKeys": (projectId, options) => HttpClientRequest.make("GET")(`/organization/projects/${projectId}/api_keys`).pipe(HttpClientRequest.setUrlParams({
2476
+ "limit": options["limit"],
2477
+ "after": options["after"]
2478
+ }), Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2479
+ "200": r => HttpClientResponse.schemaBodyJson(ProjectApiKeyListResponse)(r),
2480
+ orElse: response => unexpectedStatus(request, response)
2481
+ }))), Effect.scoped),
2482
+ "retrieveProjectApiKey": (projectId, keyId) => HttpClientRequest.make("GET")(`/organization/projects/${projectId}/api_keys/${keyId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2483
+ "200": r => HttpClientResponse.schemaBodyJson(ProjectApiKey)(r),
2484
+ orElse: response => unexpectedStatus(request, response)
2485
+ }))), Effect.scoped),
2486
+ "deleteProjectApiKey": (projectId, keyId) => HttpClientRequest.make("DELETE")(`/organization/projects/${projectId}/api_keys/${keyId}`).pipe(Effect.succeed, Effect.flatMap(request => Effect.flatMap(httpClient.execute(request), HttpClientResponse.matchStatus({
2487
+ "200": r => HttpClientResponse.schemaBodyJson(ProjectApiKeyDeleteResponse)(r),
2488
+ "400": r => decodeError(r, ErrorResponse),
2489
+ orElse: response => unexpectedStatus(request, response)
2490
+ }))), Effect.scoped)
2491
+ };
2492
+ };
2493
+ //# sourceMappingURL=Generated.js.map