openai 4.8.0 → 4.9.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 (319) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +4 -0
  3. package/_shims/MultipartBody.d.ts +9 -0
  4. package/_shims/MultipartBody.d.ts.map +1 -0
  5. package/_shims/MultipartBody.js +16 -0
  6. package/_shims/MultipartBody.js.map +1 -0
  7. package/_shims/MultipartBody.mjs +12 -0
  8. package/_shims/MultipartBody.mjs.map +1 -0
  9. package/_shims/README.md +46 -0
  10. package/{src/_shims/ReadableStream-node.ts → _shims/auto/runtime-bun.d.ts} +2 -3
  11. package/_shims/auto/runtime-bun.d.ts.map +1 -0
  12. package/_shims/auto/runtime-bun.js +21 -0
  13. package/_shims/auto/runtime-bun.js.map +1 -0
  14. package/_shims/auto/runtime-bun.mjs +2 -0
  15. package/_shims/auto/runtime-bun.mjs.map +1 -0
  16. package/_shims/auto/runtime-node.d.ts +5 -0
  17. package/_shims/auto/runtime-node.d.ts.map +1 -0
  18. package/_shims/auto/runtime-node.js +21 -0
  19. package/_shims/auto/runtime-node.js.map +1 -0
  20. package/_shims/auto/runtime-node.mjs +2 -0
  21. package/_shims/auto/runtime-node.mjs.map +1 -0
  22. package/_shims/auto/runtime.d.ts +5 -0
  23. package/_shims/auto/runtime.d.ts.map +1 -0
  24. package/_shims/auto/runtime.js +21 -0
  25. package/_shims/auto/runtime.js.map +1 -0
  26. package/_shims/auto/runtime.mjs +2 -0
  27. package/_shims/auto/runtime.mjs.map +1 -0
  28. package/_shims/auto/types-node.d.ts +5 -0
  29. package/_shims/auto/types-node.d.ts.map +1 -0
  30. package/_shims/auto/types-node.js +21 -0
  31. package/_shims/auto/types-node.js.map +1 -0
  32. package/_shims/auto/types-node.mjs +2 -0
  33. package/_shims/auto/types-node.mjs.map +1 -0
  34. package/_shims/auto/types.d.ts +99 -0
  35. package/_shims/{ReadableStream.js → auto/types.js} +0 -2
  36. package/{src/_shims/ReadableStream.js → _shims/auto/types.mjs} +0 -2
  37. package/_shims/bun-runtime.d.ts +6 -0
  38. package/_shims/bun-runtime.d.ts.map +1 -0
  39. package/_shims/bun-runtime.js +14 -0
  40. package/_shims/bun-runtime.js.map +1 -0
  41. package/_shims/bun-runtime.mjs +10 -0
  42. package/_shims/bun-runtime.mjs.map +1 -0
  43. package/_shims/index.d.ts +79 -0
  44. package/_shims/index.js +13 -0
  45. package/_shims/index.mjs +7 -0
  46. package/_shims/manual-types.d.ts +12 -0
  47. package/_shims/manual-types.js +3 -0
  48. package/_shims/manual-types.mjs +3 -0
  49. package/_shims/node-runtime.d.ts +3 -0
  50. package/_shims/node-runtime.d.ts.map +1 -0
  51. package/_shims/node-runtime.js +87 -0
  52. package/_shims/node-runtime.js.map +1 -0
  53. package/_shims/node-runtime.mjs +54 -0
  54. package/_shims/node-runtime.mjs.map +1 -0
  55. package/_shims/node-types.d.ts +42 -0
  56. package/_shims/node-types.js +3 -0
  57. package/_shims/node-types.mjs +3 -0
  58. package/_shims/registry.d.ts +35 -0
  59. package/_shims/registry.d.ts.map +1 -0
  60. package/_shims/registry.js +39 -0
  61. package/_shims/registry.js.map +1 -0
  62. package/_shims/registry.mjs +35 -0
  63. package/_shims/registry.mjs.map +1 -0
  64. package/_shims/web-runtime.d.ts +5 -0
  65. package/_shims/web-runtime.d.ts.map +1 -0
  66. package/_shims/web-runtime.js +70 -0
  67. package/_shims/web-runtime.js.map +1 -0
  68. package/_shims/web-runtime.mjs +63 -0
  69. package/_shims/web-runtime.mjs.map +1 -0
  70. package/_shims/web-types.d.ts +82 -0
  71. package/_shims/web-types.js +3 -0
  72. package/_shims/web-types.mjs +3 -0
  73. package/core.d.ts +170 -218
  74. package/core.d.ts.map +1 -1
  75. package/core.js +679 -737
  76. package/core.js.map +1 -1
  77. package/core.mjs +673 -688
  78. package/core.mjs.map +1 -1
  79. package/error.d.ts +32 -34
  80. package/error.js +95 -109
  81. package/error.mjs +92 -94
  82. package/index.d.mts +164 -175
  83. package/index.d.ts +164 -175
  84. package/index.d.ts.map +1 -1
  85. package/index.js +110 -161
  86. package/index.mjs +88 -109
  87. package/package.json +31 -58
  88. package/pagination.d.ts +31 -41
  89. package/pagination.js +52 -48
  90. package/pagination.mjs +50 -46
  91. package/resource.d.ts +10 -10
  92. package/resource.js +12 -12
  93. package/resource.mjs +10 -10
  94. package/resources/audio/audio.d.ts +12 -12
  95. package/resources/audio/audio.js +33 -50
  96. package/resources/audio/audio.mjs +11 -11
  97. package/resources/audio/index.d.ts +4 -4
  98. package/resources/audio/index.js +9 -24
  99. package/resources/audio/index.mjs +4 -4
  100. package/resources/audio/transcriptions.d.ts +44 -44
  101. package/resources/audio/transcriptions.js +13 -12
  102. package/resources/audio/transcriptions.mjs +9 -8
  103. package/resources/audio/translations.d.ts +38 -38
  104. package/resources/audio/translations.js +13 -12
  105. package/resources/audio/translations.mjs +9 -8
  106. package/resources/chat/chat.d.ts +17 -17
  107. package/resources/chat/chat.js +30 -47
  108. package/resources/chat/chat.mjs +8 -8
  109. package/resources/chat/completions.d.ts +330 -353
  110. package/resources/chat/completions.js +10 -13
  111. package/resources/chat/completions.mjs +7 -10
  112. package/resources/chat/index.d.ts +3 -17
  113. package/resources/chat/index.js +7 -17
  114. package/resources/chat/index.mjs +3 -3
  115. package/resources/completions.d.ts +216 -232
  116. package/resources/completions.js +10 -13
  117. package/resources/completions.mjs +7 -10
  118. package/resources/edits.d.ts +73 -73
  119. package/resources/edits.js +16 -15
  120. package/resources/edits.mjs +13 -12
  121. package/resources/embeddings.d.ts +73 -76
  122. package/resources/embeddings.js +12 -11
  123. package/resources/embeddings.mjs +9 -8
  124. package/resources/files.d.ts +91 -96
  125. package/resources/files.js +64 -65
  126. package/resources/files.mjs +57 -58
  127. package/resources/fine-tunes.d.ts +277 -290
  128. package/resources/fine-tunes.js +49 -50
  129. package/resources/fine-tunes.mjs +45 -46
  130. package/resources/fine-tuning/fine-tuning.d.ts +12 -12
  131. package/resources/fine-tuning/fine-tuning.js +32 -49
  132. package/resources/fine-tuning/fine-tuning.mjs +10 -10
  133. package/resources/fine-tuning/index.d.ts +3 -12
  134. package/resources/fine-tuning/index.js +9 -29
  135. package/resources/fine-tuning/index.mjs +3 -3
  136. package/resources/fine-tuning/jobs.d.ts +173 -179
  137. package/resources/fine-tuning/jobs.js +50 -47
  138. package/resources/fine-tuning/jobs.mjs +45 -42
  139. package/resources/images.d.ts +116 -119
  140. package/resources/images.js +25 -24
  141. package/resources/images.mjs +21 -20
  142. package/resources/index.d.ts +12 -37
  143. package/resources/index.js +29 -113
  144. package/resources/index.mjs +12 -12
  145. package/resources/models.d.ts +41 -40
  146. package/resources/models.js +30 -28
  147. package/resources/models.mjs +26 -24
  148. package/resources/moderations.d.ts +153 -156
  149. package/resources/moderations.js +12 -11
  150. package/resources/moderations.mjs +9 -8
  151. package/shims/node.d.ts +29 -0
  152. package/shims/node.d.ts.map +1 -0
  153. package/shims/node.js +31 -0
  154. package/shims/node.js.map +1 -0
  155. package/shims/node.mjs +5 -0
  156. package/shims/node.mjs.map +1 -0
  157. package/shims/web.d.ts +26 -0
  158. package/shims/web.d.ts.map +1 -0
  159. package/shims/web.js +31 -0
  160. package/shims/web.js.map +1 -0
  161. package/shims/web.mjs +5 -0
  162. package/shims/web.mjs.map +1 -0
  163. package/src/_shims/MultipartBody.ts +9 -0
  164. package/src/_shims/README.md +46 -0
  165. package/src/_shims/auto/runtime-bun.ts +4 -0
  166. package/src/_shims/auto/runtime-node.ts +4 -0
  167. package/src/_shims/auto/runtime.ts +4 -0
  168. package/src/_shims/auto/types-node.ts +4 -0
  169. package/src/_shims/auto/types.d.ts +99 -0
  170. package/src/_shims/auto/types.js +3 -0
  171. package/src/_shims/auto/types.mjs +3 -0
  172. package/src/_shims/bun-runtime.ts +14 -0
  173. package/src/_shims/index.d.ts +79 -0
  174. package/src/_shims/index.js +13 -0
  175. package/src/_shims/index.mjs +7 -0
  176. package/src/_shims/manual-types.d.ts +12 -0
  177. package/src/_shims/manual-types.js +3 -0
  178. package/src/_shims/manual-types.mjs +3 -0
  179. package/src/_shims/node-runtime.ts +79 -0
  180. package/src/_shims/node-types.d.ts +42 -0
  181. package/src/_shims/node-types.js +3 -0
  182. package/src/_shims/node-types.mjs +3 -0
  183. package/src/_shims/registry.ts +62 -0
  184. package/src/_shims/web-runtime.ts +91 -0
  185. package/src/_shims/web-types.d.ts +82 -0
  186. package/src/_shims/web-types.js +3 -0
  187. package/src/_shims/web-types.mjs +3 -0
  188. package/src/core.ts +34 -17
  189. package/src/error.ts +1 -1
  190. package/src/index.ts +6 -6
  191. package/src/pagination.ts +1 -1
  192. package/src/resource.ts +1 -1
  193. package/src/resources/audio/audio.ts +4 -4
  194. package/src/resources/audio/index.ts +3 -3
  195. package/src/resources/audio/transcriptions.ts +4 -4
  196. package/src/resources/audio/translations.ts +4 -4
  197. package/src/resources/chat/chat.ts +3 -3
  198. package/src/resources/chat/completions.ts +6 -6
  199. package/src/resources/chat/index.ts +2 -2
  200. package/src/resources/completions.ts +5 -5
  201. package/src/resources/edits.ts +4 -4
  202. package/src/resources/embeddings.ts +3 -3
  203. package/src/resources/files.ts +7 -7
  204. package/src/resources/fine-tunes.ts +7 -7
  205. package/src/resources/fine-tuning/fine-tuning.ts +3 -3
  206. package/src/resources/fine-tuning/index.ts +2 -2
  207. package/src/resources/fine-tuning/jobs.ts +6 -6
  208. package/src/resources/images.ts +4 -4
  209. package/src/resources/index.ts +11 -11
  210. package/src/resources/models.ts +4 -4
  211. package/src/resources/moderations.ts +3 -3
  212. package/src/shims/node.ts +50 -0
  213. package/src/shims/web.ts +50 -0
  214. package/src/streaming.ts +1 -1
  215. package/src/uploads.ts +12 -16
  216. package/src/version.ts +1 -1
  217. package/streaming.d.ts +9 -8
  218. package/streaming.d.ts.map +1 -1
  219. package/streaming.js +194 -185
  220. package/streaming.mjs +192 -183
  221. package/uploads.d.ts +23 -39
  222. package/uploads.d.ts.map +1 -1
  223. package/uploads.js +115 -157
  224. package/uploads.js.map +1 -1
  225. package/uploads.mjs +111 -133
  226. package/uploads.mjs.map +1 -1
  227. package/version.d.ts +2 -2
  228. package/version.js +4 -4
  229. package/version.mjs +2 -2
  230. package/_shims/ReadableStream-node.d.ts +0 -6
  231. package/_shims/ReadableStream-node.d.ts.map +0 -1
  232. package/_shims/ReadableStream-node.js +0 -14
  233. package/_shims/ReadableStream-node.js.map +0 -1
  234. package/_shims/ReadableStream-node.mjs +0 -3
  235. package/_shims/ReadableStream-node.mjs.map +0 -1
  236. package/_shims/ReadableStream.d.ts +0 -38
  237. package/_shims/ReadableStream.mjs +0 -7
  238. package/_shims/agent-node.d.ts +0 -7
  239. package/_shims/agent-node.d.ts.map +0 -1
  240. package/_shims/agent-node.js +0 -28
  241. package/_shims/agent-node.js.map +0 -1
  242. package/_shims/agent-node.mjs +0 -16
  243. package/_shims/agent-node.mjs.map +0 -1
  244. package/_shims/agent.d.ts +0 -9
  245. package/_shims/agent.d.ts.map +0 -1
  246. package/_shims/agent.js +0 -14
  247. package/_shims/agent.js.map +0 -1
  248. package/_shims/agent.mjs +0 -10
  249. package/_shims/agent.mjs.map +0 -1
  250. package/_shims/fetch-node.d.ts +0 -64
  251. package/_shims/fetch-node.js +0 -12
  252. package/_shims/fetch-node.mjs +0 -14
  253. package/_shims/fetch.d.ts +0 -60
  254. package/_shims/fetch.js +0 -13
  255. package/_shims/fetch.mjs +0 -15
  256. package/_shims/fileFromPath-node.d.ts +0 -17
  257. package/_shims/fileFromPath-node.d.ts.map +0 -1
  258. package/_shims/fileFromPath-node.js +0 -17
  259. package/_shims/fileFromPath-node.js.map +0 -1
  260. package/_shims/fileFromPath-node.mjs +0 -13
  261. package/_shims/fileFromPath-node.mjs.map +0 -1
  262. package/_shims/fileFromPath.d.ts +0 -22
  263. package/_shims/fileFromPath.d.ts.map +0 -1
  264. package/_shims/fileFromPath.js +0 -16
  265. package/_shims/fileFromPath.js.map +0 -1
  266. package/_shims/fileFromPath.mjs +0 -12
  267. package/_shims/fileFromPath.mjs.map +0 -1
  268. package/_shims/form-data-node.d.ts +0 -45
  269. package/_shims/form-data-node.js +0 -11
  270. package/_shims/form-data-node.mjs +0 -9
  271. package/_shims/form-data.d.ts +0 -43
  272. package/_shims/form-data.js +0 -17
  273. package/_shims/form-data.mjs +0 -20
  274. package/_shims/getMultipartRequestOptions-node.d.ts +0 -10
  275. package/_shims/getMultipartRequestOptions-node.d.ts.map +0 -1
  276. package/_shims/getMultipartRequestOptions-node.js +0 -22
  277. package/_shims/getMultipartRequestOptions-node.js.map +0 -1
  278. package/_shims/getMultipartRequestOptions-node.mjs +0 -18
  279. package/_shims/getMultipartRequestOptions-node.mjs.map +0 -1
  280. package/_shims/getMultipartRequestOptions.d.ts +0 -10
  281. package/_shims/getMultipartRequestOptions.d.ts.map +0 -1
  282. package/_shims/getMultipartRequestOptions.js +0 -12
  283. package/_shims/getMultipartRequestOptions.js.map +0 -1
  284. package/_shims/getMultipartRequestOptions.mjs +0 -8
  285. package/_shims/getMultipartRequestOptions.mjs.map +0 -1
  286. package/_shims/node-readable-node.d.ts +0 -8
  287. package/_shims/node-readable-node.d.ts.map +0 -1
  288. package/_shims/node-readable-node.js +0 -9
  289. package/_shims/node-readable-node.js.map +0 -1
  290. package/_shims/node-readable-node.mjs +0 -5
  291. package/_shims/node-readable-node.mjs.map +0 -1
  292. package/_shims/node-readable.d.ts +0 -23
  293. package/_shims/node-readable.d.ts.map +0 -1
  294. package/_shims/node-readable.js +0 -11
  295. package/_shims/node-readable.js.map +0 -1
  296. package/_shims/node-readable.mjs +0 -7
  297. package/_shims/node-readable.mjs.map +0 -1
  298. package/src/_shims/ReadableStream.d.ts +0 -38
  299. package/src/_shims/ReadableStream.mjs +0 -7
  300. package/src/_shims/agent-node.ts +0 -22
  301. package/src/_shims/agent.ts +0 -12
  302. package/src/_shims/fetch-node.d.ts +0 -64
  303. package/src/_shims/fetch-node.js +0 -12
  304. package/src/_shims/fetch-node.mjs +0 -14
  305. package/src/_shims/fetch.d.ts +0 -60
  306. package/src/_shims/fetch.js +0 -13
  307. package/src/_shims/fetch.mjs +0 -15
  308. package/src/_shims/fileFromPath-node.ts +0 -29
  309. package/src/_shims/fileFromPath.ts +0 -29
  310. package/src/_shims/form-data-node.d.ts +0 -45
  311. package/src/_shims/form-data-node.js +0 -11
  312. package/src/_shims/form-data-node.mjs +0 -9
  313. package/src/_shims/form-data.d.ts +0 -43
  314. package/src/_shims/form-data.js +0 -17
  315. package/src/_shims/form-data.mjs +0 -20
  316. package/src/_shims/getMultipartRequestOptions-node.ts +0 -25
  317. package/src/_shims/getMultipartRequestOptions.ts +0 -14
  318. package/src/_shims/node-readable-node.ts +0 -10
  319. package/src/_shims/node-readable.ts +0 -30
