docstr: Upload a file that can be used across various endpoints.
  
  The size of all the
  files uploaded by one organization can be up to 100 GB.
  
  The size of individual files can be a maximum of 512 MB or 2 million tokens for
  Assistants. See the
  [Assistants Tools guide](https://platform.openai.com/docs/assistants/tools) to
  learn more about the types of files supported. The Fine-tuning API only supports
  `.jsonl` files.
  
  Please [contact us](https://help.openai.com/) if you need to increase these
  storage limits.
  
  Args:
    file: The File object (not file name) to be uploaded.
  
    purpose: The intended purpose of the uploaded file.
  
        Use "fine-tune" for
        [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning) and
        "assistants" for
        [Assistants](https://platform.openai.com/docs/api-reference/assistants) and
        [Messages](https://platform.openai.com/docs/api-reference/messages). This allows
        us to validate the format of the uploaded file is correct for fine-tuning.
  
    extra_headers: Send extra headers
  
    extra_query: Add additional query parameters to the request
  
    extra_body: Add additional JSON properties to the request
  
    timeout: Override the client-level default timeout for this request, in seconds
docstr_tok: ["Upload","a","file","that","can","be","used","across","various","endpoints",".","The","size","of","all","the","files","uploaded","by","one","organization","can","be","up","to","100","GB",".","The","size","of","individual","files","can","be","a","maximum","of","512","MB","or","2","million","tokens","for","Assistants",".","See","the","[","Assistants","Tools","guide","]","(","https",":","\/\/platform.openai.com\/docs\/assistants\/tools",")","to","learn","more","about","the","types","of","files","supported",".","The","Fine-tuning","API","only","supports","`",".jsonl","`","files",".","Please","[","contact","us","]","(","https",":","\/\/help.openai.com\/",")","if","you","need","to","increase","these","storage","limits",".","Args",":","file",":","The","File","object","(","not","file","name",")","to","be","uploaded",".","purpose",":","The","intended","purpose","of","the","uploaded","file",".","Use","``","fine-tune","''","for","[","Fine-tuning","]","(","https",":","\/\/platform.openai.com\/docs\/api-reference\/fine-tuning",")","and","``","assistants","''","for","[","Assistants","]","(","https",":","\/\/platform.openai.com\/docs\/api-reference\/assistants",")","and","[","Messages","]","(","https",":","\/\/platform.openai.com\/docs\/api-reference\/messages",")",".","This","allows","us","to","validate","the","format","of","the","uploaded","file","is","correct","for","fine-tuning",".","extra_headers",":","Send","extra","headers","extra_query",":","Add","additional","query","parameters","to","the","request","extra_body",":","Add","additional","JSON","properties","to","the","request","timeout",":","Override","the","client-level","default","timeout","for","this","request",",","in","seconds"]
code: def create(
      self,
      *,
      file: FileTypes,
      purpose: Literal["fine-tune", "assistants"],
      # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
      # The extra values given here take precedence over values defined on the client or passed to this method.
      extra_headers: Headers | None = None,
      extra_query: Query | None = None,
      extra_body: Body | None = None,
      timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
  ) -> FileObject:
      """Upload a file that can be used across various endpoints.
  
      The size of all the
      files uploaded by one organization can be up to 100 GB.
  
      The size of individual files can be a maximum of 512 MB or 2 million tokens for
      Assistants. See the
      [Assistants Tools guide](https://platform.openai.com/docs/assistants/tools) to
      learn more about the types of files supported. The Fine-tuning API only supports
      `.jsonl` files.
  
      Please [contact us](https://help.openai.com/) if you need to increase these
      storage limits.
  
      Args:
        file: The File object (not file name) to be uploaded.
  
        purpose: The intended purpose of the uploaded file.
  
            Use "fine-tune" for
            [Fine-tuning](https://platform.openai.com/docs/api-reference/fine-tuning) and
            "assistants" for
            [Assistants](https://platform.openai.com/docs/api-reference/assistants) and
            [Messages](https://platform.openai.com/docs/api-reference/messages). This allows
            us to validate the format of the uploaded file is correct for fine-tuning.
  
        extra_headers: Send extra headers
  
        extra_query: Add additional query parameters to the request
  
        extra_body: Add additional JSON properties to the request
  
        timeout: Override the client-level default timeout for this request, in seconds
      """
      body = deepcopy_minimal(
          {
              "file": file,
              "purpose": purpose,
          }
      )
      files = extract_files(
          cast(Mapping[str, object], body), paths=[["file"]]
      )
      if files:
          # It should be noted that the actual Content-Type header that will be
          # sent to the server will contain a `boundary` parameter, e.g.
          # multipart/form-data; boundary=---abc--
          extra_headers = {
              "Content-Type": "multipart/form-data",
              **(extra_headers or {}),
          }
      return self._post(
          "/files",
          body=maybe_transform(
              body, file_create_params.FileCreateParams
          ),
          files=files,
          options=make_request_options(
              extra_headers=extra_headers,
              extra_query=extra_query,
              extra_body=extra_body,
              timeout=timeout,
          ),
          cast_to=FileObject,
      )
  
imports: from __future__ import annotations
  import time
  import typing_extensions
  from typing import Mapping, cast
  from typing_extensions import Literal
  import httpx
  from ..None import _legacy_response
  from ..types import FileObject, FileDeleted, file_list_params, file_create_params
  from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
  from .._utils import extract_files, maybe_transform, deepcopy_minimal
  from .._compat import cached_property
  from .._resource import SyncAPIResource, AsyncAPIResource
  from .._response import StreamedBinaryAPIResponse, AsyncStreamedBinaryAPIResponse, to_streamed_response_wrapper, async_to_streamed_response_wrapper, to_custom_streamed_response_wrapper, async_to_custom_streamed_response_wrapper
  from ..pagination import SyncPage, AsyncPage
  from .._base_client import AsyncPaginator, make_request_options
label_desc: Use image node_id 3 for calling the Files obj's underlying member method code with example usage: obj.create() and returns: self