openai 4.16.0 → 4.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +2 -2
  3. package/lib/AbstractChatCompletionRunner.d.ts.map +1 -1
  4. package/lib/AbstractChatCompletionRunner.js +2 -0
  5. package/lib/AbstractChatCompletionRunner.js.map +1 -1
  6. package/lib/AbstractChatCompletionRunner.mjs +2 -0
  7. package/lib/AbstractChatCompletionRunner.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/beta/assistants/assistants.d.ts +38 -38
  10. package/resources/beta/assistants/assistants.js +4 -4
  11. package/resources/beta/assistants/assistants.mjs +4 -4
  12. package/resources/beta/assistants/files.d.ts +9 -9
  13. package/resources/beta/assistants/files.js +3 -3
  14. package/resources/beta/assistants/files.mjs +3 -3
  15. package/resources/beta/assistants/index.d.ts +1 -1
  16. package/resources/beta/beta.d.ts +1 -1
  17. package/resources/beta/index.d.ts +1 -1
  18. package/resources/beta/threads/messages/files.d.ts +5 -5
  19. package/resources/beta/threads/messages/files.js +1 -1
  20. package/resources/beta/threads/messages/files.mjs +1 -1
  21. package/resources/beta/threads/messages/messages.d.ts +36 -36
  22. package/resources/beta/threads/messages/messages.js +3 -3
  23. package/resources/beta/threads/messages/messages.mjs +3 -3
  24. package/resources/beta/threads/runs/runs.d.ts +45 -45
  25. package/resources/beta/threads/runs/runs.js +5 -5
  26. package/resources/beta/threads/runs/runs.mjs +5 -5
  27. package/resources/beta/threads/runs/steps.d.ts +32 -32
  28. package/resources/beta/threads/runs/steps.js +1 -1
  29. package/resources/beta/threads/runs/steps.mjs +1 -1
  30. package/resources/beta/threads/threads.d.ts +33 -32
  31. package/resources/beta/threads/threads.d.ts.map +1 -1
  32. package/resources/beta/threads/threads.js +9 -8
  33. package/resources/beta/threads/threads.js.map +1 -1
  34. package/resources/beta/threads/threads.mjs +9 -8
  35. package/resources/beta/threads/threads.mjs.map +1 -1
  36. package/resources/chat/completions.d.ts +12 -5
  37. package/resources/chat/completions.d.ts.map +1 -1
  38. package/resources/chat/completions.js.map +1 -1
  39. package/resources/chat/completions.mjs.map +1 -1
  40. package/resources/embeddings.d.ts +2 -2
  41. package/resources/embeddings.d.ts.map +1 -1
  42. package/resources/files.d.ts +5 -5
  43. package/src/lib/AbstractChatCompletionRunner.ts +4 -0
  44. package/src/resources/beta/assistants/assistants.ts +38 -38
  45. package/src/resources/beta/assistants/files.ts +9 -9
  46. package/src/resources/beta/assistants/index.ts +1 -1
  47. package/src/resources/beta/beta.ts +1 -1
  48. package/src/resources/beta/index.ts +1 -1
  49. package/src/resources/beta/threads/messages/files.ts +5 -5
  50. package/src/resources/beta/threads/messages/messages.ts +36 -36
  51. package/src/resources/beta/threads/runs/runs.ts +45 -45
  52. package/src/resources/beta/threads/runs/steps.ts +32 -32
  53. package/src/resources/beta/threads/threads.ts +41 -32
  54. package/src/resources/chat/completions.ts +14 -4
  55. package/src/resources/embeddings.ts +2 -2
  56. package/src/resources/files.ts +5 -5
  57. package/src/version.ts +1 -1
  58. package/version.d.ts +1 -1
  59. package/version.js +1 -1
  60. package/version.mjs +1 -1