@@ -1,59 +1,58 @@
1
- 'use strict';
1
+ "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless.
3
- Object.defineProperty(exports, '__esModule', { value: true });
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.FineTunesPage = exports.FineTunes = void 0;
5
- const resource_1 = require('openai/resource');
6
- const pagination_1 = require('openai/pagination');
5
+ const resource_1 = require("openai/resource");
6
+ const pagination_1 = require("openai/pagination");
7
7
  class FineTunes extends resource_1.APIResource {
8
- /**
9
- * Creates a job that fine-tunes a specified model from a given dataset.
10
- *
11
- * Response includes details of the enqueued job including job status and the name
12
- * of the fine-tuned models once complete.
13
- *
14
- * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/legacy-fine-tuning)
15
- */
16
- create(body, options) {
17
- return this.post('/fine-tunes', { body, ...options });
18
- }
19
- /**
20
- * Gets info about the fine-tune job.
21
- *
22
- * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/legacy-fine-tuning)
23
- */
24
- retrieve(fineTuneId, options) {
25
- return this.get(`/fine-tunes/${fineTuneId}`, options);
26
- }
27
- /**
28
- * List your organization's fine-tuning jobs
29
- */
30
- list(options) {
31
- return this.getAPIList('/fine-tunes', FineTunesPage, options);
32
- }
33
- /**
34
- * Immediately cancel a fine-tune job.
35
- */
36
- cancel(fineTuneId, options) {
37
- return this.post(`/fine-tunes/${fineTuneId}/cancel`, options);
38
- }
39
- listEvents(fineTuneId, query, options) {
40
- var _a;
41
- return this.get(`/fine-tunes/${fineTuneId}/events`, {
42
- query,
43
- timeout: 86400000,
44
- ...options,
45
- stream:
46
- (_a = query === null || query === void 0 ? void 0 : query.stream) !== null && _a !== void 0 ?
47
- _a
48
- : false,
49
- });
50
- }
8
+ /**
9
+ * Creates a job that fine-tunes a specified model from a given dataset.
10
+ *
11
+ * Response includes details of the enqueued job including job status and the name
12
+ * of the fine-tuned models once complete.
13
+ *
14
+ * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/legacy-fine-tuning)
15
+ */
16
+ create(body, options) {
17
+ return this.post('/fine-tunes', { body, ...options });
18
+ }
19
+ /**
20
+ * Gets info about the fine-tune job.
21
+ *
22
+ * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/legacy-fine-tuning)
23
+ */
24
+ retrieve(fineTuneId, options) {
25
+ return this.get(`/fine-tunes/${fineTuneId}`, options);
26
+ }
27
+ /**
28
+ * List your organization's fine-tuning jobs
29
+ */
30
+ list(options) {
31
+ return this.getAPIList('/fine-tunes', FineTunesPage, options);
32
+ }
33
+ /**
34
+ * Immediately cancel a fine-tune job.
35
+ */
36
+ cancel(fineTuneId, options) {
37
+ return this.post(`/fine-tunes/${fineTuneId}/cancel`, options);
38
+ }
39
+ listEvents(fineTuneId, query, options) {
40
+ var _a;
41
+ return this.get(`/fine-tunes/${fineTuneId}/events`, {
42
+ query,
43
+ timeout: 86400000,
44
+ ...options,
45
+ stream: (_a = query === null || query === void 0 ? void 0 : query.stream) !== null && _a !== void 0 ? _a : false,
46
+ });
47
+ }
51
48
  }
