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
@@ -36,7 +36,7 @@ class Runs extends resource_1.APIResource {
36
36
  this.steps = new StepsAPI.Steps(this.client);
37
37
  }
38
38
  /**
39
- * Create a Run.
39
+ * Create a run.
40
40
  */
41
41
  create(threadId, body, options) {
42
42
  return this.post(`/threads/${threadId}/runs`, {
@@ -46,7 +46,7 @@ class Runs extends resource_1.APIResource {
46
46
  });
47
47
  }
48
48
  /**
49
- * Retrieves a Run.
49
+ * Retrieves a run.
50
50
  */
51
51
  retrieve(threadId, runId, options) {
52
52
  return this.get(`/threads/${threadId}/runs/${runId}`, {
@@ -55,7 +55,7 @@ class Runs extends resource_1.APIResource {
55
55
  });
56
56
  }
57
57
  /**
58
- * Modifies a Run.
58
+ * Modifies a run.
59
59
  */
60
60
  update(threadId, runId, body, options) {
61
61
  return this.post(`/threads/${threadId}/runs/${runId}`, {
@@ -75,7 +75,7 @@ class Runs extends resource_1.APIResource {
75
75
  });
76
76
  }
77
77
  /**
78
- * Cancels a Run that is `in_progress`.
78
+ * Cancels a run that is `in_progress`.
79
79
  */
80
80
  cancel(threadId, runId, options) {
81
81
  return this.post(`/threads/${threadId}/runs/${runId}/cancel`, {
@@ -84,7 +84,7 @@ class Runs extends resource_1.APIResource {
84
84
  });
85
85
  }
86
86
  /**
87
- * When a Run has the `status: "requires_action"` and `required_action.type` is
87
+ * When a run has the `status: "requires_action"` and `required_action.type` is
88
88
  * `submit_tool_outputs`, this endpoint can be used to submit the outputs from the
89
89
  * tool calls once they're all completed. All outputs must be submitted in a single
90
90
  * request.
@@ -10,7 +10,7 @@ export class Runs extends APIResource {
10
10
  this.steps = new StepsAPI.Steps(this.client);
11
11
  }
12
12
  /**
13
- * Create a Run.
13
+ * Create a run.
14
14
  */
15
15
  create(threadId, body, options) {
16
16
  return this.post(`/threads/${threadId}/runs`, {
@@ -20,7 +20,7 @@ export class Runs extends APIResource {
20
20
  });
21
21
  }
22
22
  /**
23
- * Retrieves a Run.
23
+ * Retrieves a run.
24
24
  */
25
25
  retrieve(threadId, runId, options) {
26
26
  return this.get(`/threads/${threadId}/runs/${runId}`, {
@@ -29,7 +29,7 @@ export class Runs extends APIResource {
29
29
  });
30
30
  }
31
31
  /**
32
- * Modifies a Run.
32
+ * Modifies a run.
33
33
  */
34
34
  update(threadId, runId, body, options) {
35
35
  return this.post(`/threads/${threadId}/runs/${runId}`, {
@@ -49,7 +49,7 @@ export class Runs extends APIResource {
49
49
  });
50
50
  }
51
51
  /**
52
- * Cancels a Run that is `in_progress`.
52
+ * Cancels a run that is `in_progress`.
53
53
  */
54
54
  cancel(threadId, runId, options) {
55
55
  return this.post(`/threads/${threadId}/runs/${runId}/cancel`, {
@@ -58,7 +58,7 @@ export class Runs extends APIResource {
58
58
  });
59
59
  }
60
60
  /**
61
- * When a Run has the `status: "requires_action"` and `required_action.type` is
61
+ * When a run has the `status: "requires_action"` and `required_action.type` is
62
62
  * `submit_tool_outputs`, this endpoint can be used to submit the outputs from the
63
63
  * tool calls once they're all completed. All outputs must be submitted in a single
64
64
  * request.
@@ -4,11 +4,11 @@ import * as StepsAPI from 'openai/resources/beta/threads/runs/steps';
4
4
  import { CursorPage, type CursorPageParams } from 'openai/pagination';
5
5
  export declare class Steps extends APIResource {
6
6
  /**
7
- * Retrieves a Run Step.
7
+ * Retrieves a run step.
8
8
  */
9
9
  retrieve(threadId: string, runId: string, stepId: string, options?: Core.RequestOptions): Core.APIPromise<RunStep>;
10
10
  /**
11
- * Returns a list of Run Steps belonging to a Run.
11
+ * Returns a list of run steps belonging to a run.
12
12
  */
13
13
  list(threadId: string, runId: string, query?: StepListParams, options?: Core.RequestOptions): Core.PagePromise<RunStepsPage, RunStep>;
14
14
  list(threadId: string, runId: string, options?: Core.RequestOptions): Core.PagePromise<RunStepsPage, RunStep>;
@@ -16,7 +16,7 @@ export declare class Steps extends APIResource {
16
16
  export declare class RunStepsPage extends CursorPage<RunStep> {
17
17
  }
18
18
  /**
19
- * Details of the Code Interpreter tool call the Run Step was involved in.
19
+ * Details of the Code Interpreter tool call the run step was involved in.
20
20
  */
21
21
  export interface CodeToolCall {
22
22
  /**
@@ -24,7 +24,7 @@ export interface CodeToolCall {
24
24
  */
25
25
  id: string;
26
26
  /**
27
- * The code interpreter tool call definition.
27
+ * The Code Interpreter tool call definition.
28
28
  */
29
29
  code_interpreter: CodeToolCall.CodeInterpreter;
30
30
  /**
@@ -35,7 +35,7 @@ export interface CodeToolCall {
35
35
  }
36
36
  export declare namespace CodeToolCall {
37
37
  /**
38
- * The code interpreter tool call definition.
38
+ * The Code Interpreter tool call definition.
39
39
  */
40
40
  interface CodeInterpreter {
41
41
  /**
@@ -51,7 +51,7 @@ export declare namespace CodeToolCall {
51
51
  }
52
52
  namespace CodeInterpreter {
53
53
  /**
54
- * Text output from the Code Interpreter tool call as part of a Run Step.
54
+ * Text output from the Code Interpreter tool call as part of a run step.
55
55
  */
56
56
  interface Logs {
57
57
  /**
@@ -59,21 +59,21 @@ export declare namespace CodeToolCall {
59
59
  */
60
60
  logs: string;
61
61
  /**
62
- * Will always be `logs`.
62
+ * Always `logs`.
63
63
  */
64
64
  type: 'logs';
65
65
  }
66
66
  interface Image {
67
67
  image: Image.Image;
68
68
  /**
69
- * Will always be `image`.
69
+ * Always `image`.
70
70
  */
71
71
  type: 'image';
72
72
  }
73
73
  namespace Image {
74
74
  interface Image {
75
75
  /**
76
- * The [File](https://platform.openai.com/docs/api-reference/files) ID of the
76
+ * The [file](https://platform.openai.com/docs/api-reference/files) ID of the
77
77
  * image.
78
78
  */
79
79
  file_id: string;
@@ -118,19 +118,19 @@ export declare namespace FunctionToolCall {
118
118
  }
119
119
  }
120
120
  /**
121
- * Details of the Message creation activity that the Run Step was involved in.
121
+ * Details of the message creation by the run step.
122
122
  */
123
123
  export interface MessageCreationStepDetails {
124
124
  message_creation: MessageCreationStepDetails.MessageCreation;
125
125
  /**
126
- * Will always be `message_creation``.
126
+ * Always `message_creation``.
127
127
  */
128
128
  type: 'message_creation';
129
129
  }
130
130
  export declare namespace MessageCreationStepDetails {
131
131
  interface MessageCreation {
132
132
  /**
133
- * The ID of the Message that was created by this Run Step.
133
+ * The ID of the message that was created by this run step.
134
134
  */
135
135
  message_id: string;
136
136
  }
@@ -151,7 +151,7 @@ export interface RetrievalToolCall {
151
151
  type: 'retrieval';
152
152
  }
153
153
  /**
154
- * Represents a Step in execution of a Run.
154
+ * Represents a step in execution of a run.
155
155
  */
156
156
  export interface RunStep {
157
157
  /**
@@ -160,33 +160,33 @@ export interface RunStep {
160
160
  id: string;
161
161
  /**
162
162
  * The ID of the
163
- * [Assistant](https://platform.openai.com/docs/api-reference/assistants)
164
- * associated with the Run Step.
163
+ * [assistant](https://platform.openai.com/docs/api-reference/assistants)
164
+ * associated with the run step.
165
165
  */
166
166
  assistant_id: string;
167
167
  /**
168
- * The Unix timestamp (in seconds) for when the Run Step was cancelled.
168
+ * The Unix timestamp (in seconds) for when the run step was cancelled.
169
169
  */
170
170
  cancelled_at: number | null;
171
171
  /**
172
- * The Unix timestamp (in seconds) for when the Run Step was completed.
172
+ * The Unix timestamp (in seconds) for when the run step completed.
173
173
  */
174
174
  completed_at: number | null;
175
175
  /**
176
- * The Unix timestamp (in seconds) for when the Run Step was created.
176
+ * The Unix timestamp (in seconds) for when the run step was created.
177
177
  */
178
178
  created_at: number;
179
179
  /**
180
- * The Unix timestamp (in seconds) for when the Run Step expired. A step is
181
- * considered expired if the parent Run is expired.
180
+ * The Unix timestamp (in seconds) for when the run step expired. A step is
181
+ * considered expired if the parent run is expired.
182
182
  */
183
183
  expired_at: number | null;
184
184
  /**
185
- * The Unix timestamp (in seconds) for when the Run Step failed.
185
+ * The Unix timestamp (in seconds) for when the run step failed.
186
186
  */
187
187
  failed_at: number | null;
188
188
  /**
189
- * The last error associated with this Run Step. Will be `null` if there are no
189
+ * The last error associated with this run step. Will be `null` if there are no
190
190
  * errors.
191
191
  */
192
192
  last_error: RunStep.LastError | null;
@@ -202,8 +202,8 @@ export interface RunStep {
202
202
  */
203
203
  object: 'assistant.run.step';
204
204
  /**
205
- * The ID of the [Run](https://platform.openai.com/docs/api-reference/runs) that
206
- * this Run Step is a part of.
205
+ * The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that
206
+ * this run step is a part of.
207
207
  */
208
208
  run_id: string;
209
209
  /**
@@ -212,22 +212,22 @@ export interface RunStep {
212
212
  */
213
213
  status: 'in_progress' | 'cancelled' | 'failed' | 'completed' | 'expired';
214
214
  /**
215
- * The details of the activity the Run Step was involved in.
215
+ * The details of the run step.
216
216
  */
217
217
  step_details: MessageCreationStepDetails | ToolCallsStepDetails;
218
218
  /**
219
- * The ID of the [Thread](https://platform.openai.com/docs/api-reference/threads)
220
- * that was Run.
219
+ * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads)
220
+ * that was run.
221
221
  */
222
222
  thread_id: string;
223
223
  /**
224
- * The type of Run Step, which can be either `message_creation` or `tool_calls`.
224
+ * The type of run step, which can be either `message_creation` or `tool_calls`.
225
225
  */
226
226
  type: 'message_creation' | 'tool_calls';
227
227
  }
228
228
  export declare namespace RunStep {
229
229
  /**
230
- * The last error associated with this Run Step. Will be `null` if there are no
230
+ * The last error associated with this run step. Will be `null` if there are no
231
231
  * errors.
232
232
  */
233
233
  interface LastError {
@@ -242,17 +242,17 @@ export declare namespace RunStep {
242
242
  }
243
243
  }
244
244
  /**
245
- * Details of the Tool Call activity that the Run Step was involved in.
245
+ * Details of the tool call.
246
246
  */
247
247
  export interface ToolCallsStepDetails {
248
248
  /**
249
- * An array of tool calls the Run Step was involved in. These can be associated
249
+ * An array of tool calls the run step was involved in. These can be associated
250
250
  * with one of three types of tools: `code_interpreter`, `retrieval`, or
251
251
  * `function`.
252
252
  */
253
253
  tool_calls: Array<CodeToolCall | RetrievalToolCall | FunctionToolCall>;
254
254
  /**
255
- * Will always be `tool_calls`.
255
+ * Always `tool_calls`.
256
256
  */
257
257
  type: 'tool_calls';
258
258
  }
@@ -31,7 +31,7 @@ const StepsAPI = __importStar(require("openai/resources/beta/threads/runs/steps"
31
31
  const pagination_1 = require("openai/pagination");
32
32
  class Steps extends resource_1.APIResource {
33
33
  /**
34
- * Retrieves a Run Step.
34
+ * Retrieves a run step.
35
35
  */
36
36
  retrieve(threadId, runId, stepId, options) {
37
37
  return this.get(`/threads/${threadId}/runs/${runId}/steps/${stepId}`, {
@@ -5,7 +5,7 @@ import * as StepsAPI from 'openai/resources/beta/threads/runs/steps';
5
5
  import { CursorPage } from 'openai/pagination';
6
6
  export class Steps extends APIResource {
7
7
  /**
8
- * Retrieves a Run Step.
8
+ * Retrieves a run step.
9
9
  */
10
10
  retrieve(threadId, runId, stepId, options) {
11
11
  return this.get(`/threads/${threadId}/runs/${runId}/steps/${stepId}`, {
@@ -7,29 +7,30 @@ export declare class Threads extends APIResource {
7
7
  runs: RunsAPI.Runs;
8
8
  messages: MessagesAPI.Messages;
9
9
  /**
10
- * Create a Thread.
10
+ * Create a thread.
11
11
  */
12
- create(body: ThreadCreateParams, options?: Core.RequestOptions): Core.APIPromise<Thread>;
12
+ create(body?: ThreadCreateParams, options?: Core.RequestOptions): Core.APIPromise<Thread>;
13
+ create(options?: Core.RequestOptions): Core.APIPromise<Thread>;
13
14
  /**
14
- * Retrieves a Thread.
15
+ * Retrieves a thread.
15
16
  */
16
17
  retrieve(threadId: string, options?: Core.RequestOptions): Core.APIPromise<Thread>;
17
18
  /**
18
- * Modifies a Thread.
19
+ * Modifies a thread.
19
20
  */
20
21
  update(threadId: string, body: ThreadUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Thread>;
21
22
  /**
22
- * Delete a Thread.
23
+ * Delete a thread.
23
24
  */
24
25
  del(threadId: string, options?: Core.RequestOptions): Core.APIPromise<ThreadDeleted>;
25
26
  /**
26
- * Create a Thread and Run it in one request.
27
+ * Create a thread and run it in one request.
27
28
  */
28
29
  createAndRun(body: ThreadCreateAndRunParams, options?: Core.RequestOptions): Core.APIPromise<RunsAPI.Run>;
29
30
  }
30
31
  /**
31
- * Represents a Thread that contains
32
- * [Messages](https://platform.openai.com/docs/api-reference/messages).
32
+ * Represents a thread that contains
33
+ * [messages](https://platform.openai.com/docs/api-reference/messages).
33
34
  */
34
35
  export interface Thread {
35
36
  /**
@@ -37,7 +38,7 @@ export interface Thread {
37
38
  */
38
39
  id: string;
39
40
  /**
40
- * The Unix timestamp (in seconds) for when the Thread was created.
41
+ * The Unix timestamp (in seconds) for when the thread was created.
41
42
  */
42
43
  created_at: number;
43
44
  /**
@@ -59,8 +60,8 @@ export interface ThreadDeleted {
59
60
  }
60
61
  export interface ThreadCreateParams {
61
62
  /**
62
- * A list of [Messages](https://platform.openai.com/docs/api-reference/messages) to
63
- * start the Thread with.
63
+ * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to
64
+ * start the thread with.
64
65
  */
65
66
  messages?: Array<ThreadCreateParams.Message>;
66
67
  /**
@@ -74,18 +75,18 @@ export interface ThreadCreateParams {
74
75
  export declare namespace ThreadCreateParams {
75
76
  interface Message {
76
77
  /**
77
- * The content of the Message.
78
+ * The content of the message.
78
79
  */
79
80
  content: string;
80
81
  /**
81
- * The role of the entity that is creating the Message. Currently only `user` is
82
+ * The role of the entity that is creating the message. Currently only `user` is
82
83
  * supported.
83
84
  */
84
85
  role: 'user';
85
86
  /**
86
87
  * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that
87
- * the Message should use. There can be a maximum of 10 files attached to a
88
- * Message. Useful for tools like `retrieval` and `code_interpreter` that can
88
+ * the message should use. There can be a maximum of 10 files attached to a
89
+ * message. Useful for tools like `retrieval` and `code_interpreter` that can
89
90
  * access and use files.
90
91
  */
91
92
  file_ids?: Array<string>;
@@ -110,12 +111,12 @@ export interface ThreadUpdateParams {
110
111
  export interface ThreadCreateAndRunParams {
111
112
  /**
112
113
  * The ID of the
113
- * [Assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
114
- * execute this Run.
114
+ * [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
115
+ * execute this run.
115
116
  */
116
117
  assistant_id: string;
117
118
  /**
118
- * Override the default system message of the Assistant. This is useful for
119
+ * Override the default system message of the assistant. This is useful for
119
120
  * modifying the behavior on a per-run basis.
120
121
  */
121
122
  instructions?: string | null;
@@ -128,29 +129,29 @@ export interface ThreadCreateAndRunParams {
128
129
  metadata?: unknown | null;
129
130
  /**
130
131
  * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to
131
- * be used to execute this Run. If a value is provided here, it will override the
132
- * model associated with the Assistant. If not, the model associated with the
133
- * Assistant will be used.
132
+ * be used to execute this run. If a value is provided here, it will override the
133
+ * model associated with the assistant. If not, the model associated with the
134
+ * assistant will be used.
134
135
  */
135
136
  model?: string | null;
136
137
  /**
137
- * If no Thread is provided, an empty Thread will be created.
138
+ * If no thread is provided, an empty thread will be created.
138
139
  */
139
140
  thread?: ThreadCreateAndRunParams.Thread;
140
141
  /**
141
- * Override the tools the Assistant can use for this Run. This is useful for
142
+ * Override the tools the assistant can use for this run. This is useful for
142
143
  * modifying the behavior on a per-run basis.
143
144
  */
144
145
  tools?: Array<ThreadCreateAndRunParams.AssistantToolsCode | ThreadCreateAndRunParams.AssistantToolsRetrieval | ThreadCreateAndRunParams.AssistantToolsFunction> | null;
145
146
  }
146
147
  export declare namespace ThreadCreateAndRunParams {
147
148
  /**
148
- * If no Thread is provided, an empty Thread will be created.
149
+ * If no thread is provided, an empty thread will be created.
149
150
  */
150
151
  interface Thread {
151
152
  /**
152
- * A list of [Messages](https://platform.openai.com/docs/api-reference/messages) to
153
- * start the Thread with.
153
+ * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to
154
+ * start the thread with.
154
155
  */
155
156
  messages?: Array<Thread.Message>;
156
157
  /**
@@ -164,18 +165,18 @@ export declare namespace ThreadCreateAndRunParams {
164
165
  namespace Thread {
165
166
  interface Message {
166
167
  /**
167
- * The content of the Message.
168
+ * The content of the message.
168
169
  */
169
170
  content: string;
170
171
  /**
171
- * The role of the entity that is creating the Message. Currently only `user` is
172
+ * The role of the entity that is creating the message. Currently only `user` is
172
173
  * supported.
173
174
  */
174
175
  role: 'user';
175
176
  /**
176
177
  * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that
177
- * the Message should use. There can be a maximum of 10 files attached to a
178
- * Message. Useful for tools like `retrieval` and `code_interpreter` that can
178
+ * the message should use. There can be a maximum of 10 files attached to a
179
+ * message. Useful for tools like `retrieval` and `code_interpreter` that can
179
180
  * access and use files.
180
181
  */
181
182
  file_ids?: Array<string>;
@@ -196,9 +197,9 @@ export declare namespace ThreadCreateAndRunParams {
196
197
  }
197
198
  interface AssistantToolsRetrieval {
198
199
  /**
199
- * The type of tool being defined: `retreival`
200
+ * The type of tool being defined: `retrieval`
200
201
  */
201
- type: 'retreival';
202
+ type: 'retrieval';
202
203
  }
203
204
  interface AssistantToolsFunction {
204
205
  /**
@@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C,iBAAiB,CAAC;CACjE"}
@@ -26,6 +26,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
27
  exports.Threads = void 0;
28
28
  const resource_1 = require("openai/resource");
29
+ const core_1 = require("openai/core");
29
30
  const MessagesAPI = __importStar(require("openai/resources/beta/threads/messages/messages"));
30
31
  const RunsAPI = __importStar(require("openai/resources/beta/threads/runs/runs"));
31
32
  class Threads extends resource_1.APIResource {
@@ -34,10 +35,10 @@ class Threads extends resource_1.APIResource {
34
35
  this.runs = new RunsAPI.Runs(this.client);
35
36
  this.messages = new MessagesAPI.Messages(this.client);
36
37
  }
37
- /**
38
- * Create a Thread.
39
- */
40
- create(body, options) {
38
+ create(body = {}, options) {
39
+ if ((0, core_1.isRequestOptions)(body)) {
40
+ return this.create({}, body);
41
+ }
41
42
  return this.post('/threads', {
42
43
  body,
43
44
  ...options,
@@ -45,7 +46,7 @@ class Threads extends resource_1.APIResource {
45
46
  });
46
47
  }
47
48
  /**
48
- * Retrieves a Thread.
49
+ * Retrieves a thread.
49
50
  */
50
51
  retrieve(threadId, options) {
51
52
  return this.get(`/threads/${threadId}`, {
@@ -54,7 +55,7 @@ class Threads extends resource_1.APIResource {
54
55
  });
55
56
  }
56
57
  /**
57
- * Modifies a Thread.
58
+ * Modifies a thread.
58
59
  */
59
60
  update(threadId, body, options) {
60
61
  return this.post(`/threads/${threadId}`, {
@@ -64,7 +65,7 @@ class Threads extends resource_1.APIResource {
64
65
  });
65
66
  }
66
67
  /**
67
- * Delete a Thread.
68
+ * Delete a thread.
68
69
  */
69
70
  del(threadId, options) {
70
71
  return this.delete(`/threads/${threadId}`, {
@@ -73,7 +74,7 @@ class Threads extends resource_1.APIResource {
73
74
  });
74
75
  }
75
76
  /**
76
- * Create a Thread and Run it in one request.
77
+ * Create a thread and run it in one request.
77
78
  */
78
79
  createAndRun(body, options) {
79
80
  return this.post('/threads/runs', {
@@ -1 +1 @@
1
- {"version":3,"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AAC,QAAQ,CAAC;IAK5B,gBAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;IAKhC,0BAAkB,GAAG,WAAW,CAAC,kBAAkB,CAAC;AAIpE,CAAC,EAvBgB,OAAO,GAAP,eAAO,KAAP,eAAO,QAuBvB"}
@@ -1,5 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
  import { APIResource } from 'openai/resource';
3
+ import { isRequestOptions } from 'openai/core';
3
4
  import * as MessagesAPI from 'openai/resources/beta/threads/messages/messages';
4
5
  import * as RunsAPI from 'openai/resources/beta/threads/runs/runs';
5
6
  export class Threads extends APIResource {
@@ -8,10 +9,10 @@ export class Threads extends APIResource {
8
9
  this.runs = new RunsAPI.Runs(this.client);
9
10
  this.messages = new MessagesAPI.Messages(this.client);
10
11
  }
11
- /**
12
- * Create a Thread.
13
- */
14
- create(body, options) {
12
+ create(body = {}, options) {
13
+ if (isRequestOptions(body)) {
14
+ return this.create({}, body);
15
+ }
15
16
  return this.post('/threads', {
16
17
  body,
17
18
  ...options,
@@ -19,7 +20,7 @@ export class Threads extends APIResource {
19
20
  });
20
21
  }
21
22
  /**
22
- * Retrieves a Thread.
23
+ * Retrieves a thread.
23
24
  */
24
25
  retrieve(threadId, options) {
25
26
  return this.get(`/threads/${threadId}`, {
@@ -28,7 +29,7 @@ export class Threads extends APIResource {
28
29
  });
29
30
  }
30
31
  /**
31
- * Modifies a Thread.
32
+ * Modifies a thread.
32
33
  */
33
34
  update(threadId, body, options) {
34
35
  return this.post(`/threads/${threadId}`, {
@@ -38,7 +39,7 @@ export class Threads extends APIResource {
38
39
  });
39
40
  }
40
41
  /**
41
- * Delete a Thread.
42
+ * Delete a thread.
42
43
  */
43
44
  del(threadId, options) {
44
45
  return this.delete(`/threads/${threadId}`, {
@@ -47,7 +48,7 @@ export class Threads extends APIResource {
47
48
  });
48
49
  }
49
50
  /**
50
- * Create a Thread and Run it in one request.
51
+ * Create a thread and run it in one request.
51
52
  */
52
53
  createAndRun(body, options) {
53
54
  return this.post('/threads/runs', {
@@ -1 +1 @@
1
- {"version":3,"file":"threads.mjs","sourceRoot":"","sources":["../../../src/resources/beta/threads/threads.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAG9C,EAAE,WAAW,EAAE,MAAM,iBAAiB;OAEtC,KAAK,WAAW,MAAM,iDAAiD;OACvE,KAAK,OAAO,MAAM,yCAAyC;AAElE,MAAM,OAAO,OAAQ,SAAQ,WAAW;IAAxC;;QACE,SAAI,GAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnD,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAsDzE,CAAC;IApDC;;OAEG;IACH,MAAM,CAAC,IAAwB,EAAE,OAA6B;QAC5D,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAC3B,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACjE,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAA6B;QACtD,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,QAAQ,EAAE,EAAE;YACtC,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACjE,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,QAAgB,EAAE,IAAwB,EAAE,OAA6B;QAC9E,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,QAAQ,EAAE,EAAE;YACvC,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACjE,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,QAAg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