parts.d.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { APIResource } from "../../resource.js";
  2. import * as Core from "../../core.js";
  3. export declare class Parts extends APIResource {
  4. /**
  5. * Adds a
  6. * [Part](https://platform.openai.com/docs/api-reference/uploads/part-object) to an
  7. * [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object.
  8. * A Part represents a chunk of bytes from the file you are trying to upload.
  9. *
  10. * Each Part can be at most 64 MB, and you can add Parts until you hit the Upload
  11. * maximum of 8 GB.
  12. *
  13. * It is possible to add multiple Parts in parallel. You can decide the intended
  14. * order of the Parts when you
  15. * [complete the Upload](https://platform.openai.com/docs/api-reference/uploads/complete).
  16. */
  17. create(uploadId: string, body: PartCreateParams, options?: Core.RequestOptions): Core.APIPromise<UploadPart>;
  18. }
  19. /**
  20. * The upload Part represents a chunk of bytes we can add to an Upload object.
  21. */
  22. export interface UploadPart {
  23. /**
  24. * The upload Part unique identifier, which can be referenced in API endpoints.
  25. */
  26. id: string;
  27. /**
  28. * The Unix timestamp (in seconds) for when the Part was created.
  29. */
  30. created_at: number;
  31. /**
  32. * The object type, which is always `upload.part`.
  33. */
  34. object: 'upload.part';
  35. /**
  36. * The ID of the Upload object that this Part was added to.
  37. */
  38. upload_id: string;
  39. }
  40. export interface PartCreateParams {
  41. /**
  42. * The chunk of bytes for this Part.
  43. */
  44. data: Core.Uploadable;
  45. }
  46. export declare namespace Parts {
  47. export { type UploadPart as UploadPart, type PartCreateParams as PartCreateParams };
  48. }
  49. //# sourceMappingURL=parts.d.ts.map