52
49
  exports.FineTunes = FineTunes;
53
50
  /**
54
51
  * Note: no pagination actually occurs yet, this is for forwards-compatibility.
55
52
  */
56
- class FineTunesPage extends pagination_1.Page {}
53
+ class FineTunesPage extends pagination_1.Page {
54
+ }
57
55
  exports.FineTunesPage = FineTunesPage;
58
- (function (FineTunes) {})((FineTunes = exports.FineTunes || (exports.FineTunes = {})));
59
- //# sourceMappingURL=fine-tunes.js.map
56
+ (function (FineTunes) {
57
+ })(FineTunes = exports.FineTunes || (exports.FineTunes = {}));
58
+ //# sourceMappingURL=fine-tunes.js.map
@@ -2,53 +2,52 @@
2
2
  import { APIResource } from 'openai/resource';
3
3
  import { Page } from 'openai/pagination';
4
4
  export class FineTunes extends APIResource {
5
- /**
6
- * Creates a job that fine-tunes a specified model from a given dataset.
7
- *
8
- * Response includes details of the enqueued job including job status and the name
9
- * of the fine-tuned models once complete.
10
- *
11
- * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/legacy-fine-tuning)
12
- */
13
- create(body, options) {
14
- return this.post('/fine-tunes', { body, ...options });
15
- }
16
- /**
17
- * Gets info about the fine-tune job.
18
- *
19
- * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/legacy-fine-tuning)
20
- */
21
- retrieve(fineTuneId, options) {
22
- return this.get(`/fine-tunes/${fineTuneId}`, options);
23
- }
24
- /**
25
- * List your organization's fine-tuning jobs
26
- */
27
- list(options) {
28
- return this.getAPIList('/fine-tunes', FineTunesPage, options);
29
- }
30
- /**
31
- * Immediately cancel a fine-tune job.
32
- */
33
- cancel(fineTuneId, options) {
34
- return this.post(`/fine-tunes/${fineTuneId}/cancel`, options);
35
- }
36
- listEvents(fineTuneId, query, options) {
37
- var _a;
38
- return this.get(`/fine-tunes/${fineTuneId}/events`, {
39
- query,
40
- timeout: 86400000,
41
- ...options,
42
- stream:
43
- (_a = query === null || query === void 0 ? void 0 : query.stream) !== null && _a !== void 0 ?
44
- _a
45
- : false,
46
- });
47
- }
5
+ /**
6
+ * Creates a job that fine-tunes a specified model from a given dataset.
7
+ *
8
+ * Response includes details of the enqueued job including job status and the name
9
+ * of the fine-tuned models once complete.
10
+ *
11
+ * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/legacy-fine-tuning)
12
+ */
13
+ create(body, options) {
14
+ return this.post('/fine-tunes', { body, ...options });
15
+ }
16
+ /**
17
+ * Gets info about the fine-tune job.
18
+ *
19
+ * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/legacy-fine-tuning)
20
+ */
21
+ retrieve(fineTuneId, options) {
22
+ return this.get(`/fine-tunes/${fineTuneId}`, options);
23
+ }
24
+ /**
25
+ * List your organization's fine-tuning jobs
26
+ */
27
+ list(options) {
28
+ return this.getAPIList('/fine-tunes', FineTunesPage, options);
29
+ }
30
+ /**
31
+ * Immediately cancel a fine-tune job.
32
+ */
33
+ cancel(fineTuneId, options) {
34
+ return this.post(`/fine-tunes/${fineTuneId}/cancel`, options);
35
+ }
36
+ listEvents(fineTuneId, query, options) {
37
+ var _a;
38
+ return this.get(`/fine-tunes/${fineTuneId}/events`, {
39
+ query,
40
+ timeout: 86400000,
41
+ ...options,
42
+ stream: (_a = query === null || query === void 0 ? void 0 : query.stream) !== null && _a !== void 0 ? _a : false,
43
+ });
44
+ }
48
45
  }
