
    eiv                       S SK Jr  S SKrS SKrS SKJrJr  S SKJr  S SKrSSK	J
r
  SSKJrJrJr  SSKJrJr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$J%r%J&r&J'r'J(r(  SSK)J*r*J+r+  SSK,J-r-J.r.  SSK/J0r0  SSK1J2r2  SSK3Jr  SS/r4 " S S\ 5      r5 " S S\!5      r6 " S S5      r7 " S S5      r8 " S S5      r9 " S S5      r:g)    )annotationsN)Mappingcast)Literal   )_legacy_response)FilePurposefile_list_paramsfile_create_params)BodyOmitQueryHeadersNotGiven	FileTypesomit	not_given)extract_filesmaybe_transformdeepcopy_minimalasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)StreamedBinaryAPIResponseAsyncStreamedBinaryAPIResponseto_streamed_response_wrapper"async_to_streamed_response_wrapper#to_custom_streamed_response_wrapper)async_to_custom_streamed_response_wrapper)SyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)
FileObject)FileDeleted)r	   Files
AsyncFilesc            	         \ 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SS\S.           SS jjr
\\\\SSS\S	.                 SS
 jjrSSS\S.           SS jjrSSS\S.           SS jjr\R                  " S5      SSS\S.           SS jj5       r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
)FilesWithRawResponseselfs    d/var/www/html/BTCUSD/btcusdt_trading_app/venv/lib/python3.13/site-packages/openai/resources/files.pywith_raw_responseFiles.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
)FilesWithStreamingResponser.   s    r0   with_streaming_responseFiles.with_streaming_response.   s     *$//r3   Nexpires_afterextra_headersextra_query
extra_bodytimeoutc                   [        UUUS.5      n[        [        [        [        [
        4   U5      S//S9n	SS0U=(       d    0 EnU R                  S[        U[        R                  5      U	[        XEXgS9[        S9$ )	  Upload a file that can be used across various endpoints.

Individual files can be
up to 512 MB, and the size of all files uploaded by one organization can be up
to 1 TB.

- The Assistants API supports files up to 2 million tokens and of specific file
  types. See the
  [Assistants Tools guide](https://platform.openai.com/docs/assistants/tools)
  for details.
- The Fine-tuning API only supports `.jsonl` files. The input also has certain
  required formats for fine-tuning
  [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input)
  or
  [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input)
  models.
- The Batch API only supports `.jsonl` files up to 200 MB in size. The input
  also has a specific required
  [format](https://platform.openai.com/docs/api-reference/batch/request-input).

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. One of: - `assistants`: Used in the
      Assistants API - `batch`: Used in the Batch API - `fine-tune`: Used for
      fine-tuning - `vision`: Images used for vision fine-tuning - `user_data`:
      Flexible file type for any purpose - `evals`: Used for eval data sets

  expires_after: The expiration policy for a file. By default, files with `purpose=batch` expire
      after 30 days and all other files are persisted until they are manually deleted.

  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
filepurposer:   rB   pathsContent-Typemultipart/form-data/filesr;   r<   r=   r>   bodyfilesoptionscast_to)r   r   r   r   strobject_postr   r   FileCreateParamsr$   r%   
r/   rB   rC   r:   r;   r<   r=   r>   rK   rL   s
             r0   createFiles.create7   s    n  "!.
 d73;#7>xjQ ()>X=CVTVXzz '9'J'JK(+Q[   
 	
r3   rI   c          
     n    U(       d  [        SU< 35      eU R                  SU 3[        X#XES9[        S9$ )&  
Returns information about a specific file.

Args:
  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
6Expected a non-empty value for `file_id` but received /files/rI   rM   rN   
ValueError_getr$   r%   r/   file_idr;   r<   r=   r>   s         r0   retrieveFiles.retrieve   sO    . UV]U`abbyygY(+Q[   
 	
r3   afterlimitorderrC   r;   r<   r=   r>   c                   U R                  S[        [           [        UUUU[	        UUUUS.[
        R                  5      S9[        S9$ a|  Returns a list of files.

Args:
  after: A cursor for use in pagination.

`after` is an object ID that defines your place
      in the list. For instance, if you make a list request and receive 100 objects,
      ending with obj_foo, your subsequent call can include after=obj_foo in order to
      fetch the next page of the list.

  limit: A limit on the number of objects to be returned. Limit can range between 1 and
      10,000, and the default is 10,000.

  order: Sort order by the `created_at` timestamp of the objects. `asc` for ascending
      order and `desc` for descending order.

  purpose: Only return files with the given purpose.

  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
rH   )rc   rd   re   rC   )r;   r<   r=   r>   query)pagerM   model)_get_api_listr!   r%   r$   r   r
   FileListParams	r/   rc   rd   re   rC   r;   r<   r=   r>   s	            r0   list
Files.list   se    P !!
+(+'%%!&!&!&#*	 %33 % " 
 	
r3   c          
     n    U(       d  [        SU< 35      eU R                  SU 3[        X#XES9[        S9$ )/  
Delete a file and remove it from all vector stores.

Args:
  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
rX   rY   rI   rZ   r\   _deleter$   r&   r^   s         r0   deleteFiles.delete   sO    . UV]U`abb||gY(+Q[    
 	
r3   c          
         U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU S3[        X#XES9[        R                  S9$ )'  
Returns the contents of the specified file.

Args:
  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
rX   Acceptapplication/binaryrY   /contentrI   rZ   r\   r]   r$   r   HttpxBinaryResponseContentr^   s         r0   contentFiles.content  sl    . UV]U`abb!#7QM<ORQyygYh'(+Q[ %??  
 	
r3   .The `.content()` method should be used insteadc          
     p    U(       d  [        SU< 35      eU R                  SU S3[        X#XES9[        S9$ )rw   rX   rY   rz   rI   rZ   r\   r]   r$   rO   r^   s         r0   retrieve_contentFiles.retrieve_content%  sQ    0 UV]U`abbyygYh'(+Q[   
 	
r3         @  poll_intervalmax_wait_secondsc               >   1 Skn[         R                   " 5       nU R                  U5      nUR                  U;  ab  U R                  U5        U R                  U5      n[         R                   " 5       U-
  U:  a  [	        SU SU S35      eUR                  U;  a  Mb  U$ )EWaits for the given file to be processed, default timeout is 30 mins.>   errordeleted	processedGiving up on waiting for file  to finish processing after 	 seconds.timer`   status_sleepRuntimeErrorr/   idr   r   TERMINAL_STATESstartrB   s          r0   wait_for_processingFiles.wait_for_processingG  s     <		}}R kk0KK&==$Dyy{U"%55"4RD8TUeTffop  kk0 r3    )returnr-   )r   r6   rB   r   rC   r	   r:   z&file_create_params.ExpiresAfter | Omitr;   Headers | Noner<   Query | Noner=   Body | Noner>   'float | httpx.Timeout | None | NotGivenr   r%   r_   rO   r;   r   r<   r   r=   r   r>   r   r   r%   )rc   
str | Omitrd   
int | Omitre   Literal['asc', 'desc'] | OmitrC   r   r;   r   r<   r   r=   r   r>   r   r   zSyncCursorPage[FileObject]r_   rO   r;   r   r<   r   r=   r   r>   r   r   r&   r_   rO   r;   r   r<   r   r=   r   r>   r   r   z+_legacy_response.HttpxBinaryResponseContentr_   rO   r;   r   r<   r   r=   r   r>   r   r   rO   r   rO   r   floatr   r   r   r%   __name__
__module____qualname____firstlineno__r   r1   r7   r   r   rT   r`   rn   rt   r}   typing_extensions
deprecatedr   r   __static_attributes__r   r3   r0   r'   r'   #   s   * * 0 0 AE )-$("&;DK
 K
 	K

 >K
 &K
 "K
  K
 9K
 
K
f )-$("&;D

 &
 "
  
 9
 

H ! /3" )-$("&;D;
 ;
 	;

 -;
 ;
 &;
 ";
  ;
 9;
 
$;
F )-$("&;D

 &
 "
  
 9
 

N )-$("&;D 
 
 & 
 " 
   
 9 
 
5 
D !!"RS )-$("&;D

 &
 "
  
 9
 

 T
J  #") 	
   
 r3   c            	         \ 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SS\S.           SS jjr
\\\\SSS\S	.                 SS
 jjrSSS\S.           SS jjrSSS\S.           SS jjr\R                  " S5      SSS\S.           SS jj5       rSSS.       SS jjrSrg)r(   i_  c                    [        U 5      $ r,   )AsyncFilesWithRawResponser.   s    r0   r1   AsyncFiles.with_raw_response`  s     )..r3   c                    [        U 5      $ r5   )AsyncFilesWithStreamingResponser.   s    r0   r7   "AsyncFiles.with_streaming_responsej  s     /t44r3   Nr9   c               *  #    [        UUUS.5      n[        [        [        [        [
        4   U5      S//S9n	SS0U=(       d    0 EnU R                  S[        U[        R                  5      I Sh  vN U	[        XEXgS9[        S	9I Sh  vN $  N N7f)
r@   rA   rB   rD   rF   rG   rH   NrI   rJ   )r   r   r   r   rO   rP   rQ   r   r   rR   r$   r%   rS   s
             r0   rT   AsyncFiles.creates  s     n  "!.
 d73;#7>xjQ ()>X=CVTVXZZ,T3E3V3VWW(+Q[    
 
 	
W
s$   A/B1B
2B
BBBrI   c          
        #    U(       d  [        SU< 35      eU R                  SU 3[        X#XES9[        S9I Sh  vN $  N7f)rW   rX   rY   rI   rZ   Nr[   r^   s         r0   r`   AsyncFiles.retrieve  s\     . UV]U`abbYYgY(+Q[   
 
 	
 
   :AAArb   c                   U R                  S[        [           [        UUUU[	        UUUUS.[
        R                  5      S9[        S9$ rg   )rk   r"   r%   r$   r   r
   rl   rm   s	            r0   rn   AsyncFiles.list  se    P !! ,(+'%%!&!&!&#*	 %33 % " 
 	
r3   c          
        #    U(       d  [        SU< 35      eU R                  SU 3[        X#XES9[        S9I Sh  vN $  N7f)rq   rX   rY   rI   rZ   Nrr   r^   s         r0   rt   AsyncFiles.delete  s\     . UV]U`abb\\gY(+Q[   " 
 
 	
 
r   c          
        #    U(       d  [        SU< 35      eSS0U=(       d    0 EnU R                  SU S3[        X#XES9[        R                  S9I Sh  vN $  N7f)	rw   rX   rx   ry   rY   rz   rI   rZ   Nr{   r^   s         r0   r}   AsyncFiles.content?  sy     . UV]U`abb!#7QM<ORQYYgYh'(+Q[ %??  
 
 	
 
s   AAAAr   c          
        #    U(       d  [        SU< 35      eU R                  SU S3[        X#XES9[        S9I Sh  vN $  N7f)rw   rX   rY   rz   rI   rZ   Nr   r^   s         r0   r   AsyncFiles.retrieve_contenta  s^     0 UV]U`abbYYgYh'(+Q[   
 
 	
 
s   ;AAAr   r   r   c                 #    1 Skn[         R                   " 5       nU R                  U5      I Sh  vN nUR                  U;  ar  U R                  U5      I Sh  vN   U R                  U5      I Sh  vN n[         R                   " 5       U-
  U:  a  [	        SU SU S35      eUR                  U;  a  Mr  U$  N Na NJ7f)r   >   r   r   r   Nr   r   r   r   r   s          r0   r   AsyncFiles.wait_for_processing  s      <		]]2&&kk0++m,,,r**Dyy{U"%55"4RD8TUeTffop  kk0  ',*s:   .B?B9(B?B;B?2B=3AB?7B?;B?=B?r   )r   r   )r   r   r   r   )rc   r   rd   r   re   r   rC   r   r;   r   r<   r   r=   r   r>   r   r   z7AsyncPaginator[FileObject, AsyncCursorPage[FileObject]]r   r   r   r   r   r   r3   r0   r(   r(   _  s   / / 5 5 AE )-$("&;DK
 K
 	K

 >K
 &K
 "K
  K
 9K
 
K
f )-$("&;D

 &
 "
  
 9
 

H ! /3" )-$("&;D;
 ;
 	;

 -;
 ;
 &;
 ";
  ;
 9;
 
A;
F )-$("&;D

 &
 "
  
 9
 

N )-$("&;D 
 
 & 
 " 
   
 9 
 
5 
D !!"RS )-$("&;D

 &
 "
  
 9
 

 T
J  #") 	
   
 r3   c                      \ rS rSrSS jrSrg)r-   i  c                   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        g N)	_filesr   to_raw_response_wrapperrT   r`   rn   rt   r}   r   r/   rL   s     r0   __init__FilesWithRawResponse.__init__  s    &>>LL
 )@@NN
 %<<JJ
	 '>>LL
 (??MM
 44&& 	r3   r   r}   rT   rt   rn   r`   r   NrL   r'   r   Noner   r   r   r   r   r   r   r3   r0   r-   r-         
r3   r-   c                      \ rS rSrSS jrSrg)r   i  c                   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        g r   )	r   r   async_to_raw_response_wrapperrT   r`   rn   rt   r}   r   r   s     r0   r   "AsyncFilesWithRawResponse.__init__  s    &DDLL
 )FFNN
 %BBJJ
	 'DDLL
 (EEMM
 ::&& 	r3   r   NrL   r(   r   r   r   r   r3   r0   r   r     r   r3   r   c                      \ rS rSrSS jrSrg)r6   i  c                R   Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        [        UR                  [        5      U l        [        UR                  5      U l	        g r   )
r   r   rT   r`   rn   rt   r   r}   r   r   r   s     r0   r   #FilesWithStreamingResponse.__init__  s    2LL
 5NN
 1JJ
	 3LL
 ;MM%

 )&& 	r3   r   Nr   r   r   r3   r0   r6   r6         
r3   r6   c                      \ rS rSrSS jrSrg)r   i  c                R   Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        [        UR                  [        5      U l        [        UR                  5      U l	        g r   )
r   r   rT   r`   rn   rt   r    r}   r   r   r   s     r0   r   (AsyncFilesWithStreamingResponse.__init__  s    8LL
 ;NN
 7JJ
	 9LL
 AMM*

 /&& 	r3   r   Nr   r   r   r3   r0   r   r     r   r3   r   );
__future__r   r   r   typingr   r   r   httpx r   typesr	   r
   r   _typesr   r   r   r   r   r   r   r   _utilsr   r   r   r   _compatr   	_resourcer   r   	_responser   r   r   r   r   r    
paginationr!   r"   _base_clientr#   r$   types.file_objectr%   types.file_deletedr&   types.file_purpose__all__r'   r(   r-   r   r6   r   r   r3   r0   <module>r      s    #     %   E E U U U \ \ % 9  9 ? * , ,L
!yO yx	y! yx	
 
4
 
4
 
6
 
r3   