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 .._types import FileTypes
 8from .file_purpose import FilePurpose
 9
10__all__ = ["FileCreateParams", "ExpiresAfter"]
11
12
13class FileCreateParams(TypedDict, total=False):
14    file: Required[FileTypes]
15    """The File object (not file name) to be uploaded."""
16
17    purpose: Required[FilePurpose]
18    """The intended purpose of the uploaded file.
19
20    One of: - `assistants`: Used in the Assistants API - `batch`: Used in the Batch
21    API - `fine-tune`: Used for fine-tuning - `vision`: Images used for vision
22    fine-tuning - `user_data`: Flexible file type for any purpose - `evals`: Used
23    for eval data sets
24    """
25
26    expires_after: ExpiresAfter
27    """The expiration policy for a file.
28
29    By default, files with `purpose=batch` expire after 30 days and all other files
30    are persisted until they are manually deleted.
31    """
32
33
34class ExpiresAfter(TypedDict, total=False):
35    anchor: Required[Literal["created_at"]]
36    """Anchor timestamp after which the expiration policy applies.
37
38    Supported anchors: `created_at`.
39    """
40
41    seconds: Required[int]
42    """The number of seconds after the anchor time that the file will expire.
43
44    Must be between 3600 (1 hour) and 2592000 (30 days).
45    """