openai 4.16.0 → 4.16.1

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 (37) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/resources/beta/assistants/assistants.d.ts +35 -35
  5. package/resources/beta/assistants/assistants.js +4 -4
  6. package/resources/beta/assistants/assistants.mjs +4 -4
  7. package/resources/beta/assistants/files.d.ts +9 -9
  8. package/resources/beta/assistants/files.js +3 -3
  9. package/resources/beta/assistants/files.mjs +3 -3
  10. package/resources/beta/threads/messages/files.d.ts +5 -5
  11. package/resources/beta/threads/messages/files.js +1 -1
  12. package/resources/beta/threads/messages/files.mjs +1 -1
  13. package/resources/beta/threads/messages/messages.d.ts +36 -36
  14. package/resources/beta/threads/messages/messages.js +3 -3
  15. package/resources/beta/threads/messages/messages.mjs +3 -3
  16. package/resources/beta/threads/runs/runs.d.ts +45 -45
  17. package/resources/beta/threads/runs/runs.js +5 -5
  18. package/resources/beta/threads/runs/runs.mjs +5 -5
  19. package/resources/beta/threads/runs/steps.d.ts +32 -32
  20. package/resources/beta/threads/runs/steps.js +1 -1
  21. package/resources/beta/threads/runs/steps.mjs +1 -1
  22. package/resources/beta/threads/threads.d.ts +31 -31
  23. package/resources/beta/threads/threads.js +5 -5
  24. package/resources/beta/threads/threads.mjs +5 -5
  25. package/resources/files.d.ts +5 -5
  26. package/src/resources/beta/assistants/assistants.ts +35 -35
  27. package/src/resources/beta/assistants/files.ts +9 -9
  28. package/src/resources/beta/threads/messages/files.ts +5 -5
  29. package/src/resources/beta/threads/messages/messages.ts +36 -36
  30. package/src/resources/beta/threads/runs/runs.ts +45 -45
  31. package/src/resources/beta/threads/runs/steps.ts +32 -32
  32. package/src/resources/beta/threads/threads.ts +31 -31
  33. package/src/resources/files.ts +5 -5
  34. package/src/version.ts +1 -1
  35. package/version.d.ts +1 -1
  36. package/version.js +1 -1
  37. package/version.mjs +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.16.1 (2023-11-06)