49
46
  /**
50
47
  * Note: no pagination actually occurs yet, this is for forwards-compatibility.
51
48
  */
52
- export class FineTunesPage extends Page {}
53
- (function (FineTunes) {})(FineTunes || (FineTunes = {}));
54
- //# sourceMappingURL=fine-tunes.mjs.map
49
+ export class FineTunesPage extends Page {
50
+ }
51
+ (function (FineTunes) {
52
+ })(FineTunes || (FineTunes = {}));
53
+ //# sourceMappingURL=fine-tunes.mjs.map
@@ -1,17 +1,17 @@
1
1
  import { APIResource } from 'openai/resource';
2
- import { Jobs } from './jobs.js';
3
- import * as API from './index.js';
2
+ import { Jobs } from "./jobs.js";
3
+ import * as API from "./index.js";
4
4
  export declare class FineTuning extends APIResource {
5
- jobs: Jobs;
5
+ jobs: Jobs;
6
6
  }
7
7
  export declare namespace FineTuning {
8
- export import Jobs = API.Jobs;
9
- export import FineTuningJob = API.FineTuningJob;
10
- export import FineTuningJobEvent = API.FineTuningJobEvent;
11
- export import FineTuningJobsPage = API.FineTuningJobsPage;
12
- export import FineTuningJobEventsPage = API.FineTuningJobEventsPage;
13
- export import JobCreateParams = API.JobCreateParams;
14
- export import JobListParams = API.JobListParams;
15
- export import JobListEventsParams = API.JobListEventsParams;
8
+ export import Jobs = API.Jobs;
9
+ export import FineTuningJob = API.FineTuningJob;
10
+ export import FineTuningJobEvent = API.FineTuningJobEvent;
11
+ export import FineTuningJobsPage = API.FineTuningJobsPage;
12
+ export import FineTuningJobEventsPage = API.FineTuningJobEventsPage;
13
+ export import JobCreateParams = API.JobCreateParams;
14
+ export import JobListParams = API.JobListParams;
15
+ export import JobListEventsParams = API.JobListEventsParams;
16
16
  }
