@effect/ai-openai 0.2.9 → 0.2.11

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