openai 4.7.1 → 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 (321) hide show
  1. package/CHANGELOG.md +16 -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.js.map +1 -1
  82. package/error.mjs +92 -94
  83. package/error.mjs.map +1 -1
  84. package/index.d.mts +164 -175
  85. package/index.d.ts +164 -175
  86. package/index.d.ts.map +1 -1
  87. package/index.js +110 -161
  88. package/index.mjs +88 -109
  89. package/package.json +31 -58
  90. package/pagination.d.ts +31 -41
  91. package/pagination.js +52 -48
  92. package/pagination.mjs +50 -46
  93. package/resource.d.ts +10 -10
  94. package/resource.js +12 -12
  95. package/resource.mjs +10 -10
  96. package/resources/audio/audio.d.ts +12 -12
  97. package/resources/audio/audio.js +33 -50
  98. package/resources/audio/audio.mjs +11 -11
  99. package/resources/audio/index.d.ts +4 -4
  100. package/resources/audio/index.js +9 -24
  101. package/resources/audio/index.mjs +4 -4
  102. package/resources/audio/transcriptions.d.ts +44 -44
  103. package/resources/audio/transcriptions.js +13 -12
  104. package/resources/audio/transcriptions.mjs +9 -8
  105. package/resources/audio/translations.d.ts +38 -38
  106. package/resources/audio/translations.js +13 -12
  107. package/resources/audio/translations.mjs +9 -8
  108. package/resources/chat/chat.d.ts +17 -17
  109. package/resources/chat/chat.js +30 -47
  110. package/resources/chat/chat.mjs +8 -8
  111. package/resources/chat/completions.d.ts +330 -353
  112. package/resources/chat/completions.js +10 -13
  113. package/resources/chat/completions.mjs +7 -10
  114. package/resources/chat/index.d.ts +3 -17
  115. package/resources/chat/index.js +7 -17
  116. package/resources/chat/index.mjs +3 -3
  117. package/resources/completions.d.ts +216 -232
  118. package/resources/completions.js +10 -13
  119. package/resources/completions.mjs +7 -10
  120. package/resources/edits.d.ts +73 -73
  121. package/resources/edits.js +16 -15
  122. package/resources/edits.mjs +13 -12
  123. package/resources/embeddings.d.ts +73 -76
  124. package/resources/embeddings.js +12 -11
  125. package/resources/embeddings.mjs +9 -8
  126. package/resources/files.d.ts +91 -96
  127. package/resources/files.js +64 -65
  128. package/resources/files.mjs +57 -58
  129. package/resources/fine-tunes.d.ts +277 -290
  130. package/resources/fine-tunes.js +49 -50
  131. package/resources/fine-tunes.mjs +45 -46
  132. package/resources/fine-tuning/fine-tuning.d.ts +12 -12
  133. package/resources/fine-tuning/fine-tuning.js +32 -49
  134. package/resources/fine-tuning/fine-tuning.mjs +10 -10
  135. package/resources/fine-tuning/index.d.ts +3 -12
  136. package/resources/fine-tuning/index.js +9 -29
  137. package/resources/fine-tuning/index.mjs +3 -3
  138. package/resources/fine-tuning/jobs.d.ts +173 -179
  139. package/resources/fine-tuning/jobs.js +50 -47
  140. package/resources/fine-tuning/jobs.mjs +45 -42
  141. package/resources/images.d.ts +116 -119
  142. package/resources/images.js +25 -24
  143. package/resources/images.mjs +21 -20
  144. package/resources/index.d.ts +12 -37
  145. package/resources/index.js +29 -113
  146. package/resources/index.mjs +12 -12
  147. package/resources/models.d.ts +41 -40
  148. package/resources/models.js +30 -28
  149. package/resources/models.mjs +26 -24
  150. package/resources/moderations.d.ts +153 -156
  151. package/resources/moderations.js +12 -11
  152. package/resources/moderations.mjs +9 -8
  153. package/shims/node.d.ts +29 -0
  154. package/shims/node.d.ts.map +1 -0
  155. package/shims/node.js +31 -0
  156. package/shims/node.js.map +1 -0
  157. package/shims/node.mjs +5 -0
  158. package/shims/node.mjs.map +1 -0
  159. package/shims/web.d.ts +26 -0
  160. package/shims/web.d.ts.map +1 -0
  161. package/shims/web.js +31 -0
  162. package/shims/web.js.map +1 -0
  163. package/shims/web.mjs +5 -0
  164. package/shims/web.mjs.map +1 -0
  165. package/src/_shims/MultipartBody.ts +9 -0
  166. package/src/_shims/README.md +46 -0
  167. package/src/_shims/auto/runtime-bun.ts +4 -0
  168. package/src/_shims/auto/runtime-node.ts +4 -0
  169. package/src/_shims/auto/runtime.ts +4 -0
  170. package/src/_shims/auto/types-node.ts +4 -0
  171. package/src/_shims/auto/types.d.ts +99 -0
  172. package/src/_shims/auto/types.js +3 -0
  173. package/src/_shims/auto/types.mjs +3 -0
  174. package/src/_shims/bun-runtime.ts +14 -0
  175. package/src/_shims/index.d.ts +79 -0
  176. package/src/_shims/index.js +13 -0
  177. package/src/_shims/index.mjs +7 -0
  178. package/src/_shims/manual-types.d.ts +12 -0
  179. package/src/_shims/manual-types.js +3 -0
  180. package/src/_shims/manual-types.mjs +3 -0
  181. package/src/_shims/node-runtime.ts +79 -0
  182. package/src/_shims/node-types.d.ts +42 -0
  183. package/src/_shims/node-types.js +3 -0
  184. package/src/_shims/node-types.mjs +3 -0
  185. package/src/_shims/registry.ts +62 -0
  186. package/src/_shims/web-runtime.ts +91 -0
  187. package/src/_shims/web-types.d.ts +82 -0
  188. package/src/_shims/web-types.js +3 -0
  189. package/src/_shims/web-types.mjs +3 -0
  190. package/src/core.ts +35 -18
  191. package/src/error.ts +3 -3
  192. package/src/index.ts +6 -6
  193. package/src/pagination.ts +1 -1
  194. package/src/resource.ts +1 -1
  195. package/src/resources/audio/audio.ts +4 -4
  196. package/src/resources/audio/index.ts +3 -3
  197. package/src/resources/audio/transcriptions.ts +4 -4
  198. package/src/resources/audio/translations.ts +4 -4
  199. package/src/resources/chat/chat.ts +3 -3
  200. package/src/resources/chat/completions.ts +6 -6
  201. package/src/resources/chat/index.ts +2 -2
  202. package/src/resources/completions.ts +5 -5
  203. package/src/resources/edits.ts +4 -4
  204. package/src/resources/embeddings.ts +3 -3
  205. package/src/resources/files.ts +7 -7
  206. package/src/resources/fine-tunes.ts +7 -7
  207. package/src/resources/fine-tuning/fine-tuning.ts +3 -3
  208. package/src/resources/fine-tuning/index.ts +2 -2
  209. package/src/resources/fine-tuning/jobs.ts +6 -6
  210. package/src/resources/images.ts +4 -4
  211. package/src/resources/index.ts +11 -11
  212. package/src/resources/models.ts +4 -4
  213. package/src/resources/moderations.ts +3 -3
  214. package/src/shims/node.ts +50 -0
  215. package/src/shims/web.ts +50 -0
  216. package/src/streaming.ts +1 -1
  217. package/src/uploads.ts +12 -16
  218. package/src/version.ts +1 -1
  219. package/streaming.d.ts +9 -8
  220. package/streaming.d.ts.map +1 -1
  221. package/streaming.js +194 -185
  222. package/streaming.mjs +192 -183
  223. package/uploads.d.ts +23 -39
  224. package/uploads.d.ts.map +1 -1
  225. package/uploads.js +115 -157
  226. package/uploads.js.map +1 -1
  227. package/uploads.mjs +111 -133
  228. package/uploads.mjs.map +1 -1
  229. package/version.d.ts +2 -2
  230. package/version.js +4 -4
  231. package/version.mjs +2 -2
  232. package/_shims/ReadableStream-node.d.ts +0 -6
  233. package/_shims/ReadableStream-node.d.ts.map +0 -1
  234. package/_shims/ReadableStream-node.js +0 -14
  235. package/_shims/ReadableStream-node.js.map +0 -1
  236. package/_shims/ReadableStream-node.mjs +0 -3
  237. package/_shims/ReadableStream-node.mjs.map +0 -1
  238. package/_shims/ReadableStream.d.ts +0 -38
  239. package/_shims/ReadableStream.mjs +0 -7
  240. package/_shims/agent-node.d.ts +0 -7
  241. package/_shims/agent-node.d.ts.map +0 -1
  242. package/_shims/agent-node.js +0 -28
  243. package/_shims/agent-node.js.map +0 -1
  244. package/_shims/agent-node.mjs +0 -16
  245. package/_shims/agent-node.mjs.map +0 -1
  246. package/_shims/agent.d.ts +0 -9
  247. package/_shims/agent.d.ts.map +0 -1
  248. package/_shims/agent.js +0 -14
  249. package/_shims/agent.js.map +0 -1
  250. package/_shims/agent.mjs +0 -10
  251. package/_shims/agent.mjs.map +0 -1
  252. package/_shims/fetch-node.d.ts +0 -64
  253. package/_shims/fetch-node.js +0 -12
  254. package/_shims/fetch-node.mjs +0 -14
  255. package/_shims/fetch.d.ts +0 -60
  256. package/_shims/fetch.js +0 -13
  257. package/_shims/fetch.mjs +0 -15
  258. package/_shims/fileFromPath-node.d.ts +0 -17
  259. package/_shims/fileFromPath-node.d.ts.map +0 -1
  260. package/_shims/fileFromPath-node.js +0 -17
  261. package/_shims/fileFromPath-node.js.map +0 -1
  262. package/_shims/fileFromPath-node.mjs +0 -13
  263. package/_shims/fileFromPath-node.mjs.map +0 -1
  264. package/_shims/fileFromPath.d.ts +0 -22
  265. package/_shims/fileFromPath.d.ts.map +0 -1
  266. package/_shims/fileFromPath.js +0 -16
  267. package/_shims/fileFromPath.js.map +0 -1
  268. package/_shims/fileFromPath.mjs +0 -12
  269. package/_shims/fileFromPath.mjs.map +0 -1
  270. package/_shims/form-data-node.d.ts +0 -45
  271. package/_shims/form-data-node.js +0 -11
  272. package/_shims/form-data-node.mjs +0 -9
  273. package/_shims/form-data.d.ts +0 -43
  274. package/_shims/form-data.js +0 -17
  275. package/_shims/form-data.mjs +0 -20
  276. package/_shims/getMultipartRequestOptions-node.d.ts +0 -10
  277. package/_shims/getMultipartRequestOptions-node.d.ts.map +0 -1
  278. package/_shims/getMultipartRequestOptions-node.js +0 -22
  279. package/_shims/getMultipartRequestOptions-node.js.map +0 -1
  280. package/_shims/getMultipartRequestOptions-node.mjs +0 -18
  281. package/_shims/getMultipartRequestOptions-node.mjs.map +0 -1
  282. package/_shims/getMultipartRequestOptions.d.ts +0 -10
  283. package/_shims/getMultipartRequestOptions.d.ts.map +0 -1
  284. package/_shims/getMultipartRequestOptions.js +0 -12
  285. package/_shims/getMultipartRequestOptions.js.map +0 -1
  286. package/_shims/getMultipartRequestOptions.mjs +0 -8
  287. package/_shims/getMultipartRequestOptions.mjs.map +0 -1
  288. package/_shims/node-readable-node.d.ts +0 -8
  289. package/_shims/node-readable-node.d.ts.map +0 -1
  290. package/_shims/node-readable-node.js +0 -9
  291. package/_shims/node-readable-node.js.map +0 -1
  292. package/_shims/node-readable-node.mjs +0 -5
  293. package/_shims/node-readable-node.mjs.map +0 -1
  294. package/_shims/node-readable.d.ts +0 -23
  295. package/_shims/node-readable.d.ts.map +0 -1
  296. package/_shims/node-readable.js +0 -11
  297. package/_shims/node-readable.js.map +0 -1
  298. package/_shims/node-readable.mjs +0 -7
  299. package/_shims/node-readable.mjs.map +0 -1
  300. package/src/_shims/ReadableStream.d.ts +0 -38
  301. package/src/_shims/ReadableStream.mjs +0 -7
  302. package/src/_shims/agent-node.ts +0 -22
  303. package/src/_shims/agent.ts +0 -12
  304. package/src/_shims/fetch-node.d.ts +0 -64
  305. package/src/_shims/fetch-node.js +0 -12
  306. package/src/_shims/fetch-node.mjs +0 -14
  307. package/src/_shims/fetch.d.ts +0 -60
  308. package/src/_shims/fetch.js +0 -13
  309. package/src/_shims/fetch.mjs +0 -15
  310. package/src/_shims/fileFromPath-node.ts +0 -29
  311. package/src/_shims/fileFromPath.ts +0 -29
  312. package/src/_shims/form-data-node.d.ts +0 -45
  313. package/src/_shims/form-data-node.js +0 -11
  314. package/src/_shims/form-data-node.mjs +0 -9
  315. package/src/_shims/form-data.d.ts +0 -43
  316. package/src/_shims/form-data.js +0 -17
  317. package/src/_shims/form-data.mjs +0 -20
  318. package/src/_shims/getMultipartRequestOptions-node.ts +0 -25
  319. package/src/_shims/getMultipartRequestOptions.ts +0 -14
  320. package/src/_shims/node-readable-node.ts +0 -10
  321. package/src/_shims/node-readable.ts +0 -30
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- export { Audio } from './audio/audio.js';
4
- export { Chat } from './chat/chat.js';
3
+ export { Audio } from './audio/audio';
4
+ export { Chat } from './chat/chat';
5
5
  export {
6
6
  Completion,
7
7
  CompletionChoice,
@@ -10,10 +10,10 @@ export {
10
10
  CompletionCreateParamsNonStreaming,
11
11
  CompletionCreateParamsStreaming,
12
12
  Completions,
13
- } from './completions.js';
14
- export { CreateEmbeddingResponse, Embedding, EmbeddingCreateParams, Embeddings } from './embeddings.js';
15
- export { Edit, EditCreateParams, Edits } from './edits.js';
16
- export { FileContent, FileDeleted, FileObject, FileCreateParams, FileObjectsPage, Files } from './files.js';
13
+ } from './completions';
14
+ export { CreateEmbeddingResponse, Embedding, EmbeddingCreateParams, Embeddings } from './embeddings';
15
+ export { Edit, EditCreateParams, Edits } from './edits';
16
+ export { FileContent, FileDeleted, FileObject, FileCreateParams, FileObjectsPage, Files } from './files';
17
17
  export {
18
18
  FineTune,
19
19
  FineTuneEvent,
@@ -24,8 +24,8 @@ export {
24
24
  FineTuneListEventsParamsStreaming,
25
25
  FineTunesPage,
26
26
  FineTunes,
27
- } from './fine-tunes.js';
28
- export { FineTuning } from './fine-tuning/fine-tuning.js';
27
+ } from './fine-tunes';
28
+ export { FineTuning } from './fine-tuning/fine-tuning';
29
29
  export {
30
30
  Image,
31
31
  ImagesResponse,
@@ -33,6 +33,6 @@ export {
33
33
  ImageEditParams,
34
34
  ImageGenerateParams,
35
35
  Images,
36
- } from './images.js';
37
- export { Model, ModelDeleted, ModelsPage, Models } from './models.js';
38
- export { Moderation, ModerationCreateResponse, ModerationCreateParams, Moderations } from './moderations.js';
36
+ } from './images';
37
+ export { Model, ModelDeleted, ModelsPage, Models } from './models';
38
+ export { Moderation, ModerationCreateResponse, ModerationCreateParams, Moderations } from './moderations';
@@ -1,9 +1,9 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from '../core.js';
4
- import { APIResource } from '../resource.js';
5
- import * as API from './index.js';
6
- import { Page } from '../pagination.js';
3
+ import * as Core from "../core";
4
+ import { APIResource } from "../resource";
5
+ import * as API from './index';
6
+ import { Page } from "../pagination";
7
7
 