4
+
5
+ Full Changelog: [v4.16.0...v4.16.1](https://github.com/openai/openai-node/compare/v4.16.0...v4.16.1)
6
+
7
+ ### Bug Fixes
8
+
9
+ * **api:** retreival -> retrieval ([#437](https://github.com/openai/openai-node/issues/437)) ([b4bd3ee](https://github.com/openai/openai-node/commit/b4bd3eefdd3903abcc57c431382cc2124d39307b))
10
+
11
+
12
+ ### Documentation
13
+
14
+ * **api:** improve docstrings ([#435](https://github.com/openai/openai-node/issues/435)) ([ee8b24c](https://github.com/openai/openai-node/commit/ee8b24c70a5ccb944e02ff2201668d6bc2b597b3))
15
+
3
16
  ## 4.16.0 (2023-11-06)
4
17
 
5
18
  Full Changelog: [v4.15.4...v4.16.0](https://github.com/openai/openai-node/compare/v4.15.4...v4.16.0)
package/README.md CHANGED
@@ -21,7 +21,7 @@ You can import in Deno via:
21
21
  <!-- x-release-please-start-version -->
22
22
 
23
23
  ```ts
24
- import OpenAI from 'https://deno.land/x/openai@4.15.4/mod.ts';
24
+ import OpenAI from 'https://deno.land/x/openai@4.16.0/mod.ts';
25
25
  ```
26
26
 
27
27
  <!-- x-release-please-end -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openai",
3
- "version": "4.16.0",
3
+ "version": "4.16.1",
4
4
  "description": "Client library for the OpenAI API",
5
5
  "author": "OpenAI <support@openai.com>",
6
6
  "types": "./index.d.ts",
@@ -6,31 +6,31 @@ import { CursorPage, type CursorPageParams } from 'openai/pagination';
6
6
  export declare class Assistants extends APIResource {
7
7
  files: FilesAPI.Files;
8
8
  /**
9
- * Create an Assistant with a model and instructions.
9
+ * Create an assistant with a model and instructions.
10
10
  */
11
11
  create(body: AssistantCreateParams, options?: Core.RequestOptions): Core.APIPromise<Assistant>;
12
12
  /**
13
- * Retrieves an Assistant.
13
+ * Retrieves an assistant.
14
14
  */
15
15
  retrieve(assistantId: string, options?: Core.RequestOptions): Core.APIPromise<Assistant>;
16
16
  /**
17
- * Modifies an Assistant.
17
+ * Modifies an assistant.
18
18
  */
19
19
  update(assistantId: string, body: AssistantUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Assistant>;
20
20
  /**
21
- * Returns a list of Assistants.
21
+ * Returns a list of assistants.
22
22
  */
23
23
  list(query?: AssistantListParams, options?: Core.RequestOptions): Core.PagePromise<AssistantsPage, Assistant>;
24
24
  list(options?: Core.RequestOptions): Core.PagePromise<AssistantsPage, Assistant>;
25
25
  /**
26
- * Delete an Assistant.
26
+ * Delete an assistant.
27
27
  */
28
28
  del(assistantId: string, options?: Core.RequestOptions): Core.APIPromise<AsssitantDeleted>;
29
29
  }
30
30
  export declare class AssistantsPage extends CursorPage<Assistant> {
31
31
  }
32
32
  /**
33
- * Represents an `Assistant` that can call the model and use tools.
33
+ * Represents an `assistant` that can call the model and use tools.
34
34
  */
35
35
  export interface Assistant {
36
36
  /**
@@ -38,21 +38,21 @@ export interface Assistant {
38
38
  */
39
39
  id: string;
40
40
  /**
41
- * The Unix timestamp (in seconds) for when the Assistant was created.
41
+ * The Unix timestamp (in seconds) for when the assistant was created.
42
42
  */
43
43
  created_at: number;
44
44
  /**
45
- * The description of the Assistant. The maximum length is 512 characters.
45
+ * The description of the assistant. The maximum length is 512 characters.
46
46
  */
47
47
  description: string | null;
48
48
  /**
49
- * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs
50
- * attached to this Assistant. There can be a maximum of 20 files attached to the
51
- * Assistant. Files are ordered by their creation date in ascending order.
49
+ * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs
50
+ * attached to this assistant. There can be a maximum of 20 files attached to the
51
+ * assistant. Files are ordered by their creation date in ascending order.
52
52
  */
53
53
  file_ids: Array<string>;
54
54
  /**
55
- * The system instructions that the Assistant uses. The maximum length is 32768
55
+ * The system instructions that the assistant uses. The maximum length is 32768
56
56
  * characters.
57
57
  */
58
58
  instructions: string | null;
@@ -72,7 +72,7 @@ export interface Assistant {
72
72
  */
73
73
  model: string;
74
74
  /**
75
- * The name of the Assistant. The maximum length is 256 characters.
75
+ * The name of the assistant. The maximum length is 256 characters.
76
76
  */
77
77
  name: string | null;
78
78
  /**
@@ -80,10 +80,10 @@ export interface Assistant {
80
80
  */
81
81
  object: 'assistant';
82
82
  /**
83
- * A list of tool enabled on the Assistant. There can be a maximum of 128 tools per
83
+ * A list of tool enabled on the assistant. There can be a maximum of 128 tools per
84
84
  * assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`.
85
85
  */
86
- tools: Array<Assistant.CodeInterpreter | Assistant.Retreival | Assistant.Function>;
86
+ tools: Array<Assistant.CodeInterpreter | Assistant.Retrieval | Assistant.Function>;
87
87
  }
88
88
  export declare namespace Assistant {
89
89
  interface CodeInterpreter {
@@ -92,11 +92,11 @@ export declare namespace Assistant {
92
92
  */
93
93
  type: 'code_interpreter';
94
94
  }
95
- interface Retreival {
95
+ interface Retrieval {
96
96
  /**
97
- * The type of tool being defined: `retreival`
97
+ * The type of tool being defined: `retrieval`
98
98
  */
99
- type: 'retreival';
99
+ type: 'retrieval';
100
100
  }
101
101
  interface Function {
102
102
  /**
@@ -152,17 +152,17 @@ export interface AssistantCreateParams {
152
152
  */
153
153
  model: string;
154
154
  /**
155
- * The description of the Assistant. The maximum length is 512 characters.
155
+ * The description of the assistant. The maximum length is 512 characters.
156
156
  */
157
157
  description?: string | null;
158
158
  /**
159
- * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs
160
- * attached to this Assistant. There can be a maximum of 20 files attached to the
161
- * Assistant. Files are ordered by their creation date in ascending order.
159
+ * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs
160
+ * attached to this assistant. There can be a maximum of 20 files attached to the
161
+ * assistant. Files are ordered by their creation date in ascending order.
162
162
  */
163
163
  file_ids?: Array<string>;
164
164
  /**
165
- * The system instructions that the Assistant uses. The maximum length is 32768
165
+ * The system instructions that the assistant uses. The maximum length is 32768
166
166
  * characters.
167
167
  */
168
168
  instructions?: string | null;
@@ -174,11 +174,11 @@ export interface AssistantCreateParams {
174
174
  */
175
175
  metadata?: unknown | null;
176
176
  /**
177
- * The name of the Assistant. The maximum length is 256 characters.
177
+ * The name of the assistant. The maximum length is 256 characters.
178
178
  */
179
179
  name?: string | null;
180
180
  /**
181
- * A list of tool enabled on the Assistant. There can be a maximum of 128 tools per
181
+ * A list of tool enabled on the assistant. There can be a maximum of 128 tools per
182
182
  * assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`.
183
183
  */
184
184
  tools?: Array<AssistantCreateParams.AssistantToolsCode | AssistantCreateParams.AssistantToolsRetrieval | AssistantCreateParams.AssistantToolsFunction>;
@@ -192,9 +192,9 @@ export declare namespace AssistantCreateParams {
192
192
  }
193
193
  interface AssistantToolsRetrieval {
194
194
  /**
195
- * The type of tool being defined: `retreival`
195
+ * The type of tool being defined: `retrieval`
196
196
  */
197
- type: 'retreival';
197
+ type: 'retrieval';
198
198
  }
199
199
  interface AssistantToolsFunction {
200
200
  /**
@@ -237,19 +237,19 @@ export declare namespace AssistantCreateParams {
237
237
  }
238
238
  export interface AssistantUpdateParams {
239
239
  /**
240
- * The description of the Assistant. The maximum length is 512 characters.
240
+ * The description of the assistant. The maximum length is 512 characters.
241
241
  */
242
242
  description?: string | null;
243
243
  /**
244
244
  * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs
245
- * attached to this Assistant. There can be a maximum of 20 files attached to the
246
- * Assistant. Files are ordered by their creation date in ascending order. If a
245
+ * attached to this assistant. There can be a maximum of 20 files attached to the
246
+ * assistant. Files are ordered by their creation date in ascending order. If a
247
247
  * file was previosuly attached to the list but does not show up in the list, it
248
248
  * will be deleted from the assistant.
249
249
  */
250
250
  file_ids?: Array<string>;
251
251
  /**
252
- * The system instructions that the Assistant uses. The maximum length is 32768
252
+ * The system instructions that the assistant uses. The maximum length is 32768
253
253
  * characters.
254
254
  */
255
255
  instructions?: string | null;
@@ -269,11 +269,11 @@ export interface AssistantUpdateParams {
269
269
  */
270
270
  model?: string;
271
271
  /**
272
- * The name of the Assistant. The maximum length is 256 characters.
272
+ * The name of the assistant. The maximum length is 256 characters.
273
273
  */
274
274
  name?: string | null;
275
275
  /**
276
- * A list of tool enabled on the Assistant. There can be a maximum of 128 tools per
276
+ * A list of tool enabled on the assistant. There can be a maximum of 128 tools per
277
277
  * assistant. Tools can be of types `code_interpreter`, `retrieval`, or `function`.
278
278
  */
279
279
  tools?: Array<AssistantUpdateParams.AssistantToolsCode | AssistantUpdateParams.AssistantToolsRetrieval | AssistantUpdateParams.AssistantToolsFunction>;
@@ -287,9 +287,9 @@ export declare namespace AssistantUpdateParams {
287
287
  }
288
288
  interface AssistantToolsRetrieval {
289
289
  /**
290
- * The type of tool being defined: `retreival`
290
+ * The type of tool being defined: `retrieval`
291
291
  */
292
- type: 'retreival';
292
+ type: 'retrieval';
293
293
  }
294
294
  interface AssistantToolsFunction {
295
295
  /**
@@ -36,7 +36,7 @@ class Assistants extends resource_1.APIResource {
36
36
  this.files = new FilesAPI.Files(this.client);
37
37
  }
38
38
  /**
39
- * Create an Assistant with a model and instructions.
39
+ * Create an assistant with a model and instructions.
40
40
  */
41
41
  create(body, options) {
42
42
  return this.post('/assistants', {
@@ -46,7 +46,7 @@ class Assistants extends resource_1.APIResource {
46
46
  });
47
47
  }
48
48
  /**
49
- * Retrieves an Assistant.
49
+ * Retrieves an assistant.
50
50
  */
51
51
  retrieve(assistantId, options) {
52
52
  return this.get(`/assistants/${assistantId}`, {
@@ -55,7 +55,7 @@ class Assistants extends resource_1.APIResource {
55
55
  });
56
56
  }
57
57
  /**
58
- * Modifies an Assistant.
58
+ * Modifies an assistant.
59
59
  */
60
60
  update(assistantId, body, options) {
61
61
  return this.post(`/assistants/${assistantId}`, {
@@ -75,7 +75,7 @@ class Assistants extends resource_1.APIResource {
75
75
  });
76
76
  }
77
77
  /**
78
- * Delete an Assistant.
78
+ * Delete an assistant.
79
79
  */
80
80
  del(assistantId, options) {
81
81
  return this.delete(`/assistants/${assistantId}`, {
@@ -10,7 +10,7 @@ export class Assistants extends APIResource {
10
10
  this.files = new FilesAPI.Files(this.client);
11
11
  }
12
12
  /**
13
- * Create an Assistant with a model and instructions.
13
+ * Create an assistant with a model and instructions.
14
14
  */
15
15
  create(body, options) {
16
16
  return this.post('/assistants', {
@@ -20,7 +20,7 @@ export class Assistants extends APIResource {
20
20
  });
21
21
  }
22
22
  /**
23
- * Retrieves an Assistant.
23
+ * Retrieves an assistant.
24
24
  */
25
25
  retrieve(assistantId, options) {
26
26
  return this.get(`/assistants/${assistantId}`, {
@@ -29,7 +29,7 @@ export class Assistants extends APIResource {
29
29
  });
30
30
  }
31
31
  /**
32
- * Modifies an Assistant.
32
+ * Modifies an assistant.
33
33
  */
34
34
  update(assistantId, body, options) {
35
35
  return this.post(`/assistants/${assistantId}`, {
@@ -49,7 +49,7 @@ export class Assistants extends APIResource {
49
49
  });
50
50
  }
51
51
  /**
52
- * Delete an Assistant.
52
+ * Delete an assistant.
53
53
  */
54
54
  del(assistantId, options) {
55
55
  return this.delete(`/assistants/${assistantId}`, {
@@ -4,9 +4,9 @@ import * as FilesAPI from 'openai/resources/beta/assistants/files';
4
4
  import { CursorPage, type CursorPageParams } from 'openai/pagination';
5
5
  export declare class Files extends APIResource {
6
6
  /**
7
- * Create an Assistant File by attaching a
7
+ * Create an assistant file by attaching a
8
8
  * [File](https://platform.openai.com/docs/api-reference/files) to an
9
- * [Assistant](https://platform.openai.com/docs/api-reference/assistants).
9
+ * [assistant](https://platform.openai.com/docs/api-reference/assistants).
10
10
  */
11
11
  create(assistantId: string, body: FileCreateParams, options?: Core.RequestOptions): Core.APIPromise<AssistantFile>;
12
12
  /**
@@ -14,12 +14,12 @@ export declare class Files extends APIResource {
14
14
  */
15
15
  retrieve(assistantId: string, fileId: string, options?: Core.RequestOptions): Core.APIPromise<AssistantFile>;
16
16
  /**
17
- * Returns a list of Assistant Files.
17
+ * Returns a list of assistant files.
18
18
  */
19
19
  list(assistantId: string, query?: FileListParams, options?: Core.RequestOptions): Core.PagePromise<AssistantFilesPage, AssistantFile>;
20
20
  list(assistantId: string, options?: Core.RequestOptions): Core.PagePromise<AssistantFilesPage, AssistantFile>;
21
21
  /**
22
- * Delete an Assistant File.
22
+ * Delete an assistant file.
23
23
  */
24
24
  del(assistantId: string, fileId: string, options?: Core.RequestOptions): Core.APIPromise<FileDeleteResponse>;
25
25
  }
@@ -27,7 +27,7 @@ export declare class AssistantFilesPage extends CursorPage<AssistantFile> {
27
27
  }
28
28
  /**
29
29
  * A list of [Files](https://platform.openai.com/docs/api-reference/files) attached
30
- * to an `Assistant`.
30
+ * to an `assistant`.
31
31
  */
32
32
  export interface AssistantFile {
33
33
  /**
@@ -35,11 +35,11 @@ export interface AssistantFile {
35
35
  */
36
36
  id: string;
37
37
  /**
38
- * The Assistant ID that the File is attached to.
38
+ * The assistant ID that the file is attached to.
39
39
  */
40
40
  assistant_id: string;
41
41
  /**
42
- * The Unix timestamp (in seconds) for when the Assistant File was created.
42
+ * The Unix timestamp (in seconds) for when the assistant file was created.
43
43
  */
44
44
  created_at: number;
45
45
  /**
@@ -48,7 +48,7 @@ export interface AssistantFile {
48
48
  object: 'assistant.file';
49
49
  }
50
50
  /**
51
- * Deletes the association between the Assistant and the File, but does not delete
51
+ * Deletes the association between the assistant and the file, but does not delete
52
52
  * the [File](https://platform.openai.com/docs/api-reference/files) object itself.
53
53
  */
54
54
  export interface FileDeleteResponse {
@@ -59,7 +59,7 @@ export interface FileDeleteResponse {
59
59
  export interface FileCreateParams {
60
60
  /**
61
61
  * A [File](https://platform.openai.com/docs/api-reference/files) ID (with
62
- * `purpose="assistants"`) that the Assistant should use. Useful for tools like
62
+ * `purpose="assistants"`) that the assistant should use. Useful for tools like
63
63
  * `retrieval` and `code_interpreter` that can access files.
64
64
  */
65
65
  file_id: string;
@@ -31,9 +31,9 @@ const FilesAPI = __importStar(require("openai/resources/beta/assistants/files"))
31
31
  const pagination_1 = require("openai/pagination");
32
32
  class Files extends resource_1.APIResource {
33
33
  /**
34
- * Create an Assistant File by attaching a
34
+ * Create an assistant file by attaching a
35
35
  * [File](https://platform.openai.com/docs/api-reference/files) to an
36
- * [Assistant](https://platform.openai.com/docs/api-reference/assistants).
36
+ * [assistant](https://platform.openai.com/docs/api-reference/assistants).
37
37
  */
38
38
  create(assistantId, body, options) {
39
39
  return this.post(`/assistants/${assistantId}/files`, {
@@ -62,7 +62,7 @@ class Files extends resource_1.APIResource {
62
62
  });
63
63
  }
64
64
  /**
65
- * Delete an Assistant File.
65
+ * Delete an assistant file.
66
66
  */
67
67
  del(assistantId, fileId, options) {
68
68
  return this.delete(`/assistants/${assistantId}/files/${fileId}`, {
@@ -5,9 +5,9 @@ import * as FilesAPI from 'openai/resources/beta/assistants/files';
5
5
  import { CursorPage } from 'openai/pagination';
6
6
  export class Files extends APIResource {
7
7
  /**
8
- * Create an Assistant File by attaching a
8
+ * Create an assistant file by attaching a
9
9
  * [File](https://platform.openai.com/docs/api-reference/files) to an
10
- * [Assistant](https://platform.openai.com/docs/api-reference/assistants).
10
+ * [assistant](https://platform.openai.com/docs/api-reference/assistants).
11
11
  */
12
12
  create(assistantId, body, options) {
13
13
  return this.post(`/assistants/${assistantId}/files`, {
@@ -36,7 +36,7 @@ export class Files extends APIResource {
36
36
  });
37
37
  }
38
38
  /**
39
- * Delete an Assistant File.
39
+ * Delete an assistant file.
40
40
  */
41
41
  del(assistantId, fileId, options) {
42
42
  return this.delete(`/assistants/${assistantId}/files/${fileId}`, {
@@ -4,11 +4,11 @@ import * as FilesAPI from 'openai/resources/beta/threads/messages/files';
4
4
  import { CursorPage, type CursorPageParams } from 'openai/pagination';
5
5
  export declare class Files extends APIResource {
6
6
  /**
7
- * Retrieves a Message File.
7
+ * Retrieves a message file.
8
8
  */
9
9
  retrieve(threadId: string, messageId: string, fileId: string, options?: Core.RequestOptions): Core.APIPromise<MessageFile>;
10
10
  /**
11
- * Returns a list of Message Files.
11
+ * Returns a list of message files.
12
12
  */
13
13
  list(threadId: string, messageId: string, query?: FileListParams, options?: Core.RequestOptions): Core.PagePromise<MessageFilesPage, MessageFile>;
14
14
  list(threadId: string, messageId: string, options?: Core.RequestOptions): Core.PagePromise<MessageFilesPage, MessageFile>;
@@ -16,7 +16,7 @@ export declare class Files extends APIResource {
16
16
  export declare class MessageFilesPage extends CursorPage<MessageFile> {
17
17
  }
18
18
  /**
19
- * A list of Files attached to a `Message`.
19
+ * A list of files attached to a `message`.
20
20
  */
21
21
  export interface MessageFile {
22
22
  /**
@@ -24,11 +24,11 @@ export interface MessageFile {
24
24
  */
25
25
  id: string;
26
26
  /**
27
- * The Unix timestamp (in seconds) for when the Message File was created.
27
+ * The Unix timestamp (in seconds) for when the message file was created.
28
28
  */
29
29
  created_at: number;
30
30
  /**
31
- * The ID of the [Message](https://platform.openai.com/docs/api-reference/messages)
31
+ * The ID of the [message](https://platform.openai.com/docs/api-reference/messages)
32
32
  * that the [File](https://platform.openai.com/docs/api-reference/files) is
33
33
  * attached to.
34
34
  */
@@ -31,7 +31,7 @@ const FilesAPI = __importStar(require("openai/resources/beta/threads/messages/fi
31
31
  const pagination_1 = require("openai/pagination");
32
32
  class Files extends resource_1.APIResource {
33
33
  /**
34
- * Retrieves a Message File.
34
+ * Retrieves a message file.
35
35
  */
36
36
  retrieve(threadId, messageId, fileId, options) {
37
37
  return this.get(`/threads/${threadId}/messages/${messageId}/files/${fileId}`, {
@@ -5,7 +5,7 @@ import * as FilesAPI from 'openai/resources/beta/threads/messages/files';
5
5
  import { CursorPage } from 'openai/pagination';
6
6
  export class Files extends APIResource {
7
7
  /**
8
- * Retrieves a Message File.
8
+ * Retrieves a message file.
9
9
  */
10
10
  retrieve(threadId, messageId, fileId, options) {
11
11
  return this.get(`/threads/${threadId}/messages/${messageId}/files/${fileId}`, {