parts.js 1.3 KB

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