openai 4.18.0 → 4.19.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.
Files changed (160) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +1 -1
  3. package/core.d.ts +0 -10
  4. package/core.d.ts.map +1 -1
  5. package/core.js +1 -13
  6. package/core.js.map +1 -1
  7. package/core.mjs +0 -11
  8. package/core.mjs.map +1 -1
  9. package/package.json +1 -1
  10. package/resource.d.ts +1 -7
  11. package/resource.d.ts.map +1 -1
  12. package/resource.js +1 -7
  13. package/resource.js.map +1 -1
  14. package/resource.mjs +1 -7
  15. package/resource.mjs.map +1 -1
  16. package/resources/audio/audio.d.ts.map +1 -1
  17. package/resources/audio/audio.js +3 -3
  18. package/resources/audio/audio.js.map +1 -1
  19. package/resources/audio/audio.mjs +3 -3
  20. package/resources/audio/audio.mjs.map +1 -1
  21. package/resources/audio/speech.js +1 -1
  22. package/resources/audio/speech.js.map +1 -1
  23. package/resources/audio/speech.mjs +1 -1
  24. package/resources/audio/speech.mjs.map +1 -1
  25. package/resources/audio/transcriptions.js +1 -1
  26. package/resources/audio/transcriptions.js.map +1 -1
  27. package/resources/audio/transcriptions.mjs +1 -1
  28. package/resources/audio/transcriptions.mjs.map +1 -1
  29. package/resources/audio/translations.js +1 -1
  30. package/resources/audio/translations.js.map +1 -1
  31. package/resources/audio/translations.mjs +1 -1
  32. package/resources/audio/translations.mjs.map +1 -1
  33. package/resources/beta/assistants/assistants.d.ts.map +1 -1
  34. package/resources/beta/assistants/assistants.js +6 -6
  35. package/resources/beta/assistants/assistants.js.map +1 -1
  36. package/resources/beta/assistants/assistants.mjs +6 -6
  37. package/resources/beta/assistants/assistants.mjs.map +1 -1
  38. package/resources/beta/assistants/files.js +4 -4
  39. package/resources/beta/assistants/files.js.map +1 -1
  40. package/resources/beta/assistants/files.mjs +4 -4
  41. package/resources/beta/assistants/files.mjs.map +1 -1
  42. package/resources/beta/beta.d.ts.map +1 -1
  43. package/resources/beta/beta.js +3 -3
  44. package/resources/beta/beta.js.map +1 -1
  45. package/resources/beta/beta.mjs +3 -3
  46. package/resources/beta/beta.mjs.map +1 -1
  47. package/resources/beta/chat/chat.d.ts.map +1 -1
  48. package/resources/beta/chat/chat.js +1 -1
  49. package/resources/beta/chat/chat.js.map +1 -1
  50. package/resources/beta/chat/chat.mjs +1 -1
  51. package/resources/beta/chat/chat.mjs.map +1 -1
  52. package/resources/beta/chat/completions.js +5 -5
  53. package/resources/beta/chat/completions.js.map +1 -1
  54. package/resources/beta/chat/completions.mjs +5 -5
  55. package/resources/beta/chat/completions.mjs.map +1 -1
  56. package/resources/beta/threads/messages/files.js +2 -2
  57. package/resources/beta/threads/messages/files.js.map +1 -1
  58. package/resources/beta/threads/messages/files.mjs +2 -2
  59. package/resources/beta/threads/messages/files.mjs.map +1 -1
  60. package/resources/beta/threads/messages/messages.d.ts.map +1 -1
  61. package/resources/beta/threads/messages/messages.js +5 -5
  62. package/resources/beta/threads/messages/messages.js.map +1 -1
  63. package/resources/beta/threads/messages/messages.mjs +5 -5
  64. package/resources/beta/threads/messages/messages.mjs.map +1 -1
  65. package/resources/beta/threads/runs/runs.d.ts.map +1 -1
  66. package/resources/beta/threads/runs/runs.js +7 -7
  67. package/resources/beta/threads/runs/runs.js.map +1 -1
  68. package/resources/beta/threads/runs/runs.mjs +7 -7
  69. package/resources/beta/threads/runs/runs.mjs.map +1 -1
  70. package/resources/beta/threads/runs/steps.js +2 -2
  71. package/resources/beta/threads/runs/steps.js.map +1 -1
  72. package/resources/beta/threads/runs/steps.mjs +2 -2
  73. package/resources/beta/threads/runs/steps.mjs.map +1 -1
  74. package/resources/beta/threads/threads.d.ts.map +1 -1
  75. package/resources/beta/threads/threads.js +7 -7
  76. package/resources/beta/threads/threads.js.map +1 -1
  77. package/resources/beta/threads/threads.mjs +7 -7
  78. package/resources/beta/threads/threads.mjs.map +1 -1
  79. package/resources/chat/chat.d.ts.map +1 -1
  80. package/resources/chat/chat.js +1 -1
  81. package/resources/chat/chat.js.map +1 -1
  82. package/resources/chat/chat.mjs +1 -1
  83. package/resources/chat/chat.mjs.map +1 -1
  84. package/resources/chat/completions.js +1 -1
  85. package/resources/chat/completions.js.map +1 -1
  86. package/resources/chat/completions.mjs +1 -1
  87. package/resources/chat/completions.mjs.map +1 -1
  88. package/resources/completions.js +1 -1
  89. package/resources/completions.js.map +1 -1
  90. package/resources/completions.mjs +1 -1
  91. package/resources/completions.mjs.map +1 -1
  92. package/resources/edits.js +1 -1
  93. package/resources/edits.js.map +1 -1
  94. package/resources/edits.mjs +1 -1
  95. package/resources/edits.mjs.map +1 -1
  96. package/resources/embeddings.js +1 -1
  97. package/resources/embeddings.js.map +1 -1
  98. package/resources/embeddings.mjs +1 -1
  99. package/resources/embeddings.mjs.map +1 -1
  100. package/resources/files.js +6 -6
  101. package/resources/files.js.map +1 -1
  102. package/resources/files.mjs +6 -6
  103. package/resources/files.mjs.map +1 -1
  104. package/resources/fine-tunes.js +5 -5
  105. package/resources/fine-tunes.js.map +1 -1
  106. package/resources/fine-tunes.mjs +5 -5
  107. package/resources/fine-tunes.mjs.map +1 -1
  108. package/resources/fine-tuning/fine-tuning.d.ts.map +1 -1
  109. package/resources/fine-tuning/fine-tuning.js +1 -1
  110. package/resources/fine-tuning/fine-tuning.js.map +1 -1
  111. package/resources/fine-tuning/fine-tuning.mjs +1 -1
  112. package/resources/fine-tuning/fine-tuning.mjs.map +1 -1
  113. package/resources/fine-tuning/jobs.js +5 -5
  114. package/resources/fine-tuning/jobs.js.map +1 -1
  115. package/resources/fine-tuning/jobs.mjs +5 -5
  116. package/resources/fine-tuning/jobs.mjs.map +1 -1
  117. package/resources/images.js +3 -3
  118. package/resources/images.js.map +1 -1
  119. package/resources/images.mjs +3 -3
  120. package/resources/images.mjs.map +1 -1
  121. package/resources/models.js +3 -3
  122. package/resources/models.js.map +1 -1
  123. package/resources/models.mjs +3 -3
  124. package/resources/models.mjs.map +1 -1
  125. package/resources/moderations.js +1 -1
  126. package/resources/moderations.js.map +1 -1
  127. package/resources/moderations.mjs +1 -1
  128. package/resources/moderations.mjs.map +1 -1
  129. package/src/core.ts +0 -21
  130. package/src/resource.ts +3 -16
  131. package/src/resources/audio/audio.ts +3 -3
  132. package/src/resources/audio/speech.ts +1 -1
  133. package/src/resources/audio/transcriptions.ts +1 -1
  134. package/src/resources/audio/translations.ts +1 -1
  135. package/src/resources/beta/assistants/assistants.ts +6 -6
  136. package/src/resources/beta/assistants/files.ts +4 -4
  137. package/src/resources/beta/beta.ts +3 -3
  138. package/src/resources/beta/chat/chat.ts +1 -1
  139. package/src/resources/beta/chat/completions.ts +5 -5
  140. package/src/resources/beta/threads/messages/files.ts +2 -2
  141. package/src/resources/beta/threads/messages/messages.ts +5 -5
  142. package/src/resources/beta/threads/runs/runs.ts +7 -7
  143. package/src/resources/beta/threads/runs/steps.ts +2 -2
  144. package/src/resources/beta/threads/threads.ts +7 -7
  145. package/src/resources/chat/chat.ts +1 -1
  146. package/src/resources/chat/completions.ts +1 -1
  147. package/src/resources/completions.ts +1 -1
  148. package/src/resources/edits.ts +1 -1
  149. package/src/resources/embeddings.ts +1 -1
  150. package/src/resources/files.ts +6 -6
  151. package/src/resources/fine-tunes.ts +5 -5
  152. package/src/resources/fine-tuning/fine-tuning.ts +1 -1
  153. package/src/resources/fine-tuning/jobs.ts +5 -5
  154. package/src/resources/images.ts +3 -3
  155. package/src/resources/models.ts +3 -3
  156. package/src/resources/moderations.ts +1 -1
  157. package/src/version.ts +1 -1
  158. package/version.d.ts +1 -1
  159. package/version.js +1 -1
  160. package/version.mjs +1 -1
