parts.mjs 1.1 KB

1234567891011121314151617181920212223
  1. // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
  2. import { APIResource } from "../../core/resource.mjs";
  3. import { multipartFormRequestOptions } from "../../internal/uploads.mjs";
  4. import { path } from "../../internal/utils/path.mjs";
  5. export class Parts extends APIResource {
  6. /**
  7. * Adds a
  8. * [Part](https://platform.openai.com/docs/api-reference/uploads/part-object) to an
  9. * [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object.
  10. * A Part represents a chunk of bytes from the file you are trying to upload.
  11. *
  12. * Each Part can be at most 64 MB, and you can add Parts until you hit the Upload
  13. * maximum of 8 GB.
  14. *
  15. * It is possible to add multiple Parts in parallel. You can decide the intended
  16. * order of the Parts when you
  17. * [complete the Upload](https://platform.openai.com/docs/api-reference/uploads/complete).
  18. */
  19. create(uploadID, body, options) {
  20. return this._client.post(path `/uploads/${uploadID}/parts`, multipartFormRequestOptions({ body, ...options }, this._client));
  21. }
  22. }
  23. //# sourceMappingURL=parts.mjs.map