parts.d.mts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import { APIResource } from "../../core/resource.mjs";
  2. import { APIPromise } from "../../core/api-promise.mjs";
  3. import { type Uploadable } from "../../core/uploads.mjs";
  4. import { RequestOptions } from "../../internal/request-options.mjs";
  5. export declare 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: string, body: PartCreateParams, options?: RequestOptions): APIPromise<UploadPart>;
  20. }
  21. /**
  22. * The upload Part represents a chunk of bytes we can add to an Upload object.
  23. */
  24. export interface UploadPart {
  25. /**
  26. * The upload Part unique identifier, which can be referenced in API endpoints.
  27. */
  28. id: string;
  29. /**
  30. * The Unix timestamp (in seconds) for when the Part was created.
  31. */
  32. created_at: number;
  33. /**
  34. * The object type, which is always `upload.part`.
  35. */
  36. object: 'upload.part';
  37. /**
  38. * The ID of the Upload object that this Part was added to.
  39. */
  40. upload_id: string;
  41. }
  42. export interface PartCreateParams {
  43. /**
  44. * The chunk of bytes for this Part.
  45. */
  46. data: Uploadable;
  47. }
  48. export declare namespace Parts {
  49. export { type UploadPart as UploadPart, type PartCreateParams as PartCreateParams };
  50. }
  51. //# sourceMappingURL=parts.d.mts.map