17
- //# sourceMappingURL=fine-tuning.d.ts.map
17
+ //# sourceMappingURL=fine-tuning.d.ts.map
@@ -1,60 +1,43 @@
1
- 'use strict';
1
+ "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless.
3
- var __createBinding =
4
- (this && this.__createBinding) ||
5
- (Object.create ?
6
- function (o, m, k, k2) {
7
- if (k2 === undefined) k2 = k;
8
- var desc = Object.getOwnPropertyDescriptor(m, k);
9
- if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
- desc = {
11
- enumerable: true,
12
- get: function () {
13
- return m[k];
14
- },
15
- };
16
- }
17
- Object.defineProperty(o, k2, desc);
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
8
  }
19
- : function (o, m, k, k2) {
20
- if (k2 === undefined) k2 = k;
21
- o[k2] = m[k];
22
- });
23
- var __setModuleDefault =
24
- (this && this.__setModuleDefault) ||
25
- (Object.create ?
26
- function (o, v) {
27
- Object.defineProperty(o, 'default', { enumerable: true, value: v });
28
- }
29
- : function (o, v) {
30
- o['default'] = v;
31
- });
32
- var __importStar =
33
- (this && this.__importStar) ||
34
- function (mod) {
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || function (mod) {
35
20
  if (mod && mod.__esModule) return mod;
36
21
  var result = {};
37
- if (mod != null)
38
- for (var k in mod)
39
- if (k !== 'default' && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
40
23
  __setModuleDefault(result, mod);
41
24
  return result;
42
- };
43
- Object.defineProperty(exports, '__esModule', { value: true });
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
44
27
  exports.FineTuning = void 0;
45
- const resource_1 = require('openai/resource');
46
- const jobs_1 = require('./jobs.js');
47
- const API = __importStar(require('./index.js'));
28
+ const resource_1 = require("openai/resource");
29
+ const jobs_1 = require("./jobs.js");
30
+ const API = __importStar(require("./index.js"));
48
31
  class FineTuning extends resource_1.APIResource {
49
- constructor() {
50
- super(...arguments);
51
- this.jobs = new jobs_1.Jobs(this.client);
52
- }
32
+ constructor() {
33
+ super(...arguments);
34
+ this.jobs = new jobs_1.Jobs(this.client);
35
+ }
53
36
  }
54
37
  exports.FineTuning = FineTuning;
55
38
  (function (FineTuning) {
56
- FineTuning.Jobs = API.Jobs;
57
- FineTuning.FineTuningJobsPage = API.FineTuningJobsPage;
58
- FineTuning.FineTuningJobEventsPage = API.FineTuningJobEventsPage;
59
- })((FineTuning = exports.FineTuning || (exports.FineTuning = {})));
60
- //# sourceMappingURL=fine-tuning.js.map
39
+ FineTuning.Jobs = API.Jobs;
40
+ FineTuning.FineTuningJobsPage = API.FineTuningJobsPage;
41
+ FineTuning.FineTuningJobEventsPage = API.FineTuningJobEventsPage;
42
+ })(FineTuning = exports.FineTuning || (exports.FineTuning = {}));
43
+ //# sourceMappingURL=fine-tuning.js.map
@@ -1,16 +1,16 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
  import { APIResource } from 'openai/resource';
