HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/openai/resources/uploads/__pycache__/parts.cpython-310.pyc
o

���g��@sddlmZddlmZmZddlZddlmZddlm	Z	m
Z
mZmZm
Z
mZddlmZmZmZmZddlmZdd	lmZmZdd
lmZmZddlmZddlmZdd
l m!Z!ddgZ"Gdd�de�Z#Gdd�de�Z$Gdd�d�Z%Gdd�d�Z&Gdd�d�Z'Gdd�d�Z(dS)�)�annotations)�Mapping�castN�)�_legacy_response)�	NOT_GIVEN�Body�Query�Headers�NotGiven�	FileTypes)�
extract_files�maybe_transform�deepcopy_minimal�async_maybe_transform)�cached_property)�SyncAPIResource�AsyncAPIResource)�to_streamed_response_wrapper�"async_to_streamed_response_wrapper)�make_request_options)�part_create_params)�
UploadPart�Parts�
AsyncPartsc@�>eZdZeddd��Zeddd��Zddded	�ddd�ZdS)r�return�PartsWithRawResponsecC�t|�S�a
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
        )r��self�r"�I/usr/local/lib/python3.10/dist-packages/openai/resources/uploads/parts.py�with_raw_response�zParts.with_raw_response�PartsWithStreamingResponsecCr�z�
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/openai/openai-python#with_streaming_response
        )r&r r"r"r#�with_streaming_response&�zParts.with_streaming_responseN��
extra_headers�extra_query�
extra_body�timeout�	upload_id�str�datarr+�Headers | Noner,�Query | Noner-�Body | Noner.�'float | httpx.Timeout | None | NotGivenrc	
Cs||s	td|����td|i�}tttttf|�dggd�}ddi|p$i�}|jd|�d�t|t	j
�|t||||d�td	�S)
�
        Adds a
        [Part](https://platform.openai.com/docs/api-reference/uploads/part-object) to an
        [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object.
        A Part represents a chunk of bytes from the file you are trying to upload.

        Each Part can be at most 64 MB, and you can add Parts until you hit the Upload
        maximum of 8 GB.

        It is possible to add multiple Parts in parallel. You can decide the intended
        order of the Parts when you
        [complete the Upload](https://platform.openai.com/docs/api-reference/uploads/complete).

        Args:
          data: The chunk of bytes for this Part.

          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
        �8Expected a non-empty value for `upload_id` but received r1��paths�Content-Type�multipart/form-data�	/uploads/�/partsr*��body�files�options�cast_to)
�
ValueErrorrr
rrr0�object�_postrr�PartCreateParamsrr�	r!r/r1r+r,r-r.r?r@r"r"r#�create/s$

��zParts.create)rr)rr&�r/r0r1rr+r2r,r3r-r4r.r5rr��__name__�
__module__�__qualname__rr$r(rrHr"r"r"r#r�	�c@r)rr�AsyncPartsWithRawResponsecCrr)rOr r"r"r#r$gr%zAsyncParts.with_raw_response�AsyncPartsWithStreamingResponsecCrr')rPr r"r"r#r(qr)z"AsyncParts.with_streaming_responseNr*r/r0r1rr+r2r,r3r-r4r.r5rc	
�s��|s
td|����td|i�}tttttf|�dggd�}ddi|p%i�}|jd|�d�t|t	j
�IdH|t||||d	�td
�IdHS)r6r7r1r8r:r;r<r=Nr*r>)
rCrr
rrr0rDrErrrFrrrGr"r"r#rHzs�$
��zAsyncParts.create)rrO)rrPrIrJr"r"r"r#rfrNc@�eZdZddd�ZdS)	r�partsrr�NonecC�||_t�|j�|_dS�N)�_partsr�to_raw_response_wrapperrH�r!rRr"r"r#�__init__��
�zPartsWithRawResponse.__init__N�rRrrrS�rKrLrMrYr"r"r"r#r��rc@rQ)	rOrRrrrScCrTrU)rVr�async_to_raw_response_wrapperrHrXr"r"r#rY�rZz"AsyncPartsWithRawResponse.__init__N�rRrrrSr\r"r"r"r#rO�r]rOc@rQ)	r&rRrrrScC�||_t|j�|_dSrU)rVrrHrXr"r"r#rY��
�z#PartsWithStreamingResponse.__init__Nr[r\r"r"r"r#r&�r]r&c@rQ)	rPrRrrrScCr`rU)rVrrHrXr"r"r#rY�raz(AsyncPartsWithStreamingResponse.__init__Nr_r\r"r"r"r#rP�r]rP))�
__future__r�typingrr�httpx�r�_typesrrr	r
rr�_utilsr
rrr�_compatr�	_resourcerr�	_responserr�_base_clientr�
types.uploadsr�types.uploads.upload_partr�__all__rrrrOr&rPr"r"r"r#�<module>s& KK