@@ -11,7 +11,7 @@ export class Messages extends APIResource {
11
11
  files: FilesAPI.Files = new FilesAPI.Files(this.client);
12
12
 
13
13
  /**
14
- * Create a Message.
14
+ * Create a message.
15
15
  */
16
16
  create(
17
17
  threadId: string,
@@ -26,7 +26,7 @@ export class Messages extends APIResource {
26
26
  }
27
27
 
28
28
  /**
29
- * Retrieve a Message.
29
+ * Retrieve a message.
30
30
  */
31
31
  retrieve(
32
32
  threadId: string,
@@ -40,7 +40,7 @@ export class Messages extends APIResource {
40
40
  }
41
41
 
42
42
  /**
43
- * Modifies a Message.
43
+ * Modifies a message.
44
44
  */
45
45
  update(
46
46
  threadId: string,
@@ -56,7 +56,7 @@ export class Messages extends APIResource {
56
56
  }
57
57
 
58
58
  /**
59
- * Returns a list of Messages for a given Thread.
59
+ * Returns a list of messages for a given thread.
60
60
  */
61
61
  list(
62
62
  threadId: string,
@@ -84,13 +84,13 @@ export class ThreadMessagesPage extends CursorPage<ThreadMessage> {}
84
84
 
85
85
  /**
86
86
  * References an image [File](https://platform.openai.com/docs/api-reference/files)
87
- * in the content of a Message.
87
+ * in the content of a message.
88
88
  */
89
89
  export interface MessageContentImageFile {
90
90
  image_file: MessageContentImageFile.ImageFile;
91
91
 
92
92
  /**
93
- * Will always be `image_file`.
93
+ * Always `image_file`.
94
94
  */
95
95
  type: 'image_file';
96
96
  }
@@ -99,20 +99,20 @@ export namespace MessageContentImageFile {
99
99
  export interface ImageFile {
100
100
  /**
101
101
  * The [File](https://platform.openai.com/docs/api-reference/files) ID of the image
102
- * in the Message content.
102
+ * in the message content.
103
103
  */
104
104
  file_id: string;
105
105
  }
106
106
  }
107
107
 
108
108
  /**
109
- * The text content that is part of a Message.
109
+ * The text content that is part of a message.
110
110
  */
111
111
  export interface MessageContentText {
112
112
  text: MessageContentText.Text;
113
113
 
114
114
  /**
115
- * Will always be `text`.
115
+ * Always `text`.
116
116
  */
117
117
  type: 'text';
118
118
  }
@@ -129,8 +129,8 @@ export namespace MessageContentText {
129
129
 
130
130
  export namespace Text {
131
131
  /**
132
- * A citation within the Message that points to a specific quote from a specific
133
- * File associated with the Assistant or the Message. Generated when the Assistant
132
+ * A citation within the message that points to a specific quote from a specific
133
+ * File associated with the assistant or the message. Generated when the assistant
134
134
  * uses the "retrieval" tool to search files.
135
135
  */
136
136
  export interface FileCitation {
@@ -141,12 +141,12 @@ export namespace MessageContentText {
141
141
  start_index: number;
142
142
 
143
143
  /**
144
- * The text in the Message content that needs to be replaced.
144
+ * The text in the message content that needs to be replaced.
145
145
  */
146
146
  text: string;
147
147
 
148
148
  /**
149
- * Will always be `file_citation`.
149
+ * Always `file_citation`.
150
150
  */
151
151
  type: 'file_citation';
152
152
  }
@@ -159,15 +159,15 @@ export namespace MessageContentText {
159
159
  file_id: string;
160
160
 
161
161
  /**
162
- * The specific quote in the File.
162
+ * The specific quote in the file.
163
163
  */
164
164
  quote: string;
165
165
  }
166
166
  }
167
167
 
168
168
  /**
169
- * A URL for the File that's generated when the Assistant used the
170
- * `code_interpreter` tool to generate a File.
169
+ * A URL for the file that's generated when the assistant used the
170
+ * `code_interpreter` tool to generate a file.
171
171
  */
172
172
  export interface FilePath {
173
173
  end_index: number;
@@ -177,12 +177,12 @@ export namespace MessageContentText {
177
177
  start_index: number;
178
178
 
179
179
  /**
180
- * The text in the Message content that needs to be replaced.
180
+ * The text in the message content that needs to be replaced.
181
181
  */
182
182
  text: string;
183
183
 
184
184
  /**
185
- * Will always be `file_path`.
185
+ * Always `file_path`.
186
186
  */
187
187
  type: 'file_path';
188
188
  }
@@ -190,7 +190,7 @@ export namespace MessageContentText {
190
190
  export namespace FilePath {
191
191
  export interface FilePath {
192
192
  /**
193
- * The ID of the File that was generated.
193
+ * The ID of the file that was generated.
194
194
  */
195
195
  file_id: string;
196
196
  }
@@ -199,8 +199,8 @@ export namespace MessageContentText {
199
199
  }
200
200
 
201
201
  /**
202
- * Represents a Message within a
203
- * [Thread](https://platform.openai.com/docs/api-reference/threads).
202
+ * Represents a message within a
203
+ * [thread](https://platform.openai.com/docs/api-reference/threads).
204
204
  */
205
205
  export interface ThreadMessage {
206
206
  /**
@@ -210,25 +210,25 @@ export interface ThreadMessage {
210
210
 
211
211
  /**
212
212
  * If applicable, the ID of the
213
- * [Assistant](https://platform.openai.com/docs/api-reference/assistants) that
214
- * authored this Message.
213
+ * [assistant](https://platform.openai.com/docs/api-reference/assistants) that
214
+ * authored this message.
215
215
  */
216
216
  assistant_id: string | null;
217
217
 
218
218
  /**
219
- * The content of the Message in array of text and/or images.
219
+ * The content of the message in array of text and/or images.
220
220
  */
221
221
  content: Array<MessageContentImageFile | MessageContentText>;
222
222
 
223
223
  /**
224
- * The Unix timestamp (in seconds) for when the Message was created.
224
+ * The Unix timestamp (in seconds) for when the message was created.
225
225
  */
226
226
  created_at: number;
227
227
 
228
228
  /**
229
229
  * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs that
230
- * the Assistant should use. Useful for tools like retrieval and code_interpreter
231
- * that can access files. A maximum of 10 files can be attached to a Message.
230
+ * the assistant should use. Useful for tools like retrieval and code_interpreter
231
+ * that can access files. A maximum of 10 files can be attached to a message.
232
232
  */
233
233
  file_ids: Array<string>;
234
234
 
@@ -246,20 +246,20 @@ export interface ThreadMessage {
246
246
  object: 'thread.message';
247
247
 
248
248
  /**
249
- * The entity that produced the Message. One of `user` or `assistant`.
249
+ * The entity that produced the message. One of `user` or `assistant`.
250
250
  */
251
251
  role: 'user' | 'assistant';
252
252
 
253
253
  /**
254
254
  * If applicable, the ID of the
255
- * [Run](https://platform.openai.com/docs/api-reference/runs) associated with the
256
- * authoring of this Message.
255
+ * [run](https://platform.openai.com/docs/api-reference/runs) associated with the
256
+ * authoring of this message.
257
257
  */
258
258
  run_id: string | null;
259
259
 
260
260
  /**
261
- * The [Thread](https://platform.openai.com/docs/api-reference/threads) ID that
262
- * this Message belongs to.
261
+ * The [thread](https://platform.openai.com/docs/api-reference/threads) ID that
262
+ * this message belongs to.
263
263
  */
264
264
  thread_id: string;
265
265
  }
@@ -274,20 +274,20 @@ export interface ThreadMessageDeleted {
274
274
 
275
275
  export interface MessageCreateParams {
276
276
  /**
277
- * The content of the Message.
277
+ * The content of the message.
278
278
  */
279
279
  content: string;
280
280
 
281
281
  /**
282
- * The role of the entity that is creating the Message. Currently only `user` is
282
+ * The role of the entity that is creating the message. Currently only `user` is
283
283
  * supported.
284
284
  */
285
285
  role: 'user';
286
286
 
287
287
  /**
288
288
  * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that
289
- * the Message should use. There can be a maximum of 10 files attached to a
290
- * Message. Useful for tools like `retrieval` and `code_interpreter` that can
289
+ * the message should use. There can be a maximum of 10 files attached to a
290
+ * message. Useful for tools like `retrieval` and `code_interpreter` that can
291
291
  * access and use files.
292
292
  */
293
293
  file_ids?: Array<string>;
@@ -11,7 +11,7 @@ export class Runs extends APIResource {
11
11
  steps: StepsAPI.Steps = new StepsAPI.Steps(this.client);
12
12
 
13
13
  /**
14
- * Create a Run.
14
+ * Create a run.
15
15
  */
16
16
  create(threadId: string, body: RunCreateParams, options?: Core.RequestOptions): Core.APIPromise<Run> {
17
17
  return this.post(`/threads/${threadId}/runs`, {
@@ -22,7 +22,7 @@ export class Runs extends APIResource {
22
22
  }
23
23
 
24
24
  /**
25
- * Retrieves a Run.
25
+ * Retrieves a run.
26
26
  */
27
27
  retrieve(threadId: string, runId: string, options?: Core.RequestOptions): Core.APIPromise<Run> {
28
28
  return this.get(`/threads/${threadId}/runs/${runId}`, {
@@ -32,7 +32,7 @@ export class Runs extends APIResource {
32
32
  }
33
33
 
34
34
  /**
35
- * Modifies a Run.
35
+ * Modifies a run.
36
36
  */
37
37
  update(
38
38
  threadId: string,
@@ -48,7 +48,7 @@ export class Runs extends APIResource {
48
48
  }
49
49
 
50
50
  /**
51
- * Returns a list of Runs belonging to a Thread.
51
+ * Returns a list of runs belonging to a thread.
52
52
  */
53
53
  list(
54
54
  threadId: string,
@@ -72,7 +72,7 @@ export class Runs extends APIResource {
72
72
  }
73
73
 
74
74
  /**
75
- * Cancels a Run that is `in_progress`.
75
+ * Cancels a run that is `in_progress`.
76
76
  */
77
77
  cancel(threadId: string, runId: string, options?: Core.RequestOptions): Core.APIPromise<Run> {
78
78
  return this.post(`/threads/${threadId}/runs/${runId}/cancel`, {
@@ -82,7 +82,7 @@ export class Runs extends APIResource {
82
82
  }
83
83
 
84
84
  /**
85
- * When a Run has the `status: "requires_action"` and `required_action.type` is
85
+ * When a run has the `status: "requires_action"` and `required_action.type` is
86
86
  * `submit_tool_outputs`, this endpoint can be used to submit the outputs from the
87
87
  * tool calls once they're all completed. All outputs must be submitted in a single
88
88
  * request.
@@ -110,7 +110,7 @@ export interface RequiredActionFunctionToolCall {
110
110
  /**
111
111
  * The ID of the tool call. This ID must be referenced when you submit the tool
112
112
  * outputs in using the
113
- * [Submit tool outputs to Run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs)
113
+ * [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs)
114
114
  * endpoint.
115
115
  */
116
116
  id: string;
@@ -145,8 +145,8 @@ export namespace RequiredActionFunctionToolCall {
145
145
  }
146
146
 
147
147
  /**
148
- * Represents an execution Run on a
149
- * [Thread](https://platform.openai.com/docs/api-reference/threads).
148
+ * Represents an execution run on a
149
+ * [thread](https://platform.openai.com/docs/api-reference/threads).
150
150
  */
151
151
  export interface Run {
152
152
  /**
@@ -156,52 +156,52 @@ export interface Run {
156
156
 
157
157
  /**
158
158
  * The ID of the
159
- * [Assistant](https://platform.openai.com/docs/api-reference/assistants) used for
160
- * execution of this Run.
159
+ * [assistant](https://platform.openai.com/docs/api-reference/assistants) used for
160
+ * execution of this run.
161
161
  */
162
162
  assistant_id: string;
163
163
 
164
164
  /**
165
- * The Unix timestamp (in seconds) for when the Run was cancelled.
165
+ * The Unix timestamp (in seconds) for when the run was cancelled.
166
166
  */
167
167
  cancelled_at: number | null;
168
168
 
169
169
  /**
170
- * The Unix timestamp (in seconds) for when the Run was completed.
170
+ * The Unix timestamp (in seconds) for when the run was completed.
171
171
  */
172
172
  completed_at: number | null;
173
173
 
174
174
  /**
175
- * The Unix timestamp (in seconds) for when the Run was created.
175
+ * The Unix timestamp (in seconds) for when the run was created.
176
176
  */
177
177
  created_at: number;
178
178
 
179
179
  /**
180
- * The Unix timestamp (in seconds) for when the Run will expire.
180
+ * The Unix timestamp (in seconds) for when the run will expire.
181
181
  */
182
182
  expires_at: number;
183
183
 
184
184
  /**
185
- * The Unix timestamp (in seconds) for when the Run failed.
185
+ * The Unix timestamp (in seconds) for when the run failed.
186
186
  */
187
187
  failed_at: number | null;
188
188
 
189
189
  /**
190
190
  * The list of [File](https://platform.openai.com/docs/api-reference/files) IDs the
191
- * [Assistant](https://platform.openai.com/docs/api-reference/assistants) used for
192
- * this Run.
191
+ * [assistant](https://platform.openai.com/docs/api-reference/assistants) used for
192
+ * this run.
193
193
  */
194
194
  file_ids: Array<string>;
195
195
 
196
196
  /**
197
197
  * The instructions that the
198
- * [Assistant](https://platform.openai.com/docs/api-reference/assistants) used for
198
+ * [assistant](https://platform.openai.com/docs/api-reference/assistants) used for
199
199
  * this run.
200
200
  */
201
201
  instructions: string;
202
202
 
203
203
  /**
204
- * The last error associated with this Run. Will be `null` if there are no errors.
204
+ * The last error associated with this run. Will be `null` if there are no errors.
205
205
  */
206
206
  last_error: Run.LastError | null;
207
207
 
@@ -215,8 +215,8 @@ export interface Run {
215
215
 
216
216
  /**
217
217
  * The model that the
218
- * [Assistant](https://platform.openai.com/docs/api-reference/assistants) used for
219
- * this Run.
218
+ * [assistant](https://platform.openai.com/docs/api-reference/assistants) used for
219
+ * this run.
220
220
  */
221
221
  model: string;
222
222
 
@@ -226,13 +226,13 @@ export interface Run {
226
226
  object: 'assistant.run';
227
227
 
228
228
  /**
229
- * Details on the action required to continue the Run. Will be `null` if no action
229
+ * Details on the action required to continue the run. Will be `null` if no action
230
230
  * is required.
231
231
  */
232
232
  required_action: Run.RequiredAction | null;
233
233
 
234
234
  /**
235
- * The Unix timestamp (in seconds) for when the Run was started.
235
+ * The Unix timestamp (in seconds) for when the run was started.
236
236
  */
237
237
  started_at: number | null;
238
238
 
@@ -252,22 +252,22 @@ export interface Run {
252
252
  | 'expired';
253
253
 
254
254
  /**
255
- * The ID of the [Thread](https://platform.openai.com/docs/api-reference/threads)
256
- * that was executed on as a part of this Run.
255
+ * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads)
256
+ * that was executed on as a part of this run.
257
257
  */
258
258
  thread_id: string;
259
259
 
260
260
  /**
261
261
  * The list of tools that the
262
- * [Assistant](https://platform.openai.com/docs/api-reference/assistants) used for
263
- * this Run.
262
+ * [assistant](https://platform.openai.com/docs/api-reference/assistants) used for
263
+ * this run.
264
264
  */
265
265
  tools: Array<Run.AssistantToolsCode | Run.AssistantToolsRetrieval | Run.AssistantToolsFunction>;
266
266
  }
267
267
 
268
268
  export namespace Run {
269
269
  /**
270
- * The last error associated with this Run. Will be `null` if there are no errors.
270
+ * The last error associated with this run. Will be `null` if there are no errors.
271
271
  */
272
272
  export interface LastError {
273
273
  /**
@@ -282,12 +282,12 @@ export namespace Run {
282
282
  }
283
283
 
284
284
  /**
285
- * Details on the action required to continue the Run. Will be `null` if no action
285
+ * Details on the action required to continue the run. Will be `null` if no action
286
286
  * is required.
287
287
  */
288
288
  export interface RequiredAction {
289
289
  /**
290
- * Details on the tool outputs needed for this Run to continue.
290
+ * Details on the tool outputs needed for this run to continue.
291
291
  */
292
292
  submit_tool_outputs: RequiredAction.SubmitToolOutputs;
293
293
 
@@ -299,7 +299,7 @@ export namespace Run {
299
299
 
300
300
  export namespace RequiredAction {
301
301
  /**
302
- * Details on the tool outputs needed for this Run to continue.
302
+ * Details on the tool outputs needed for this run to continue.
303
303
  */
304
304
  export interface SubmitToolOutputs {
305
305
  /**
@@ -318,9 +318,9 @@ export namespace Run {
318
318
 
319
319
  export interface AssistantToolsRetrieval {
320
320
  /**
321
- * The type of tool being defined: `retreival`
321
+ * The type of tool being defined: `retrieval`
322
322
  */
323
- type: 'retreival';
323
+ type: 'retrieval';
324
324
  }
325
325
 
326
326
  export interface AssistantToolsFunction {
@@ -370,13 +370,13 @@ export namespace Run {
370
370
  export interface RunCreateParams {
371
371
  /**
372
372
  * The ID of the
373
- * [Assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
374
- * execute this Run.
373
+ * [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
374
+ * execute this run.
375
375
  */
376
376
  assistant_id: string;
377
377
 
378
378
  /**
379
- * Override the default system message of the Assistant. This is useful for
379
+ * Override the default system message of the assistant. This is useful for
380
380
  * modifying the behavior on a per-run basis.
381
381
  */
382
382
  instructions?: string | null;
@@ -391,14 +391,14 @@ export interface RunCreateParams {
391
391
 
392
392
  /**
393
393
  * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to
394
- * be used to execute this Run. If a value is provided here, it will override the
395
- * model associated with the Assistant. If not, the model associated with the
396
- * Assistant will be used.
394
+ * be used to execute this run. If a value is provided here, it will override the
395
+ * model associated with the assistant. If not, the model associated with the
396
+ * assistant will be used.
397
397
  */
398
398
  model?: string | null;
399
399
 
400
400
  /**
401
- * Override the tools the Assistant can use for this Run. This is useful for
401
+ * Override the tools the assistant can use for this run. This is useful for
402
402
  * modifying the behavior on a per-run basis.
403
403
  */
404
404
  tools?: Array<
@@ -418,9 +418,9 @@ export namespace RunCreateParams {
418
418
 
419
419
  export interface AssistantToolsRetrieval {
420
420
  /**
421
- * The type of tool being defined: `retreival`
421
+ * The type of tool being defined: `retrieval`
422
422
  */
423
- type: 'retreival';
423
+ type: 'retrieval';
424
424
  }
425
425
 
426
426
  export interface AssistantToolsFunction {
@@ -503,12 +503,12 @@ export interface RunSubmitToolOutputsParams {
503
503
  export namespace RunSubmitToolOutputsParams {
504
504
  export interface ToolOutput {
505
505
  /**
506
- * The output of the tool call to be submitted to continue the Run.
506
+ * The output of the tool call to be submitted to continue the run.
507
507
  */
508
508
  output?: string;
509
509
 
510
510
  /**
511
- * The ID of the tool call in the `required_action` object within the Run object
511
+ * The ID of the tool call in the `required_action` object within the run object
512
512
  * the output is being submitted for.
513
513
  */
514
514
  tool_call_id?: string;