3
- import { Jobs } from './jobs.mjs';
4
- import * as API from './index.mjs';
3
+ import { Jobs } from "./jobs.mjs";
4
+ import * as API from "./index.mjs";
5
5
  export class FineTuning extends APIResource {
6
- constructor() {
7
- super(...arguments);
8
- this.jobs = new Jobs(this.client);
9
- }
6
+ constructor() {
7
+ super(...arguments);
8
+ this.jobs = new Jobs(this.client);
9
+ }
10
10
  }
11
11
  (function (FineTuning) {
12
- FineTuning.Jobs = API.Jobs;
13
- FineTuning.FineTuningJobsPage = API.FineTuningJobsPage;
14
- FineTuning.FineTuningJobEventsPage = API.FineTuningJobEventsPage;
12
+ FineTuning.Jobs = API.Jobs;
13
+ FineTuning.FineTuningJobsPage = API.FineTuningJobsPage;
14
+ FineTuning.FineTuningJobEventsPage = API.FineTuningJobEventsPage;
15
15
  })(FineTuning || (FineTuning = {}));
16
- //# sourceMappingURL=fine-tuning.mjs.map
16
+ //# sourceMappingURL=fine-tuning.mjs.map
@@ -1,12 +1,3 @@
1
- export { FineTuning } from './fine-tuning.js';
2
- export {
3
- FineTuningJob,
4
- FineTuningJobEvent,
5
- JobCreateParams,
6
- JobListParams,
7
- JobListEventsParams,
8
- FineTuningJobsPage,
9
- FineTuningJobEventsPage,
10
- Jobs,
11
- } from './jobs.js';
12
- //# sourceMappingURL=index.d.ts.map
1
+ export { FineTuning } from "./fine-tuning.js";
2
+ export { FineTuningJob, FineTuningJobEvent, JobCreateParams, JobListParams, JobListEventsParams, FineTuningJobsPage, FineTuningJobEventsPage, Jobs, } from "./jobs.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -1,31 +1,11 @@
1
- 'use strict';
1
+ "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless.
3
- Object.defineProperty(exports, '__esModule', { value: true });
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Jobs = exports.FineTuningJobEventsPage = exports.FineTuningJobsPage = exports.FineTuning = void 0;
5
- var fine_tuning_1 = require('./fine-tuning.js');
6
- Object.defineProperty(exports, 'FineTuning', {
7
- enumerable: true,
8
- get: function () {
9
- return fine_tuning_1.FineTuning;
10
- },
11
- });
12
- var jobs_1 = require('./jobs.js');
13
- Object.defineProperty(exports, 'FineTuningJobsPage', {
14
- enumerable: true,
15
- get: function () {
16
- return jobs_1.FineTuningJobsPage;
17
- },
18
- });
19
- Object.defineProperty(exports, 'FineTuningJobEventsPage', {
20
- enumerable: true,
21
- get: function () {
22
- return jobs_1.FineTuningJobEventsPage;
23
- },
24
- });
25
- Object.defineProperty(exports, 'Jobs', {
26
- enumerable: true,
27
- get: function () {
28
- return jobs_1.Jobs;
29
- },
30
- });
31
- //# sourceMappingURL=index.js.map
5
+ var fine_tuning_1 = require("./fine-tuning.js");
6
+ Object.defineProperty(exports, "FineTuning", { enumerable: true, get: function () { return fine_tuning_1.FineTuning; } });
7
+ var jobs_1 = require("./jobs.js");
8
+ Object.defineProperty(exports, "FineTuningJobsPage", { enumerable: true, get: function () { return jobs_1.FineTuningJobsPage; } });
9
+ Object.defineProperty(exports, "FineTuningJobEventsPage", { enumerable: true, get: function () { return jobs_1.FineTuningJobEventsPage; } });
10
+ Object.defineProperty(exports, "Jobs", { enumerable: true, get: function () { return jobs_1.Jobs; } });
11
+ //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
- export { FineTuning } from './fine-tuning.mjs';
3
- export { FineTuningJobsPage, FineTuningJobEventsPage, Jobs } from './jobs.mjs';
4
- //# sourceMappingURL=index.mjs.map
2
+ export { FineTuning } from "./fine-tuning.mjs";
3
+ export { FineTuningJobsPage, FineTuningJobEventsPage, Jobs, } from "./jobs.mjs";
4
+ //# sourceMappingURL=index.mjs.map