
    h                    @   S SK Jr  S SKJrJr  S SKrSSKJr  SSKJ	r	J
r
JrJrJrJr  SSKJrJrJrJr  SSKJr  SS	KJrJr  SS
KJrJr  SSKJr  SSKJr  SSK J!r!  SS/r" " S S\5      r# " S S\5      r$ " S S5      r% " S S5      r& " S S5      r' " S S5      r(g)    )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                  n    \ rS rSr\SS j5       r\S	S j5       rSSS\S.             S
S jjrSr	g)r      c                    [        U 5      $ z
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
)PartsWithRawResponseselfs    P/var/www/html/env/lib/python3.13/site-packages/openai/resources/uploads/parts.pywith_raw_responseParts.with_raw_response   s     $D))    c                    [        U 5      $ 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
)PartsWithStreamingResponser!   s    r#   with_streaming_responseParts.with_streaming_response&   s     *$//r&   Nextra_headersextra_query
extra_bodytimeoutc               *   U(       d  [        SU< 35      e[        SU05      n[        [        [        [
        [        4   U5      S//S9nSS0U=(       d    0 EnU R                  SU S3[        U[        R                  5      U[        X4XVS9[        S	9$ )
=  
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 datapathsContent-Typemultipart/form-data	/uploads//partsr,   bodyfilesoptionscast_to)
ValueErrorr   r   r   r   strobject_postr   r   PartCreateParamsr   r   	r"   	upload_idr4   r-   r.   r/   r0   r<   r=   s	            r#   createParts.create/   s    H WXaWdeff/d73;#7>xjQ ()>X=CVTVXzz	{&) '9'J'JK(+Q[   
 	
r&    )returnr    )rJ   r)   rF   rA   r4   r   r-   zHeaders | Noner.   zQuery | Noner/   zBody | Noner0   z'float | httpx.Timeout | None | NotGivenrJ   r   
__name__
__module____qualname____firstlineno__r   r$   r*   r   rG   __static_attributes__rI   r&   r#   r   r      s    * * 0 0 )-$("&;D4
4
 	4
 &4
 "4
  4
 94
 
4
 4
r&   c                  n    \ rS rSr\SS j5       r\S	S j5       rSSS\S.             S
S jjrSr	g)r   f   c                    [        U 5      $ r   )AsyncPartsWithRawResponser!   s    r#   r$   AsyncParts.with_raw_responseg   s     )..r&   c                    [        U 5      $ r(   )AsyncPartsWithStreamingResponser!   s    r#   r*   "AsyncParts.with_streaming_responseq   s     /t44r&   Nr,   c               Z  #    U(       d  [        SU< 35      e[        SU05      n[        [        [        [
        [        4   U5      S//S9nSS0U=(       d    0 EnU R                  SU S3[        U[        R                  5      I Sh  vN U[        X4XVS	9[        S
9I Sh  vN $  N N7f)r2   r3   r4   r5   r7   r8   r9   r:   Nr,   r;   )r@   r   r   r   r   rA   rB   rC   r   r   rD   r   r   rE   s	            r#   rG   AsyncParts.createz   s     H WXaWdeff/d73;#7>xjQ ()>X=CVTVXZZ	{&),T3E3V3VWW(+Q[    
 
 	
W
s$   BB+	B'

B+"B)#B+)B+rI   )rJ   rU   )rJ   rX   rK   rL   rI   r&   r#   r   r   f   s    / / 5 5 )-$("&;D4
4
 	4
 &4
 "4
  4
 94
 
4
 4
r&   c                      \ rS rSrSS jrSrg)r       c                Z    Xl         [        R                  " UR                  5      U l        g N)_partsr   to_raw_response_wrapperrG   r"   partss     r#   __init__PartsWithRawResponse.__init__   s     &>>LL
r&   r`   rG   Nrc   r   rJ   NonerM   rN   rO   rP   rd   rQ   rI   r&   r#   r    r           
r&   r    c                      \ rS rSrSS jrSrg)rU      c                Z    Xl         [        R                  " UR                  5      U l        g r_   )r`   r   async_to_raw_response_wrapperrG   rb   s     r#   rd   "AsyncPartsWithRawResponse.__init__   s     &DDLL
r&   rf   Nrc   r   rJ   rh   ri   rI   r&   r#   rU   rU      rj   r&   rU   c                      \ rS rSrSS jrSrg)r)      c                D    Xl         [        UR                  5      U l        g r_   )r`   r   rG   rb   s     r#   rd   #PartsWithStreamingResponse.__init__   s    2LL
r&   rf   Nrg   ri   rI   r&   r#   r)   r)      rj   r&   r)   c                      \ rS rSrSS jrSrg)rX      c                D    Xl         [        UR                  5      U l        g r_   )r`   r   rG   rb   s     r#   rd   (AsyncPartsWithStreamingResponse.__init__   s    8LL
r&   rf   Nrp   ri   rI   r&   r#   rX   rX      rj   r&   rX   ))
__future__r   typingr   r   httpx r   _typesr   r	   r
   r   r   r   _utilsr   r   r   r   _compatr   	_resourcer   r   	_responser   r   _base_clientr   types.uploadsr   types.uploads.upload_partr   __all__r   r   r    rU   r)   rX   rI   r&   r#   <module>r      s    #      J J  ' : Y 0 / 3L
!H
O H
VH
! H
V
 

 

 

 
r&   