main
 1# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
 2
 3from __future__ import annotations
 4
 5from typing_extensions import Literal, Required, TypedDict
 6
 7from .file_purpose import FilePurpose
 8
 9__all__ = ["UploadCreateParams", "ExpiresAfter"]
10
11
12class UploadCreateParams(TypedDict, total=False):
13    bytes: Required[int]
14    """The number of bytes in the file you are uploading."""
15
16    filename: Required[str]
17    """The name of the file to upload."""
18
19    mime_type: Required[str]
20    """The MIME type of the file.
21
22    This must fall within the supported MIME types for your file purpose. See the
23    supported MIME types for assistants and vision.
24    """
25
26    purpose: Required[FilePurpose]
27    """The intended purpose of the uploaded file.
28
29    See the
30    [documentation on File purposes](https://platform.openai.com/docs/api-reference/files/create#files-create-purpose).
31    """
32
33    expires_after: ExpiresAfter
34    """The expiration policy for a file.
35
36    By default, files with `purpose=batch` expire after 30 days and all other files
37    are persisted until they are manually deleted.
38    """
39
40
41class ExpiresAfter(TypedDict, total=False):
42    anchor: Required[Literal["created_at"]]
43    """Anchor timestamp after which the expiration policy applies.
44
45    Supported anchors: `created_at`.
46    """
47
48    seconds: Required[int]
49    """The number of seconds after the anchor time that the file will expire.
50
51    Must be between 3600 (1 hour) and 2592000 (30 days).
52    """