openai 4.28.4 → 4.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/README.md +7 -10
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/lib/AbstractAssistantStreamRunner.d.ts +74 -0
- package/lib/AbstractAssistantStreamRunner.d.ts.map +1 -0
- package/lib/AbstractAssistantStreamRunner.js +246 -0
- package/lib/AbstractAssistantStreamRunner.js.map +1 -0
- package/lib/AbstractAssistantStreamRunner.mjs +242 -0
- package/lib/AbstractAssistantStreamRunner.mjs.map +1 -0
- package/lib/AssistantStream.d.ts +56 -0
- package/lib/AssistantStream.d.ts.map +1 -0
- package/lib/AssistantStream.js +526 -0
- package/lib/AssistantStream.js.map +1 -0
- package/lib/AssistantStream.mjs +499 -0
- package/lib/AssistantStream.mjs.map +1 -0
- package/lib/ChatCompletionRunFunctions.test.js +35 -0
- package/lib/ChatCompletionRunFunctions.test.js.map +1 -1
- package/lib/ChatCompletionRunFunctions.test.mjs +35 -0
- package/lib/ChatCompletionRunFunctions.test.mjs.map +1 -1
- package/lib/ChatCompletionStream.d.ts.map +1 -1
- package/lib/ChatCompletionStream.js +21 -3
- package/lib/ChatCompletionStream.js.map +1 -1
- package/lib/ChatCompletionStream.mjs +21 -3
- package/lib/ChatCompletionStream.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/audio/speech.d.ts +3 -6
- package/resources/audio/speech.d.ts.map +1 -1
- package/resources/audio/speech.js.map +1 -1
- package/resources/audio/speech.mjs.map +1 -1
- package/resources/audio/transcriptions.d.ts +14 -4
- package/resources/audio/transcriptions.d.ts.map +1 -1
- package/resources/audio/transcriptions.js.map +1 -1
- package/resources/audio/transcriptions.mjs.map +1 -1
- package/resources/audio/translations.d.ts +2 -1
- package/resources/audio/translations.d.ts.map +1 -1
- package/resources/audio/translations.js.map +1 -1
- package/resources/audio/translations.mjs.map +1 -1
- package/resources/beta/assistants/assistants.d.ts +629 -60
- package/resources/beta/assistants/assistants.d.ts.map +1 -1
- package/resources/beta/assistants/assistants.js.map +1 -1
- package/resources/beta/assistants/assistants.mjs.map +1 -1
- package/resources/beta/assistants/index.d.ts +1 -1
- package/resources/beta/assistants/index.d.ts.map +1 -1
- package/resources/beta/assistants/index.js.map +1 -1
- package/resources/beta/assistants/index.mjs.map +1 -1
- package/resources/beta/beta.d.ts +12 -0
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.ts +2 -2
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/threads/index.d.ts +3 -3
- package/resources/beta/threads/index.d.ts.map +1 -1
- package/resources/beta/threads/index.js +2 -2
- package/resources/beta/threads/index.js.map +1 -1
- package/resources/beta/threads/index.mjs +1 -1
- package/resources/beta/threads/index.mjs.map +1 -1
- package/resources/beta/threads/messages/index.d.ts +1 -1
- package/resources/beta/threads/messages/index.d.ts.map +1 -1
- package/resources/beta/threads/messages/index.js +2 -2
- package/resources/beta/threads/messages/index.js.map +1 -1
- package/resources/beta/threads/messages/index.mjs +1 -1
- package/resources/beta/threads/messages/index.mjs.map +1 -1
- package/resources/beta/threads/messages/messages.d.ts +289 -86
- package/resources/beta/threads/messages/messages.d.ts.map +1 -1
- package/resources/beta/threads/messages/messages.js +5 -5
- package/resources/beta/threads/messages/messages.js.map +1 -1
- package/resources/beta/threads/messages/messages.mjs +3 -3
- package/resources/beta/threads/messages/messages.mjs.map +1 -1
- package/resources/beta/threads/runs/index.d.ts +2 -2
- package/resources/beta/threads/runs/index.d.ts.map +1 -1
- package/resources/beta/threads/runs/index.js.map +1 -1
- package/resources/beta/threads/runs/index.mjs.map +1 -1
- package/resources/beta/threads/runs/runs.d.ts +153 -49
- package/resources/beta/threads/runs/runs.d.ts.map +1 -1
- package/resources/beta/threads/runs/runs.js +14 -7
- package/resources/beta/threads/runs/runs.js.map +1 -1
- package/resources/beta/threads/runs/runs.mjs +14 -7
- package/resources/beta/threads/runs/runs.mjs.map +1 -1
- package/resources/beta/threads/runs/steps.d.ts +219 -5
- package/resources/beta/threads/runs/steps.d.ts.map +1 -1
- package/resources/beta/threads/runs/steps.js.map +1 -1
- package/resources/beta/threads/runs/steps.mjs.map +1 -1
- package/resources/beta/threads/threads.d.ts +144 -22
- package/resources/beta/threads/threads.d.ts.map +1 -1
- package/resources/beta/threads/threads.js +9 -4
- package/resources/beta/threads/threads.js.map +1 -1
- package/resources/beta/threads/threads.mjs +9 -4
- package/resources/beta/threads/threads.mjs.map +1 -1
- package/resources/chat/completions.d.ts +28 -18
- package/resources/chat/completions.d.ts.map +1 -1
- package/resources/chat/completions.js.map +1 -1
- package/resources/chat/completions.mjs.map +1 -1
- package/resources/completions.d.ts +2 -0
- package/resources/completions.d.ts.map +1 -1
- package/resources/completions.js.map +1 -1
- package/resources/completions.mjs.map +1 -1
- package/resources/files.d.ts +4 -4
- package/resources/images.d.ts +6 -3
- package/resources/images.d.ts.map +1 -1
- package/resources/images.js.map +1 -1
- package/resources/images.mjs.map +1 -1
- package/resources/moderations.d.ts +3 -5
- package/resources/moderations.d.ts.map +1 -1
- package/resources/moderations.js +1 -1
- package/resources/moderations.js.map +1 -1
- package/resources/moderations.mjs +1 -1
- package/resources/moderations.mjs.map +1 -1
- package/resources/shared.d.ts +6 -0
- package/resources/shared.d.ts.map +1 -1
- package/src/index.ts +1 -0
- package/src/lib/AbstractAssistantStreamRunner.ts +340 -0
- package/src/lib/AssistantStream.ts +698 -0
- package/src/lib/ChatCompletionRunFunctions.test.ts +52 -1
- package/src/lib/ChatCompletionStream.ts +29 -6
- package/src/resources/audio/speech.ts +3 -6
- package/src/resources/audio/transcriptions.ts +14 -4
- package/src/resources/audio/translations.ts +2 -1
- package/src/resources/beta/assistants/assistants.ts +768 -76
- package/src/resources/beta/assistants/index.ts +9 -0
- package/src/resources/beta/beta.ts +12 -0
- package/src/resources/beta/index.ts +12 -0
- package/src/resources/beta/threads/index.ts +30 -5
- package/src/resources/beta/threads/messages/index.ts +21 -5
- package/src/resources/beta/threads/messages/messages.ts +332 -94
- package/src/resources/beta/threads/runs/index.ts +18 -1
- package/src/resources/beta/threads/runs/runs.ts +225 -60
- package/src/resources/beta/threads/runs/steps.ts +254 -5
- package/src/resources/beta/threads/threads.ts +182 -25
- package/src/resources/chat/completions.ts +28 -18
- package/src/resources/completions.ts +2 -0
- package/src/resources/files.ts +4 -4
- package/src/resources/images.ts +6 -3
- package/src/resources/moderations.ts +3 -5
- package/src/resources/shared.ts +10 -0
- package/src/streaming.ts +31 -0
- package/src/version.ts +1 -1
- package/streaming.d.ts +2 -0
- package/streaming.d.ts.map +1 -1
- package/streaming.js +32 -1
- package/streaming.js.map +1 -1
- package/streaming.mjs +30 -0
- package/streaming.mjs.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -6,6 +6,10 @@ import { isRequestOptions } from "../../../core";
|
|
|
6
6
|
import * as AssistantsAPI from "./assistants";
|
|
7
7
|
import * as Shared from "../../shared";
|
|
8
8
|
import * as FilesAPI from "./files";
|
|
9
|
+
import * as ThreadsAPI from "../threads/threads";
|
|
10
|
+
import * as MessagesAPI from "../threads/messages/messages";
|
|
11
|
+
import * as RunsAPI from "../threads/runs/runs";
|
|
12
|
+
import * as StepsAPI from "../threads/runs/steps";
|
|
9
13
|
import { CursorPage, type CursorPageParams } from "../../../pagination";
|
|
10
14
|
|
|
11
15
|
export class Assistants extends APIResource {
|
|
@@ -145,40 +149,777 @@ export interface Assistant {
|
|
|
145
149
|
* A list of tool enabled on the assistant. There can be a maximum of 128 tools per
|
|
146
150
|
* assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`.
|
|
147
151
|
*/
|
|
148
|
-
tools: Array<
|
|
152
|
+
tools: Array<AssistantTool>;
|
|
149
153
|
}
|
|
150
154
|
|
|
151
|
-
export
|
|
152
|
-
|
|
155
|
+
export interface AssistantDeleted {
|
|
156
|
+
id: string;
|
|
157
|
+
|
|
158
|
+
deleted: boolean;
|
|
159
|
+
|
|
160
|
+
object: 'assistant.deleted';
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Represents an event emitted when streaming a Run.
|
|
165
|
+
*
|
|
166
|
+
* Each event in a server-sent events stream has an `event` and `data` property:
|
|
167
|
+
*
|
|
168
|
+
* ```
|
|
169
|
+
* event: thread.created
|
|
170
|
+
* data: {"id": "thread_123", "object": "thread", ...}
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* We emit events whenever a new object is created, transitions to a new state, or
|
|
174
|
+
* is being streamed in parts (deltas). For example, we emit `thread.run.created`
|
|
175
|
+
* when a new run is created, `thread.run.completed` when a run completes, and so
|
|
176
|
+
* on. When an Assistant chooses to create a message during a run, we emit a
|
|
177
|
+
* `thread.message.created event`, a `thread.message.in_progress` event, many
|
|
178
|
+
* `thread.message.delta` events, and finally a `thread.message.completed` event.
|
|
179
|
+
*
|
|
180
|
+
* We may add additional events over time, so we recommend handling unknown events
|
|
181
|
+
* gracefully in your code. See the
|
|
182
|
+
* [Assistants API quickstart](https://platform.openai.com/docs/assistants/overview)
|
|
183
|
+
* to learn how to integrate the Assistants API with streaming.
|
|
184
|
+
*/
|
|
185
|
+
export type AssistantStreamEvent =
|
|
186
|
+
| AssistantStreamEvent.ThreadCreated
|
|
187
|
+
| AssistantStreamEvent.ThreadRunCreated
|
|
188
|
+
| AssistantStreamEvent.ThreadRunQueued
|
|
189
|
+
| AssistantStreamEvent.ThreadRunInProgress
|
|
190
|
+
| AssistantStreamEvent.ThreadRunRequiresAction
|
|
191
|
+
| AssistantStreamEvent.ThreadRunCompleted
|
|
192
|
+
| AssistantStreamEvent.ThreadRunFailed
|
|
193
|
+
| AssistantStreamEvent.ThreadRunCancelling
|
|
194
|
+
| AssistantStreamEvent.ThreadRunCancelled
|
|
195
|
+
| AssistantStreamEvent.ThreadRunExpired
|
|
196
|
+
| AssistantStreamEvent.ThreadRunStepCreated
|
|
197
|
+
| AssistantStreamEvent.ThreadRunStepInProgress
|
|
198
|
+
| AssistantStreamEvent.ThreadRunStepDelta
|
|
199
|
+
| AssistantStreamEvent.ThreadRunStepCompleted
|
|
200
|
+
| AssistantStreamEvent.ThreadRunStepFailed
|
|
201
|
+
| AssistantStreamEvent.ThreadRunStepCancelled
|
|
202
|
+
| AssistantStreamEvent.ThreadRunStepExpired
|
|
203
|
+
| AssistantStreamEvent.ThreadMessageCreated
|
|
204
|
+
| AssistantStreamEvent.ThreadMessageInProgress
|
|
205
|
+
| AssistantStreamEvent.ThreadMessageDelta
|
|
206
|
+
| AssistantStreamEvent.ThreadMessageCompleted
|
|
207
|
+
| AssistantStreamEvent.ThreadMessageIncomplete
|
|
208
|
+
| AssistantStreamEvent.ErrorEvent;
|
|
209
|
+
|
|
210
|
+
export namespace AssistantStreamEvent {
|
|
211
|
+
/**
|
|
212
|
+
* Occurs when a new
|
|
213
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads/object) is
|
|
214
|
+
* created.
|
|
215
|
+
*/
|
|
216
|
+
export interface ThreadCreated {
|
|
217
|
+
/**
|
|
218
|
+
* Represents a thread that contains
|
|
219
|
+
* [messages](https://platform.openai.com/docs/api-reference/messages).
|
|
220
|
+
*/
|
|
221
|
+
data: ThreadsAPI.Thread;
|
|
222
|
+
|
|
223
|
+
event: 'thread.created';
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Occurs when a new
|
|
228
|
+
* [run](https://platform.openai.com/docs/api-reference/runs/object) is created.
|
|
229
|
+
*/
|
|
230
|
+
export interface ThreadRunCreated {
|
|
231
|
+
/**
|
|
232
|
+
* Represents an execution run on a
|
|
233
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
234
|
+
*/
|
|
235
|
+
data: RunsAPI.Run;
|
|
236
|
+
|
|
237
|
+
event: 'thread.run.created';
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
242
|
+
* moves to a `queued` status.
|
|
243
|
+
*/
|
|
244
|
+
export interface ThreadRunQueued {
|
|
245
|
+
/**
|
|
246
|
+
* Represents an execution run on a
|
|
247
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
248
|
+
*/
|
|
249
|
+
data: RunsAPI.Run;
|
|
250
|
+
|
|
251
|
+
event: 'thread.run.queued';
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
256
|
+
* moves to an `in_progress` status.
|
|
257
|
+
*/
|
|
258
|
+
export interface ThreadRunInProgress {
|
|
259
|
+
/**
|
|
260
|
+
* Represents an execution run on a
|
|
261
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
262
|
+
*/
|
|
263
|
+
data: RunsAPI.Run;
|
|
264
|
+
|
|
265
|
+
event: 'thread.run.in_progress';
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
270
|
+
* moves to a `requires_action` status.
|
|
271
|
+
*/
|
|
272
|
+
export interface ThreadRunRequiresAction {
|
|
273
|
+
/**
|
|
274
|
+
* Represents an execution run on a
|
|
275
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
276
|
+
*/
|
|
277
|
+
data: RunsAPI.Run;
|
|
278
|
+
|
|
279
|
+
event: 'thread.run.requires_action';
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
284
|
+
* is completed.
|
|
285
|
+
*/
|
|
286
|
+
export interface ThreadRunCompleted {
|
|
287
|
+
/**
|
|
288
|
+
* Represents an execution run on a
|
|
289
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
290
|
+
*/
|
|
291
|
+
data: RunsAPI.Run;
|
|
292
|
+
|
|
293
|
+
event: 'thread.run.completed';
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
298
|
+
* fails.
|
|
299
|
+
*/
|
|
300
|
+
export interface ThreadRunFailed {
|
|
301
|
+
/**
|
|
302
|
+
* Represents an execution run on a
|
|
303
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
304
|
+
*/
|
|
305
|
+
data: RunsAPI.Run;
|
|
306
|
+
|
|
307
|
+
event: 'thread.run.failed';
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
312
|
+
* moves to a `cancelling` status.
|
|
313
|
+
*/
|
|
314
|
+
export interface ThreadRunCancelling {
|
|
315
|
+
/**
|
|
316
|
+
* Represents an execution run on a
|
|
317
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
318
|
+
*/
|
|
319
|
+
data: RunsAPI.Run;
|
|
320
|
+
|
|
321
|
+
event: 'thread.run.cancelling';
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
326
|
+
* is cancelled.
|
|
327
|
+
*/
|
|
328
|
+
export interface ThreadRunCancelled {
|
|
153
329
|
/**
|
|
154
|
-
*
|
|
330
|
+
* Represents an execution run on a
|
|
331
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
155
332
|
*/
|
|
156
|
-
|
|
333
|
+
data: RunsAPI.Run;
|
|
334
|
+
|
|
335
|
+
event: 'thread.run.cancelled';
|
|
157
336
|
}
|
|
158
337
|
|
|
159
|
-
|
|
338
|
+
/**
|
|
339
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
340
|
+
* expires.
|
|
341
|
+
*/
|
|
342
|
+
export interface ThreadRunExpired {
|
|
160
343
|
/**
|
|
161
|
-
*
|
|
344
|
+
* Represents an execution run on a
|
|
345
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
162
346
|
*/
|
|
163
|
-
|
|
347
|
+
data: RunsAPI.Run;
|
|
348
|
+
|
|
349
|
+
event: 'thread.run.expired';
|
|
164
350
|
}
|
|
165
351
|
|
|
166
|
-
|
|
167
|
-
|
|
352
|
+
/**
|
|
353
|
+
* Occurs when a
|
|
354
|
+
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object) is
|
|
355
|
+
* created.
|
|
356
|
+
*/
|
|
357
|
+
export interface ThreadRunStepCreated {
|
|
358
|
+
/**
|
|
359
|
+
* Represents a step in execution of a run.
|
|
360
|
+
*/
|
|
361
|
+
data: StepsAPI.RunStep;
|
|
362
|
+
|
|
363
|
+
event: 'thread.run.step.created';
|
|
364
|
+
}
|
|
168
365
|
|
|
366
|
+
/**
|
|
367
|
+
* Occurs when a
|
|
368
|
+
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object)
|
|
369
|
+
* moves to an `in_progress` state.
|
|
370
|
+
*/
|
|
371
|
+
export interface ThreadRunStepInProgress {
|
|
169
372
|
/**
|
|
170
|
-
*
|
|
373
|
+
* Represents a step in execution of a run.
|
|
171
374
|
*/
|
|
172
|
-
|
|
375
|
+
data: StepsAPI.RunStep;
|
|
376
|
+
|
|
377
|
+
event: 'thread.run.step.in_progress';
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Occurs when parts of a
|
|
382
|
+
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object) are
|
|
383
|
+
* being streamed.
|
|
384
|
+
*/
|
|
385
|
+
export interface ThreadRunStepDelta {
|
|
386
|
+
/**
|
|
387
|
+
* Represents a run step delta i.e. any changed fields on a run step during
|
|
388
|
+
* streaming.
|
|
389
|
+
*/
|
|
390
|
+
data: StepsAPI.RunStepDeltaEvent;
|
|
391
|
+
|
|
392
|
+
event: 'thread.run.step.delta';
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Occurs when a
|
|
397
|
+
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object) is
|
|
398
|
+
* completed.
|
|
399
|
+
*/
|
|
400
|
+
export interface ThreadRunStepCompleted {
|
|
401
|
+
/**
|
|
402
|
+
* Represents a step in execution of a run.
|
|
403
|
+
*/
|
|
404
|
+
data: StepsAPI.RunStep;
|
|
405
|
+
|
|
406
|
+
event: 'thread.run.step.completed';
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Occurs when a
|
|
411
|
+
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object)
|
|
412
|
+
* fails.
|
|
413
|
+
*/
|
|
414
|
+
export interface ThreadRunStepFailed {
|
|
415
|
+
/**
|
|
416
|
+
* Represents a step in execution of a run.
|
|
417
|
+
*/
|
|
418
|
+
data: StepsAPI.RunStep;
|
|
419
|
+
|
|
420
|
+
event: 'thread.run.step.failed';
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Occurs when a
|
|
425
|
+
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object) is
|
|
426
|
+
* cancelled.
|
|
427
|
+
*/
|
|
428
|
+
export interface ThreadRunStepCancelled {
|
|
429
|
+
/**
|
|
430
|
+
* Represents a step in execution of a run.
|
|
431
|
+
*/
|
|
432
|
+
data: StepsAPI.RunStep;
|
|
433
|
+
|
|
434
|
+
event: 'thread.run.step.cancelled';
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Occurs when a
|
|
439
|
+
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object)
|
|
440
|
+
* expires.
|
|
441
|
+
*/
|
|
442
|
+
export interface ThreadRunStepExpired {
|
|
443
|
+
/**
|
|
444
|
+
* Represents a step in execution of a run.
|
|
445
|
+
*/
|
|
446
|
+
data: StepsAPI.RunStep;
|
|
447
|
+
|
|
448
|
+
event: 'thread.run.step.expired';
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Occurs when a
|
|
453
|
+
* [message](https://platform.openai.com/docs/api-reference/messages/object) is
|
|
454
|
+
* created.
|
|
455
|
+
*/
|
|
456
|
+
export interface ThreadMessageCreated {
|
|
457
|
+
/**
|
|
458
|
+
* Represents a message within a
|
|
459
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
460
|
+
*/
|
|
461
|
+
data: MessagesAPI.Message;
|
|
462
|
+
|
|
463
|
+
event: 'thread.message.created';
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* Occurs when a
|
|
468
|
+
* [message](https://platform.openai.com/docs/api-reference/messages/object) moves
|
|
469
|
+
* to an `in_progress` state.
|
|
470
|
+
*/
|
|
471
|
+
export interface ThreadMessageInProgress {
|
|
472
|
+
/**
|
|
473
|
+
* Represents a message within a
|
|
474
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
475
|
+
*/
|
|
476
|
+
data: MessagesAPI.Message;
|
|
477
|
+
|
|
478
|
+
event: 'thread.message.in_progress';
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Occurs when parts of a
|
|
483
|
+
* [Message](https://platform.openai.com/docs/api-reference/messages/object) are
|
|
484
|
+
* being streamed.
|
|
485
|
+
*/
|
|
486
|
+
export interface ThreadMessageDelta {
|
|
487
|
+
/**
|
|
488
|
+
* Represents a message delta i.e. any changed fields on a message during
|
|
489
|
+
* streaming.
|
|
490
|
+
*/
|
|
491
|
+
data: MessagesAPI.MessageDeltaEvent;
|
|
492
|
+
|
|
493
|
+
event: 'thread.message.delta';
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Occurs when a
|
|
498
|
+
* [message](https://platform.openai.com/docs/api-reference/messages/object) is
|
|
499
|
+
* completed.
|
|
500
|
+
*/
|
|
501
|
+
export interface ThreadMessageCompleted {
|
|
502
|
+
/**
|
|
503
|
+
* Represents a message within a
|
|
504
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
505
|
+
*/
|
|
506
|
+
data: MessagesAPI.Message;
|
|
507
|
+
|
|
508
|
+
event: 'thread.message.completed';
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Occurs when a
|
|
513
|
+
* [message](https://platform.openai.com/docs/api-reference/messages/object) ends
|
|
514
|
+
* before it is completed.
|
|
515
|
+
*/
|
|
516
|
+
export interface ThreadMessageIncomplete {
|
|
517
|
+
/**
|
|
518
|
+
* Represents a message within a
|
|
519
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
520
|
+
*/
|
|
521
|
+
data: MessagesAPI.Message;
|
|
522
|
+
|
|
523
|
+
event: 'thread.message.incomplete';
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
/**
|
|
527
|
+
* Occurs when an
|
|
528
|
+
* [error](https://platform.openai.com/docs/guides/error-codes/api-errors) occurs.
|
|
529
|
+
* This can happen due to an internal server error or a timeout.
|
|
530
|
+
*/
|
|
531
|
+
export interface ErrorEvent {
|
|
532
|
+
data: Shared.ErrorObject;
|
|
533
|
+
|
|
534
|
+
event: 'error';
|
|
173
535
|
}
|
|
174
536
|
}
|
|
175
537
|
|
|
176
|
-
export
|
|
177
|
-
id: string;
|
|
538
|
+
export type AssistantTool = CodeInterpreterTool | RetrievalTool | FunctionTool;
|
|
178
539
|
|
|
179
|
-
|
|
540
|
+
export interface CodeInterpreterTool {
|
|
541
|
+
/**
|
|
542
|
+
* The type of tool being defined: `code_interpreter`
|
|
543
|
+
*/
|
|
544
|
+
type: 'code_interpreter';
|
|
545
|
+
}
|
|
180
546
|
|
|
181
|
-
|
|
547
|
+
export interface FunctionTool {
|
|
548
|
+
function: Shared.FunctionDefinition;
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* The type of tool being defined: `function`
|
|
552
|
+
*/
|
|
553
|
+
type: 'function';
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* Occurs when a
|
|
558
|
+
* [message](https://platform.openai.com/docs/api-reference/messages/object) is
|
|
559
|
+
* created.
|
|
560
|
+
*/
|
|
561
|
+
export type MessageStreamEvent =
|
|
562
|
+
| MessageStreamEvent.ThreadMessageCreated
|
|
563
|
+
| MessageStreamEvent.ThreadMessageInProgress
|
|
564
|
+
| MessageStreamEvent.ThreadMessageDelta
|
|
565
|
+
| MessageStreamEvent.ThreadMessageCompleted
|
|
566
|
+
| MessageStreamEvent.ThreadMessageIncomplete;
|
|
567
|
+
|
|
568
|
+
export namespace MessageStreamEvent {
|
|
569
|
+
/**
|
|
570
|
+
* Occurs when a
|
|
571
|
+
* [message](https://platform.openai.com/docs/api-reference/messages/object) is
|
|
572
|
+
* created.
|
|
573
|
+
*/
|
|
574
|
+
export interface ThreadMessageCreated {
|
|
575
|
+
/**
|
|
576
|
+
* Represents a message within a
|
|
577
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
578
|
+
*/
|
|
579
|
+
data: MessagesAPI.Message;
|
|
580
|
+
|
|
581
|
+
event: 'thread.message.created';
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* Occurs when a
|
|
586
|
+
* [message](https://platform.openai.com/docs/api-reference/messages/object) moves
|
|
587
|
+
* to an `in_progress` state.
|
|
588
|
+
*/
|
|
589
|
+
export interface ThreadMessageInProgress {
|
|
590
|
+
/**
|
|
591
|
+
* Represents a message within a
|
|
592
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
593
|
+
*/
|
|
594
|
+
data: MessagesAPI.Message;
|
|
595
|
+
|
|
596
|
+
event: 'thread.message.in_progress';
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Occurs when parts of a
|
|
601
|
+
* [Message](https://platform.openai.com/docs/api-reference/messages/object) are
|
|
602
|
+
* being streamed.
|
|
603
|
+
*/
|
|
604
|
+
export interface ThreadMessageDelta {
|
|
605
|
+
/**
|
|
606
|
+
* Represents a message delta i.e. any changed fields on a message during
|
|
607
|
+
* streaming.
|
|
608
|
+
*/
|
|
609
|
+
data: MessagesAPI.MessageDeltaEvent;
|
|
610
|
+
|
|
611
|
+
event: 'thread.message.delta';
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* Occurs when a
|
|
616
|
+
* [message](https://platform.openai.com/docs/api-reference/messages/object) is
|
|
617
|
+
* completed.
|
|
618
|
+
*/
|
|
619
|
+
export interface ThreadMessageCompleted {
|
|
620
|
+
/**
|
|
621
|
+
* Represents a message within a
|
|
622
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
623
|
+
*/
|
|
624
|
+
data: MessagesAPI.Message;
|
|
625
|
+
|
|
626
|
+
event: 'thread.message.completed';
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* Occurs when a
|
|
631
|
+
* [message](https://platform.openai.com/docs/api-reference/messages/object) ends
|
|
632
|
+
* before it is completed.
|
|
633
|
+
*/
|
|
634
|
+
export interface ThreadMessageIncomplete {
|
|
635
|
+
/**
|
|
636
|
+
* Represents a message within a
|
|
637
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
638
|
+
*/
|
|
639
|
+
data: MessagesAPI.Message;
|
|
640
|
+
|
|
641
|
+
event: 'thread.message.incomplete';
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
export interface RetrievalTool {
|
|
646
|
+
/**
|
|
647
|
+
* The type of tool being defined: `retrieval`
|
|
648
|
+
*/
|
|
649
|
+
type: 'retrieval';
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* Occurs when a
|
|
654
|
+
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object) is
|
|
655
|
+
* created.
|
|
656
|
+
*/
|
|
657
|
+
export type RunStepStreamEvent =
|
|
658
|
+
| RunStepStreamEvent.ThreadRunStepCreated
|
|
659
|
+
| RunStepStreamEvent.ThreadRunStepInProgress
|
|
660
|
+
| RunStepStreamEvent.ThreadRunStepDelta
|
|
661
|
+
| RunStepStreamEvent.ThreadRunStepCompleted
|
|
662
|
+
| RunStepStreamEvent.ThreadRunStepFailed
|
|
663
|
+
| RunStepStreamEvent.ThreadRunStepCancelled
|
|
664
|
+
| RunStepStreamEvent.ThreadRunStepExpired;
|
|
665
|
+
|
|
666
|
+
export namespace RunStepStreamEvent {
|
|
667
|
+
/**
|
|
668
|
+
* Occurs when a
|
|
669
|
+
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object) is
|
|
670
|
+
* created.
|
|
671
|
+
*/
|
|
672
|
+
export interface ThreadRunStepCreated {
|
|
673
|
+
/**
|
|
674
|
+
* Represents a step in execution of a run.
|
|
675
|
+
*/
|
|
676
|
+
data: StepsAPI.RunStep;
|
|
677
|
+
|
|
678
|
+
event: 'thread.run.step.created';
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* Occurs when a
|
|
683
|
+
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object)
|
|
684
|
+
* moves to an `in_progress` state.
|
|
685
|
+
*/
|
|
686
|
+
export interface ThreadRunStepInProgress {
|
|
687
|
+
/**
|
|
688
|
+
* Represents a step in execution of a run.
|
|
689
|
+
*/
|
|
690
|
+
data: StepsAPI.RunStep;
|
|
691
|
+
|
|
692
|
+
event: 'thread.run.step.in_progress';
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
/**
|
|
696
|
+
* Occurs when parts of a
|
|
697
|
+
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object) are
|
|
698
|
+
* being streamed.
|
|
699
|
+
*/
|
|
700
|
+
export interface ThreadRunStepDelta {
|
|
701
|
+
/**
|
|
702
|
+
* Represents a run step delta i.e. any changed fields on a run step during
|
|
703
|
+
* streaming.
|
|
704
|
+
*/
|
|
705
|
+
data: StepsAPI.RunStepDeltaEvent;
|
|
706
|
+
|
|
707
|
+
event: 'thread.run.step.delta';
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/**
|
|
711
|
+
* Occurs when a
|
|
712
|
+
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object) is
|
|
713
|
+
* completed.
|
|
714
|
+
*/
|
|
715
|
+
export interface ThreadRunStepCompleted {
|
|
716
|
+
/**
|
|
717
|
+
* Represents a step in execution of a run.
|
|
718
|
+
*/
|
|
719
|
+
data: StepsAPI.RunStep;
|
|
720
|
+
|
|
721
|
+
event: 'thread.run.step.completed';
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
/**
|
|
725
|
+
* Occurs when a
|
|
726
|
+
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object)
|
|
727
|
+
* fails.
|
|
728
|
+
*/
|
|
729
|
+
export interface ThreadRunStepFailed {
|
|
730
|
+
/**
|
|
731
|
+
* Represents a step in execution of a run.
|
|
732
|
+
*/
|
|
733
|
+
data: StepsAPI.RunStep;
|
|
734
|
+
|
|
735
|
+
event: 'thread.run.step.failed';
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
/**
|
|
739
|
+
* Occurs when a
|
|
740
|
+
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object) is
|
|
741
|
+
* cancelled.
|
|
742
|
+
*/
|
|
743
|
+
export interface ThreadRunStepCancelled {
|
|
744
|
+
/**
|
|
745
|
+
* Represents a step in execution of a run.
|
|
746
|
+
*/
|
|
747
|
+
data: StepsAPI.RunStep;
|
|
748
|
+
|
|
749
|
+
event: 'thread.run.step.cancelled';
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Occurs when a
|
|
754
|
+
* [run step](https://platform.openai.com/docs/api-reference/runs/step-object)
|
|
755
|
+
* expires.
|
|
756
|
+
*/
|
|
757
|
+
export interface ThreadRunStepExpired {
|
|
758
|
+
/**
|
|
759
|
+
* Represents a step in execution of a run.
|
|
760
|
+
*/
|
|
761
|
+
data: StepsAPI.RunStep;
|
|
762
|
+
|
|
763
|
+
event: 'thread.run.step.expired';
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Occurs when a new
|
|
769
|
+
* [run](https://platform.openai.com/docs/api-reference/runs/object) is created.
|
|
770
|
+
*/
|
|
771
|
+
export type RunStreamEvent =
|
|
772
|
+
| RunStreamEvent.ThreadRunCreated
|
|
773
|
+
| RunStreamEvent.ThreadRunQueued
|
|
774
|
+
| RunStreamEvent.ThreadRunInProgress
|
|
775
|
+
| RunStreamEvent.ThreadRunRequiresAction
|
|
776
|
+
| RunStreamEvent.ThreadRunCompleted
|
|
777
|
+
| RunStreamEvent.ThreadRunFailed
|
|
778
|
+
| RunStreamEvent.ThreadRunCancelling
|
|
779
|
+
| RunStreamEvent.ThreadRunCancelled
|
|
780
|
+
| RunStreamEvent.ThreadRunExpired;
|
|
781
|
+
|
|
782
|
+
export namespace RunStreamEvent {
|
|
783
|
+
/**
|
|
784
|
+
* Occurs when a new
|
|
785
|
+
* [run](https://platform.openai.com/docs/api-reference/runs/object) is created.
|
|
786
|
+
*/
|
|
787
|
+
export interface ThreadRunCreated {
|
|
788
|
+
/**
|
|
789
|
+
* Represents an execution run on a
|
|
790
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
791
|
+
*/
|
|
792
|
+
data: RunsAPI.Run;
|
|
793
|
+
|
|
794
|
+
event: 'thread.run.created';
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
799
|
+
* moves to a `queued` status.
|
|
800
|
+
*/
|
|
801
|
+
export interface ThreadRunQueued {
|
|
802
|
+
/**
|
|
803
|
+
* Represents an execution run on a
|
|
804
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
805
|
+
*/
|
|
806
|
+
data: RunsAPI.Run;
|
|
807
|
+
|
|
808
|
+
event: 'thread.run.queued';
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
813
|
+
* moves to an `in_progress` status.
|
|
814
|
+
*/
|
|
815
|
+
export interface ThreadRunInProgress {
|
|
816
|
+
/**
|
|
817
|
+
* Represents an execution run on a
|
|
818
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
819
|
+
*/
|
|
820
|
+
data: RunsAPI.Run;
|
|
821
|
+
|
|
822
|
+
event: 'thread.run.in_progress';
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
827
|
+
* moves to a `requires_action` status.
|
|
828
|
+
*/
|
|
829
|
+
export interface ThreadRunRequiresAction {
|
|
830
|
+
/**
|
|
831
|
+
* Represents an execution run on a
|
|
832
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
833
|
+
*/
|
|
834
|
+
data: RunsAPI.Run;
|
|
835
|
+
|
|
836
|
+
event: 'thread.run.requires_action';
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
841
|
+
* is completed.
|
|
842
|
+
*/
|
|
843
|
+
export interface ThreadRunCompleted {
|
|
844
|
+
/**
|
|
845
|
+
* Represents an execution run on a
|
|
846
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
847
|
+
*/
|
|
848
|
+
data: RunsAPI.Run;
|
|
849
|
+
|
|
850
|
+
event: 'thread.run.completed';
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
/**
|
|
854
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
855
|
+
* fails.
|
|
856
|
+
*/
|
|
857
|
+
export interface ThreadRunFailed {
|
|
858
|
+
/**
|
|
859
|
+
* Represents an execution run on a
|
|
860
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
861
|
+
*/
|
|
862
|
+
data: RunsAPI.Run;
|
|
863
|
+
|
|
864
|
+
event: 'thread.run.failed';
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
869
|
+
* moves to a `cancelling` status.
|
|
870
|
+
*/
|
|
871
|
+
export interface ThreadRunCancelling {
|
|
872
|
+
/**
|
|
873
|
+
* Represents an execution run on a
|
|
874
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
875
|
+
*/
|
|
876
|
+
data: RunsAPI.Run;
|
|
877
|
+
|
|
878
|
+
event: 'thread.run.cancelling';
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
883
|
+
* is cancelled.
|
|
884
|
+
*/
|
|
885
|
+
export interface ThreadRunCancelled {
|
|
886
|
+
/**
|
|
887
|
+
* Represents an execution run on a
|
|
888
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
889
|
+
*/
|
|
890
|
+
data: RunsAPI.Run;
|
|
891
|
+
|
|
892
|
+
event: 'thread.run.cancelled';
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* Occurs when a [run](https://platform.openai.com/docs/api-reference/runs/object)
|
|
897
|
+
* expires.
|
|
898
|
+
*/
|
|
899
|
+
export interface ThreadRunExpired {
|
|
900
|
+
/**
|
|
901
|
+
* Represents an execution run on a
|
|
902
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads).
|
|
903
|
+
*/
|
|
904
|
+
data: RunsAPI.Run;
|
|
905
|
+
|
|
906
|
+
event: 'thread.run.expired';
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* Occurs when a new
|
|
912
|
+
* [thread](https://platform.openai.com/docs/api-reference/threads/object) is
|
|
913
|
+
* created.
|
|
914
|
+
*/
|
|
915
|
+
export interface ThreadStreamEvent {
|
|
916
|
+
/**
|
|
917
|
+
* Represents a thread that contains
|
|
918
|
+
* [messages](https://platform.openai.com/docs/api-reference/messages).
|
|
919
|
+
*/
|
|
920
|
+
data: ThreadsAPI.Thread;
|
|
921
|
+
|
|
922
|
+
event: 'thread.created';
|
|
182
923
|
}
|
|
183
924
|
|
|
184
925
|
export interface AssistantCreateParams {
|
|
@@ -226,36 +967,7 @@ export interface AssistantCreateParams {
|
|
|
226
967
|
* A list of tool enabled on the assistant. There can be a maximum of 128 tools per
|
|
227
968
|
* assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`.
|
|
228
969
|
*/
|
|
229
|
-
tools?: Array<
|
|
230
|
-
| AssistantCreateParams.AssistantToolsCode
|
|
231
|
-
| AssistantCreateParams.AssistantToolsRetrieval
|
|
232
|
-
| AssistantCreateParams.AssistantToolsFunction
|
|
233
|
-
>;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
export namespace AssistantCreateParams {
|
|
237
|
-
export interface AssistantToolsCode {
|
|
238
|
-
/**
|
|
239
|
-
* The type of tool being defined: `code_interpreter`
|
|
240
|
-
*/
|
|
241
|
-
type: 'code_interpreter';
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
export interface AssistantToolsRetrieval {
|
|
245
|
-
/**
|
|
246
|
-
* The type of tool being defined: `retrieval`
|
|
247
|
-
*/
|
|
248
|
-
type: 'retrieval';
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
export interface AssistantToolsFunction {
|
|
252
|
-
function: Shared.FunctionDefinition;
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* The type of tool being defined: `function`
|
|
256
|
-
*/
|
|
257
|
-
type: 'function';
|
|
258
|
-
}
|
|
970
|
+
tools?: Array<AssistantTool>;
|
|
259
971
|
}
|
|
260
972
|
|
|
261
973
|
export interface AssistantUpdateParams {
|
|
@@ -305,36 +1017,7 @@ export interface AssistantUpdateParams {
|
|
|
305
1017
|
* A list of tool enabled on the assistant. There can be a maximum of 128 tools per
|
|
306
1018
|
* assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`.
|
|
307
1019
|
*/
|
|
308
|
-
tools?: Array<
|
|
309
|
-
| AssistantUpdateParams.AssistantToolsCode
|
|
310
|
-
| AssistantUpdateParams.AssistantToolsRetrieval
|
|
311
|
-
| AssistantUpdateParams.AssistantToolsFunction
|
|
312
|
-
>;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
export namespace AssistantUpdateParams {
|
|
316
|
-
export interface AssistantToolsCode {
|
|
317
|
-
/**
|
|
318
|
-
* The type of tool being defined: `code_interpreter`
|
|
319
|
-
*/
|
|
320
|
-
type: 'code_interpreter';
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
export interface AssistantToolsRetrieval {
|
|
324
|
-
/**
|
|
325
|
-
* The type of tool being defined: `retrieval`
|
|
326
|
-
*/
|
|
327
|
-
type: 'retrieval';
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
export interface AssistantToolsFunction {
|
|
331
|
-
function: Shared.FunctionDefinition;
|
|
332
|
-
|
|
333
|
-
/**
|
|
334
|
-
* The type of tool being defined: `function`
|
|
335
|
-
*/
|
|
336
|
-
type: 'function';
|
|
337
|
-
}
|
|
1020
|
+
tools?: Array<AssistantTool>;
|
|
338
1021
|
}
|
|
339
1022
|
|
|
340
1023
|
export interface AssistantListParams extends CursorPageParams {
|
|
@@ -356,6 +1039,15 @@ export interface AssistantListParams extends CursorPageParams {
|
|
|
356
1039
|
export namespace Assistants {
|
|
357
1040
|
export import Assistant = AssistantsAPI.Assistant;
|
|
358
1041
|
export import AssistantDeleted = AssistantsAPI.AssistantDeleted;
|
|
1042
|
+
export import AssistantStreamEvent = AssistantsAPI.AssistantStreamEvent;
|
|
1043
|
+
export import AssistantTool = AssistantsAPI.AssistantTool;
|
|
1044
|
+
export import CodeInterpreterTool = AssistantsAPI.CodeInterpreterTool;
|
|
1045
|
+
export import FunctionTool = AssistantsAPI.FunctionTool;
|
|
1046
|
+
export import MessageStreamEvent = AssistantsAPI.MessageStreamEvent;
|
|
1047
|
+
export import RetrievalTool = AssistantsAPI.RetrievalTool;
|
|
1048
|
+
export import RunStepStreamEvent = AssistantsAPI.RunStepStreamEvent;
|
|
1049
|
+
export import RunStreamEvent = AssistantsAPI.RunStreamEvent;
|
|
1050
|
+
export import ThreadStreamEvent = AssistantsAPI.ThreadStreamEvent;
|
|
359
1051
|
export import AssistantsPage = AssistantsAPI.AssistantsPage;
|
|
360
1052
|
export import AssistantCreateParams = AssistantsAPI.AssistantCreateParams;
|
|
361
1053
|
export import AssistantUpdateParams = AssistantsAPI.AssistantUpdateParams;
|