8
8
  export class Models extends APIResource {
9
9
  /**
@@ -1,8 +1,8 @@
1
1
  // File generated from our OpenAPI spec by Stainless.
2
2
 
3
- import * as Core from '../core.js';
4
- import { APIResource } from '../resource.js';
5
- import * as API from './index.js';
3
+ import * as Core from "../core";
4
+ import { APIResource } from "../resource";
5
+ import * as API from './index';
6
6
 
7
7
  export class Moderations extends APIResource {
8
8
  /**
@@ -0,0 +1,50 @@
1
+ // @ts-ignore
2
+ import * as types from '../_shims/node-types';
3
+ import { setShims } from '../_shims/registry';
4
+ import { getRuntime } from '../_shims/node-runtime';
5
+ setShims(getRuntime());
6
+
7
+ declare module '../_shims/manual-types' {
8
+ export namespace manual {
9
+ // @ts-ignore
10
+ export type Agent = types.Agent;
11
+ // @ts-ignore
12
+ export import fetch = types.fetch;
13
+ // @ts-ignore
14
+ export type Request = types.Request;
15
+ // @ts-ignore
16
+ export type RequestInfo = types.RequestInfo;
17
+ // @ts-ignore
18
+ export type RequestInit = types.RequestInit;
19
+ // @ts-ignore
20
+ export type Response = types.Response;
21
+ // @ts-ignore
22
+ export type ResponseInit = types.ResponseInit;
23
+ // @ts-ignore
24
+ export type ResponseType = types.ResponseType;
25
+ // @ts-ignore
26
+ export type BodyInit = types.BodyInit;
27
+ // @ts-ignore
28
+ export type Headers = types.Headers;
29
+ // @ts-ignore
30
+ export type HeadersInit = types.HeadersInit;
31
+ // @ts-ignore
32
+ export type BlobPropertyBag = types.BlobPropertyBag;
33
+ // @ts-ignore
34
+ export type FilePropertyBag = types.FilePropertyBag;
35
+ // @ts-ignore
36
+ export type FileFromPathOptions = types.FileFromPathOptions;
37
+ // @ts-ignore
38
+ export import FormData = types.FormData;
39
+ // @ts-ignore
40
+ export import File = types.File;
41
+ // @ts-ignore
42
+ export import Blob = types.Blob;
43
+ // @ts-ignore
44
+ export type Readable = types.Readable;
45
+ // @ts-ignore
46
+ export type FsReadStream = types.FsReadStream;
47
+ // @ts-ignore
48
+ export type ReadableStream = types.ReadableStream;
49
+ }
50
+ }
@@ -0,0 +1,50 @@
1
+ // @ts-ignore
2
+ import * as types from '../_shims/web-types';
3
+ import { setShims } from '../_shims/registry';
4
+ import { getRuntime } from '../_shims/web-runtime';
5
+ setShims(getRuntime({ manuallyImported: true }));
6
+
7
+ declare module '../_shims/manual-types' {
8
+ export namespace manual {
9
+ // @ts-ignore
10
+ export type Agent = types.Agent;
11
+ // @ts-ignore
12
+ export import fetch = types.fetch;
13
+ // @ts-ignore
14
+ export type Request = types.Request;
15
+ // @ts-ignore
16
+ export type RequestInfo = types.RequestInfo;
17
+ // @ts-ignore
18
+ export type RequestInit = types.RequestInit;
19
+ // @ts-ignore
20
+ export type Response = types.Response;
21
+ // @ts-ignore
22
+ export type ResponseInit = types.ResponseInit;
23
+ // @ts-ignore
24
+ export type ResponseType = types.ResponseType;
25
+ // @ts-ignore
26
+ export type BodyInit = types.BodyInit;
27
+ // @ts-ignore
28
+ export type Headers = types.Headers;
29
+ // @ts-ignore
30
+ export type HeadersInit = types.HeadersInit;
31
+ // @ts-ignore
32
+ export type BlobPropertyBag = types.BlobPropertyBag;
33
+ // @ts-ignore
34
+ export type FilePropertyBag = types.FilePropertyBag;
35
+ // @ts-ignore
36
+ export type FileFromPathOptions = types.FileFromPathOptions;
37
+ // @ts-ignore
38
+ export import FormData = types.FormData;
39
+ // @ts-ignore
40
+ export import File = types.File;
41
+ // @ts-ignore
42
+ export import Blob = types.Blob;
43
+ // @ts-ignore
44
+ export type Readable = types.Readable;
45
+ // @ts-ignore
46
+ export type FsReadStream = types.FsReadStream;
47
+ // @ts-ignore
48
+ export type ReadableStream = types.ReadableStream;
49
+ }
50
+ }
package/src/streaming.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Response } from './_shims/fetch.js';
1
+ import { type Response } from './_shims/index';
2
2
 
3
3
  type Bytes = string | ArrayBuffer | Uint8Array | Buffer | null | undefined;
4
4
 
package/src/uploads.ts CHANGED
@@ -1,12 +1,15 @@
1
- import { type RequestOptions } from './core.js';
2
- import { type Readable } from './_shims/node-readable.js';
3
- import { type BodyInit } from './_shims/fetch.js';
4
- import { FormData, File, type Blob, type FilePropertyBag } from './_shims/form-data.js';
5
- import { getMultipartRequestOptions } from './_shims/getMultipartRequestOptions.js';
6
- import { fileFromPath } from './_shims/fileFromPath.js';
7
- import { type FsReadStream, isFsReadStream } from './_shims/node-readable.js';
8
-
9
- export { fileFromPath };
1
+ import { type RequestOptions } from './core';
2
+ import {
3
+ FormData,
4
+ File,
5
+ type Blob,
6
+ type FilePropertyBag,
7
+ getMultipartRequestOptions,
8
+ type FsReadStream,
9
+ isFsReadStream,
10
+ } from './_shims/index';
11
+ import { MultipartBody } from './_shims/MultipartBody';
12
+ export { fileFromPath } from './_shims/index';
10
13
 
11
14
  type BlobLikePart = string | ArrayBuffer | ArrayBufferView | BlobLike | Uint8Array | DataView;
12
15
  export type BlobPart = string | ArrayBuffer | ArrayBufferView | Blob | Uint8Array | DataView;
@@ -175,13 +178,6 @@ const getStringFromMaybeBuffer = (x: string | Buffer | unknown): string | undefi
175
178
  const isAsyncIterableIterator = (value: any): value is AsyncIterableIterator<unknown> =>
176
179
  value != null && typeof value === 'object' && typeof value[Symbol.asyncIterator] === 'function';
177
180
 
178
- export class MultipartBody {
179
- constructor(public body: Readable | BodyInit) {}
180
- get [Symbol.toStringTag](): string {
181
- return 'MultipartBody';
182
- }
183
- }
184
-
185
181
  export const isMultipartBody = (body: any): body is MultipartBody =>
186
182
  body && typeof body === 'object' && body.body && body[Symbol.toStringTag] === 'MultipartBody';
187
183
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '4.7.1'; // x-release-please-version
1
+ export const VERSION = '4.9.0'; // x-release-please-version
package/streaming.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- import type { Response } from 'openai/_shims/fetch';
1
+
2
+ import { type Response } from "./_shims/index.js";
2
3
  export declare class Stream<Item> implements AsyncIterable<Item> {
3
- controller: AbortController;
4
- private response;
5
- private decoder;
6
- constructor(response: Response, controller: AbortController);
7
- private iterMessages;
8
- [Symbol.asyncIterator](): AsyncIterator<Item, any, undefined>;
4
+ controller: AbortController;
5
+ private response;
6
+ private decoder;
7
+ constructor(response: Response, controller: AbortController);
8
+ private iterMessages;
9
+ [Symbol.asyncIterator](): AsyncIterator<Item, any, undefined>;
9
10
  }
10
- //# sourceMappingURL=streaming.d.ts.map
11
+ //# sourceMappingURL=streaming.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAUpD,qBAAa,MAAM,CAAC,IAAI,CAAE,YAAW,aAAa,CAAC,IAAI,CAAC;IACtD,UAAU,EAAE,eAAe,CAAC;IAE5B,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,OAAO,CAAa;gBAEhB,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe;YAM5C,YAAY;IAqBpB,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,CAAC;CA+BrE"}
1
+ {"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["src/streaming.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAU/C,qBAAa,MAAM,CAAC,IAAI,CAAE,YAAW,aAAa,CAAC,IAAI,CAAC;IACtD,UAAU,EAAE,eAAe,CAAC;IAE5B,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,OAAO,CAAa;gBAEhB,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,eAAe;YAM5C,YAAY;IAqBpB,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,CAAC;CA+BrE"}