@@ -17,7 +17,7 @@ export class Files extends APIResource {
17
17
  body: FileCreateParams,
18
18
  options?: Core.RequestOptions,
19
19
  ): Core.APIPromise<AssistantFile> {
20
- return this.post(`/assistants/${assistantId}/files`, {
20
+ return this._client.post(`/assistants/${assistantId}/files`, {
21
21
  body,
22
22
  ...options,
23
23
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
@@ -32,7 +32,7 @@ export class Files extends APIResource {
32
32
  fileId: string,
33
33
  options?: Core.RequestOptions,
34
34
  ): Core.APIPromise<AssistantFile> {
35
- return this.get(`/assistants/${assistantId}/files/${fileId}`, {
35
+ return this._client.get(`/assistants/${assistantId}/files/${fileId}`, {
36
36
  ...options,
37
37
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
38
38
  });
@@ -58,7 +58,7 @@ export class Files extends APIResource {
58
58
  if (isRequestOptions(query)) {
59
59
  return this.list(assistantId, {}, query);
60
60
  }
61
- return this.getAPIList(`/assistants/${assistantId}/files`, AssistantFilesPage, {
61
+ return this._client.getAPIList(`/assistants/${assistantId}/files`, AssistantFilesPage, {
62
62
  query,
63
63
  ...options,
64
64
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
@@ -73,7 +73,7 @@ export class Files extends APIResource {
73
73
  fileId: string,
74
74
  options?: Core.RequestOptions,
75
75
  ): Core.APIPromise<FileDeleteResponse> {
76
- return this.delete(`/assistants/${assistantId}/files/${fileId}`, {
76
+ return this._client.delete(`/assistants/${assistantId}/files/${fileId}`, {
77
77
  ...options,
78
78
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
79
79
  });
@@ -6,9 +6,9 @@ import * as ChatAPI from "./chat/chat";
6
6
  import * as ThreadsAPI from "./threads/threads";
7
7
 
8
8
  export class Beta extends APIResource {
9
- chat: ChatAPI.Chat = new ChatAPI.Chat(this.client);
10
- assistants: AssistantsAPI.Assistants = new AssistantsAPI.Assistants(this.client);
11
- threads: ThreadsAPI.Threads = new ThreadsAPI.Threads(this.client);
9
+ chat: ChatAPI.Chat = new ChatAPI.Chat(this._client);
10
+ assistants: AssistantsAPI.Assistants = new AssistantsAPI.Assistants(this._client);
11
+ threads: ThreadsAPI.Threads = new ThreadsAPI.Threads(this._client);
12
12
  }
13
13
 
14
14
  export namespace Beta {
@@ -4,7 +4,7 @@ import { APIResource } from "../../../resource";
4
4
  import * as CompletionsAPI from "./completions";
5
5
 
6
6
  export class Chat extends APIResource {
7
- completions: CompletionsAPI.Completions = new CompletionsAPI.Completions(this.client);
7
+ completions: CompletionsAPI.Completions = new CompletionsAPI.Completions(this._client);
8
8
  }
9
9
 
10
10
  export namespace Chat {
@@ -53,13 +53,13 @@ export class Completions extends APIResource {
53
53
  ): ChatCompletionRunner | ChatCompletionStreamingRunner {
54
54
  if (body.stream) {
55
55
  return ChatCompletionStreamingRunner.runFunctions(
56
- this.client.chat.completions,
56
+ this._client.chat.completions,
57
57
  body as ChatCompletionStreamingFunctionRunnerParams<FunctionsArgs>,
58
58
  options,
59
59
  );
60
60
  }
61
61
  return ChatCompletionRunner.runFunctions(
62
- this.client.chat.completions,
62
+ this._client.chat.completions,
63
63
  body as ChatCompletionFunctionRunnerParams<FunctionsArgs>,
64
64
  options,
65
65
  );
@@ -90,13 +90,13 @@ export class Completions extends APIResource {
90
90
  ): ChatCompletionRunner | ChatCompletionStreamingRunner {
91
91
  if (body.stream) {
92
92
  return ChatCompletionStreamingRunner.runTools(
93
- this.client.chat.completions,
93
+ this._client.chat.completions,
94
94
  body as ChatCompletionStreamingToolRunnerParams<FunctionsArgs>,
95
95
  options,
96
96
  );
97
97
  }
98
98
  return ChatCompletionRunner.runTools(
99
- this.client.chat.completions,
99
+ this._client.chat.completions,
100
100
  body as ChatCompletionToolRunnerParams<FunctionsArgs>,
101
101
  options,
102
102
  );
@@ -106,6 +106,6 @@ export class Completions extends APIResource {
106
106
  * Creates a chat completion stream
107
107
  */
108
108
  stream(body: ChatCompletionStreamParams, options?: Core.RequestOptions): ChatCompletionStream {
109
- return ChatCompletionStream.createChatCompletion(this.client.chat.completions, body, options);
109
+ return ChatCompletionStream.createChatCompletion(this._client.chat.completions, body, options);
110
110
  }
111
111
  }
@@ -16,7 +16,7 @@ export class Files extends APIResource {
16
16
  fileId: string,
17
17
  options?: Core.RequestOptions,
18
18
  ): Core.APIPromise<MessageFile> {
19
- return this.get(`/threads/${threadId}/messages/${messageId}/files/${fileId}`, {
19
+ return this._client.get(`/threads/${threadId}/messages/${messageId}/files/${fileId}`, {
20
20
  ...options,
21
21
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
22
22
  });
@@ -45,7 +45,7 @@ export class Files extends APIResource {
45
45
  if (isRequestOptions(query)) {
46
46
  return this.list(threadId, messageId, {}, query);
47
47
  }
48
- return this.getAPIList(`/threads/${threadId}/messages/${messageId}/files`, MessageFilesPage, {
48
+ return this._client.getAPIList(`/threads/${threadId}/messages/${messageId}/files`, MessageFilesPage, {
49
49
  query,
50
50
  ...options,
51
51
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
@@ -8,7 +8,7 @@ import * as FilesAPI from "./files";
8
8
  import { CursorPage, type CursorPageParams } from "../../../../pagination";
9
9
 
10
10
  export class Messages extends APIResource {
11
- files: FilesAPI.Files = new FilesAPI.Files(this.client);
11
+ files: FilesAPI.Files = new FilesAPI.Files(this._client);
12
12
 
13
13
  /**
14
14
  * Create a message.
@@ -18,7 +18,7 @@ export class Messages extends APIResource {
18
18
  body: MessageCreateParams,
19
19
  options?: Core.RequestOptions,
20
20
  ): Core.APIPromise<ThreadMessage> {
21
- return this.post(`/threads/${threadId}/messages`, {
21
+ return this._client.post(`/threads/${threadId}/messages`, {
22
22
  body,
23
23
  ...options,
24
24
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
@@ -33,7 +33,7 @@ export class Messages extends APIResource {
33
33
  messageId: string,
34
34
  options?: Core.RequestOptions,
35
35
  ): Core.APIPromise<ThreadMessage> {
36
- return this.get(`/threads/${threadId}/messages/${messageId}`, {
36
+ return this._client.get(`/threads/${threadId}/messages/${messageId}`, {
37
37
  ...options,
38
38
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
39
39
  });
@@ -48,7 +48,7 @@ export class Messages extends APIResource {
48
48
  body: MessageUpdateParams,
49
49
  options?: Core.RequestOptions,
50
50
  ): Core.APIPromise<ThreadMessage> {
51
- return this.post(`/threads/${threadId}/messages/${messageId}`, {
51
+ return this._client.post(`/threads/${threadId}/messages/${messageId}`, {
52
52
  body,
53
53
  ...options,
54
54
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
@@ -72,7 +72,7 @@ export class Messages extends APIResource {
72
72
  if (isRequestOptions(query)) {
73
73
  return this.list(threadId, {}, query);
74
74
  }
75
- return this.getAPIList(`/threads/${threadId}/messages`, ThreadMessagesPage, {
75
+ return this._client.getAPIList(`/threads/${threadId}/messages`, ThreadMessagesPage, {
76
76
  query,
77
77
  ...options,
78
78
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
@@ -9,13 +9,13 @@ import * as StepsAPI from "./steps";
9
9
  import { CursorPage, type CursorPageParams } from "../../../../pagination";
10
10
 
11
11
  export class Runs extends APIResource {
12
- steps: StepsAPI.Steps = new StepsAPI.Steps(this.client);
12
+ steps: StepsAPI.Steps = new StepsAPI.Steps(this._client);
13
13
 
14
14
  /**
15
15
  * Create a run.
16
16
  */
17
17
  create(threadId: string, body: RunCreateParams, options?: Core.RequestOptions): Core.APIPromise<Run> {
18
- return this.post(`/threads/${threadId}/runs`, {
18
+ return this._client.post(`/threads/${threadId}/runs`, {
19
19
  body,
20
20
  ...options,
21
21
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
@@ -26,7 +26,7 @@ export class Runs extends APIResource {
26
26
  * Retrieves a run.
27
27
  */
28
28
  retrieve(threadId: string, runId: string, options?: Core.RequestOptions): Core.APIPromise<Run> {
29
- return this.get(`/threads/${threadId}/runs/${runId}`, {
29
+ return this._client.get(`/threads/${threadId}/runs/${runId}`, {
30
30
  ...options,
31
31
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
32
32
  });
@@ -41,7 +41,7 @@ export class Runs extends APIResource {
41
41
  body: RunUpdateParams,
42
42
  options?: Core.RequestOptions,
43
43
  ): Core.APIPromise<Run> {
44
- return this.post(`/threads/${threadId}/runs/${runId}`, {
44
+ return this._client.post(`/threads/${threadId}/runs/${runId}`, {
45
45
  body,
46
46
  ...options,
47
47
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
@@ -65,7 +65,7 @@ export class Runs extends APIResource {
65
65
  if (isRequestOptions(query)) {
66
66
  return this.list(threadId, {}, query);
67
67
  }
68
- return this.getAPIList(`/threads/${threadId}/runs`, RunsPage, {
68
+ return this._client.getAPIList(`/threads/${threadId}/runs`, RunsPage, {
69
69
  query,
70
70
  ...options,
71
71
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
@@ -76,7 +76,7 @@ export class Runs extends APIResource {
76
76
  * Cancels a run that is `in_progress`.
77
77
  */
78
78
  cancel(threadId: string, runId: string, options?: Core.RequestOptions): Core.APIPromise<Run> {
79
- return this.post(`/threads/${threadId}/runs/${runId}/cancel`, {
79
+ return this._client.post(`/threads/${threadId}/runs/${runId}/cancel`, {
80
80
  ...options,
81
81
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
82
82
  });
@@ -94,7 +94,7 @@ export class Runs extends APIResource {
94
94
  body: RunSubmitToolOutputsParams,
95
95
  options?: Core.RequestOptions,
96
96
  ): Core.APIPromise<Run> {
97
- return this.post(`/threads/${threadId}/runs/${runId}/submit_tool_outputs`, {
97
+ return this._client.post(`/threads/${threadId}/runs/${runId}/submit_tool_outputs`, {
98
98
  body,
99
99
  ...options,
100
100
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
@@ -16,7 +16,7 @@ export class Steps extends APIResource {
16
16
  stepId: string,
17
17
  options?: Core.RequestOptions,
18
18
  ): Core.APIPromise<RunStep> {
19
- return this.get(`/threads/${threadId}/runs/${runId}/steps/${stepId}`, {
19
+ return this._client.get(`/threads/${threadId}/runs/${runId}/steps/${stepId}`, {
20
20
  ...options,
21
21
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
22
22
  });
@@ -45,7 +45,7 @@ export class Steps extends APIResource {
45
45
  if (isRequestOptions(query)) {
46
46
  return this.list(threadId, runId, {}, query);
47
47
  }
48
- return this.getAPIList(`/threads/${threadId}/runs/${runId}/steps`, RunStepsPage, {
48
+ return this._client.getAPIList(`/threads/${threadId}/runs/${runId}/steps`, RunStepsPage, {
49
49
  query,
50
50
  ...options,
51
51
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
@@ -9,8 +9,8 @@ import * as MessagesAPI from "./messages/messages";
9
9
  import * as RunsAPI from "./runs/runs";
10
10
 
11
11
  export class Threads extends APIResource {
12
- runs: RunsAPI.Runs = new RunsAPI.Runs(this.client);
13
- messages: MessagesAPI.Messages = new MessagesAPI.Messages(this.client);
12
+ runs: RunsAPI.Runs = new RunsAPI.Runs(this._client);
13
+ messages: MessagesAPI.Messages = new MessagesAPI.Messages(this._client);
14
14
 
15
15
  /**
16
16
  * Create a thread.
@@ -24,7 +24,7 @@ export class Threads extends APIResource {
24
24
  if (isRequestOptions(body)) {
25
25
  return this.create({}, body);
26
26
  }
27
- return this.post('/threads', {
27
+ return this._client.post('/threads', {
28
28
  body,
29
29
  ...options,
30
30
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
@@ -35,7 +35,7 @@ export class Threads extends APIResource {
35
35
  * Retrieves a thread.
36
36
  */
37
37
  retrieve(threadId: string, options?: Core.RequestOptions): Core.APIPromise<Thread> {
38
- return this.get(`/threads/${threadId}`, {
38
+ return this._client.get(`/threads/${threadId}`, {
39
39
  ...options,
40
40
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
41
41
  });
@@ -45,7 +45,7 @@ export class Threads extends APIResource {
45
45
  * Modifies a thread.
46
46
  */
47
47
  update(threadId: string, body: ThreadUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Thread> {
48
- return this.post(`/threads/${threadId}`, {
48
+ return this._client.post(`/threads/${threadId}`, {
49
49
  body,
50
50
  ...options,
51
51
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
@@ -56,7 +56,7 @@ export class Threads extends APIResource {
56
56
  * Delete a thread.
57
57
  */
58
58
  del(threadId: string, options?: Core.RequestOptions): Core.APIPromise<ThreadDeleted> {
59
- return this.delete(`/threads/${threadId}`, {
59
+ return this._client.delete(`/threads/${threadId}`, {
60
60
  ...options,
61
61
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
62
62
  });
@@ -66,7 +66,7 @@ export class Threads extends APIResource {
66
66
  * Create a thread and run it in one request.
67
67
  */
68
68
  createAndRun(body: ThreadCreateAndRunParams, options?: Core.RequestOptions): Core.APIPromise<RunsAPI.Run> {
69
- return this.post('/threads/runs', {
69
+ return this._client.post('/threads/runs', {
70
70
  body,
71
71
  ...options,
72
72
  headers: { 'OpenAI-Beta': 'assistants=v1', ...options?.headers },
@@ -4,7 +4,7 @@ import { APIResource } from "../../resource";
4
4
  import * as CompletionsAPI from "./completions";
5
5
 
6
6
  export class Chat extends APIResource {
7
- completions: CompletionsAPI.Completions = new CompletionsAPI.Completions(this.client);
7
+ completions: CompletionsAPI.Completions = new CompletionsAPI.Completions(this._client);
8
8
  }
9
9
 
10
10
  export namespace Chat {
@@ -28,7 +28,7 @@ export class Completions extends APIResource {
28
28
  body: ChatCompletionCreateParams,
29
29
  options?: Core.RequestOptions,
30
30
  ): APIPromise<ChatCompletion> | APIPromise<Stream<ChatCompletionChunk>> {
31
- return this.post('/chat/completions', { body, ...options, stream: body.stream ?? false }) as
31
+ return this._client.post('/chat/completions', { body, ...options, stream: body.stream ?? false }) as
32
32
  | APIPromise<ChatCompletion>
33
33
  | APIPromise<Stream<ChatCompletionChunk>>;
34
34
  }
@@ -23,7 +23,7 @@ export class Completions extends APIResource {
23
23
  body: CompletionCreateParams,
24
24
  options?: Core.RequestOptions,
25
25
  ): APIPromise<Completion> | APIPromise<Stream<Completion>> {
26
- return this.post('/completions', { body, ...options, stream: body.stream ?? false }) as
26
+ return this._client.post('/completions', { body, ...options, stream: body.stream ?? false }) as
27
27
  | APIPromise<Completion>
28
28
  | APIPromise<Stream<Completion>>;
29
29
  }
@@ -14,7 +14,7 @@ export class Edits extends APIResource {
14
14
  * https://openai.com/blog/gpt-4-api-general-availability#deprecation-of-the-edits-api
15
15
  */
16
16
  create(body: EditCreateParams, options?: Core.RequestOptions): Core.APIPromise<Edit> {
17
- return this.post('/edits', { body, ...options });
17
+ return this._client.post('/edits', { body, ...options });
18
18
  }
19
19
  }
20
20
 
@@ -12,7 +12,7 @@ export class Embeddings extends APIResource {
12
12
  body: EmbeddingCreateParams,
13
13
  options?: Core.RequestOptions,
14
14
  ): Core.APIPromise<CreateEmbeddingResponse> {
15
- return this.post('/embeddings', { body, ...options });
15
+ return this._client.post('/embeddings', { body, ...options });
16
16
  }
17
17
  }
18
18
 
@@ -24,14 +24,14 @@ export class Files extends APIResource {
24
24
  * storage limits.
25
25
  */
26
26
  create(body: FileCreateParams, options?: Core.RequestOptions): Core.APIPromise<FileObject> {
27
- return this.post('/files', multipartFormRequestOptions({ body, ...options }));
27
+ return this._client.post('/files', multipartFormRequestOptions({ body, ...options }));
28
28
  }
29
29
 
30
30
  /**
31
31
  * Returns information about a specific file.
32
32
  */
33
33
  retrieve(fileId: string, options?: Core.RequestOptions): Core.APIPromise<FileObject> {
34
- return this.get(`/files/${fileId}`, options);
34
+ return this._client.get(`/files/${fileId}`, options);
35
35
  }
36
36
 
37
37
  /**
@@ -46,21 +46,21 @@ export class Files extends APIResource {
46
46
  if (isRequestOptions(query)) {
47
47
  return this.list({}, query);
48
48
  }
49
- return this.getAPIList('/files', FileObjectsPage, { query, ...options });
49
+ return this._client.getAPIList('/files', FileObjectsPage, { query, ...options });
50
50
  }
51
51
 
52
52
  /**
53
53
  * Delete a file.
54
54
  */
55
55
  del(fileId: string, options?: Core.RequestOptions): Core.APIPromise<FileDeleted> {
56
- return this.delete(`/files/${fileId}`, options);
56
+ return this._client.delete(`/files/${fileId}`, options);
57
57
  }
58
58
 
59
59
  /**
60
60
  * Returns the contents of the specified file.
61
61
  */
62
62
  content(fileId: string, options?: Core.RequestOptions): Core.APIPromise<Response> {
63
- return this.get(`/files/${fileId}/content`, { ...options, __binaryResponse: true });
63
+ return this._client.get(`/files/${fileId}/content`, { ...options, __binaryResponse: true });
64
64
  }
65
65
 
66
66
  /**
@@ -69,7 +69,7 @@ export class Files extends APIResource {
69
69
  * @deprecated The `.content()` method should be used instead
70
70
  */
71
71
  retrieveContent(fileId: string, options?: Core.RequestOptions): Core.APIPromise<string> {
72
- return this.get(`/files/${fileId}/content`, {
72
+ return this._client.get(`/files/${fileId}/content`, {
73
73
  ...options,
74
74
  headers: { Accept: 'application/json', ...options?.headers },
75
75
  });
@@ -18,7 +18,7 @@ export class FineTunes extends APIResource {
18
18
  * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/legacy-fine-tuning)
19
19
  */
20
20
  create(body: FineTuneCreateParams, options?: Core.RequestOptions): Core.APIPromise<FineTune> {
21
- return this.post('/fine-tunes', { body, ...options });
21
+ return this._client.post('/fine-tunes', { body, ...options });
22
22
  }
23
23
 
24
24
  /**
@@ -27,21 +27,21 @@ export class FineTunes extends APIResource {
27
27
  * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/legacy-fine-tuning)
28
28
  */
29
29
  retrieve(fineTuneId: string, options?: Core.RequestOptions): Core.APIPromise<FineTune> {
30
- return this.get(`/fine-tunes/${fineTuneId}`, options);
30
+ return this._client.get(`/fine-tunes/${fineTuneId}`, options);
31
31
  }
32
32
 
33
33
  /**
34
34
  * List your organization's fine-tuning jobs
35
35
  */
36
36
  list(options?: Core.RequestOptions): Core.PagePromise<FineTunesPage, FineTune> {
37
- return this.getAPIList('/fine-tunes', FineTunesPage, options);
37
+ return this._client.getAPIList('/fine-tunes', FineTunesPage, options);
38
38
  }
39
39
 
40
40
  /**
41
41
  * Immediately cancel a fine-tune job.
42
42
  */
43
43
  cancel(fineTuneId: string, options?: Core.RequestOptions): Core.APIPromise<FineTune> {
44
- return this.post(`/fine-tunes/${fineTuneId}/cancel`, options);
44
+ return this._client.post(`/fine-tunes/${fineTuneId}/cancel`, options);
45
45
  }
46
46
 
47
47
  /**
@@ -67,7 +67,7 @@ export class FineTunes extends APIResource {
67
67
  query?: FineTuneListEventsParams | undefined,
68
68
  options?: Core.RequestOptions,
69
69
  ): APIPromise<FineTuneEventsListResponse> | APIPromise<Stream<FineTuneEvent>> {
70
- return this.get(`/fine-tunes/${fineTuneId}/events`, {
70
+ return this._client.get(`/fine-tunes/${fineTuneId}/events`, {
71
71
  query,
72
72
  timeout: 86400000,
73
73
  ...options,
@@ -4,7 +4,7 @@ import { APIResource } from "../../resource";
4
4
  import * as JobsAPI from "./jobs";
5
5
 
6
6
  export class FineTuning extends APIResource {
7
- jobs: JobsAPI.Jobs = new JobsAPI.Jobs(this.client);
7
+ jobs: JobsAPI.Jobs = new JobsAPI.Jobs(this._client);
8
8
  }
9
9
 
10
10
  export namespace FineTuning {
@@ -16,7 +16,7 @@ export class Jobs extends APIResource {
16
16
  * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
17
17
  */
18
18
  create(body: JobCreateParams, options?: Core.RequestOptions): Core.APIPromise<FineTuningJob> {
19
- return this.post('/fine_tuning/jobs', { body, ...options });
19
+ return this._client.post('/fine_tuning/jobs', { body, ...options });
20
20
  }
21
21
 
22
22
  /**
@@ -25,7 +25,7 @@ export class Jobs extends APIResource {
25
25
  * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/fine-tuning)
26
26
  */
27
27
  retrieve(fineTuningJobId: string, options?: Core.RequestOptions): Core.APIPromise<FineTuningJob> {
28
- return this.get(`/fine_tuning/jobs/${fineTuningJobId}`, options);
28
+ return this._client.get(`/fine_tuning/jobs/${fineTuningJobId}`, options);
29
29
  }
30
30
 
31
31
  /**
@@ -43,14 +43,14 @@ export class Jobs extends APIResource {
43
43
  if (isRequestOptions(query)) {
44
44
  return this.list({}, query);
45
45
  }
46
- return this.getAPIList('/fine_tuning/jobs', FineTuningJobsPage, { query, ...options });
46
+ return this._client.getAPIList('/fine_tuning/jobs', FineTuningJobsPage, { query, ...options });
47
47
  }
48
48
 
49
49
  /**
50
50
  * Immediately cancel a fine-tune job.
51
51
  */
52
52
  cancel(fineTuningJobId: string, options?: Core.RequestOptions): Core.APIPromise<FineTuningJob> {
53
- return this.post(`/fine_tuning/jobs/${fineTuningJobId}/cancel`, options);
53
+ return this._client.post(`/fine_tuning/jobs/${fineTuningJobId}/cancel`, options);
54
54
  }
55
55
 
56
56
  /**
@@ -73,7 +73,7 @@ export class Jobs extends APIResource {
73
73
  if (isRequestOptions(query)) {
74
74
  return this.listEvents(fineTuningJobId, {}, query);
75
75
  }
76
- return this.getAPIList(`/fine_tuning/jobs/${fineTuningJobId}/events`, FineTuningJobEventsPage, {
76
+ return this._client.getAPIList(`/fine_tuning/jobs/${fineTuningJobId}/events`, FineTuningJobEventsPage, {
77
77
  query,
78
78
  ...options,
79
79
  });
@@ -13,21 +13,21 @@ export class Images extends APIResource {
13
13
  body: ImageCreateVariationParams,
14
14
  options?: Core.RequestOptions,
15
15
  ): Core.APIPromise<ImagesResponse> {
16
- return this.post('/images/variations', multipartFormRequestOptions({ body, ...options }));
16
+ return this._client.post('/images/variations', multipartFormRequestOptions({ body, ...options }));
17
17
  }
18
18
 
19
19
  /**
20
20
  * Creates an edited or extended image given an original image and a prompt.
21
21
  */
22
22
  edit(body: ImageEditParams, options?: Core.RequestOptions): Core.APIPromise<ImagesResponse> {
23
- return this.post('/images/edits', multipartFormRequestOptions({ body, ...options }));
23
+ return this._client.post('/images/edits', multipartFormRequestOptions({ body, ...options }));
24
24
  }
25
25
 
26
26
  /**
27
27
  * Creates an image given a prompt.
28
28
  */
29
29
  generate(body: ImageGenerateParams, options?: Core.RequestOptions): Core.APIPromise<ImagesResponse> {
30
- return this.post('/images/generations', { body, ...options });
30
+ return this._client.post('/images/generations', { body, ...options });
31
31
  }
32
32
  }
33
33
 
@@ -11,7 +11,7 @@ export class Models extends APIResource {
11
11
  * the owner and permissioning.
12
12
  */
13
13
  retrieve(model: string, options?: Core.RequestOptions): Core.APIPromise<Model> {
14
- return this.get(`/models/${model}`, options);
14
+ return this._client.get(`/models/${model}`, options);
15
15
  }
16
16
 
17
17
  /**
@@ -19,7 +19,7 @@ export class Models extends APIResource {
19
19
  * one such as the owner and availability.
20
20
  */
21
21
  list(options?: Core.RequestOptions): Core.PagePromise<ModelsPage, Model> {
22
- return this.getAPIList('/models', ModelsPage, options);
22
+ return this._client.getAPIList('/models', ModelsPage, options);
23
23
  }
24
24
 
25
25
  /**
@@ -27,7 +27,7 @@ export class Models extends APIResource {
27
27
  * delete a model.
28
28
  */
29
29
  del(model: string, options?: Core.RequestOptions): Core.APIPromise<ModelDeleted> {
30
- return this.delete(`/models/${model}`, options);
30
+ return this._client.delete(`/models/${model}`, options);
31
31
  }
32
32
  }
33
33
 
@@ -12,7 +12,7 @@ export class Moderations extends APIResource {
12
12
  body: ModerationCreateParams,
13
13
  options?: Core.RequestOptions,
14
14
  ): Core.APIPromise<ModerationCreateResponse> {
15
- return this.post('/moderations', { body, ...options });
15
+ return this._client.post('/moderations', { body, ...options });
16
16
  }
17
17
  }
18
18
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '4.18.0'; // x-release-please-version
1
+ export const VERSION = '4.19.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "4.18.0";
1
+ export declare const VERSION = "4.19.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '4.18.0'; // x-release-please-version
4
+ exports.VERSION = '4.19.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '4.18.0'; // x-release-please-version
1
+ export const VERSION = '4.19.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map