parts.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. "use strict";
  2. // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
  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]; } };
  8. }
  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) {
  20. if (mod && mod.__esModule) return mod;
  21. var result = {};
  22. if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
  23. __setModuleDefault(result, mod);
  24. return result;
  25. };
  26. Object.defineProperty(exports, "__esModule", { value: true });
  27. exports.Parts = void 0;
  28. const resource_1 = require("../../resource.js");
  29. const Core = __importStar(require("../../core.js"));
  30. class Parts extends resource_1.APIResource {
  31. /**
  32. * Adds a
  33. * [Part](https://platform.openai.com/docs/api-reference/uploads/part-object) to an
  34. * [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object.
  35. * A Part represents a chunk of bytes from the file you are trying to upload.
  36. *
  37. * Each Part can be at most 64 MB, and you can add Parts until you hit the Upload
  38. * maximum of 8 GB.
  39. *
  40. * It is possible to add multiple Parts in parallel. You can decide the intended
  41. * order of the Parts when you
  42. * [complete the Upload](https://platform.openai.com/docs/api-reference/uploads/complete).
  43. */
  44. create(uploadId, body, options) {
  45. return this._client.post(`/uploads/${uploadId}/parts`, Core.multipartFormRequestOptions({ body, ...options }));
  46. }
  47. }
  48. exports.Parts = Parts;
  49. //# sourceMappingURL=parts.js.map