
    f j/                    ^   d dl mZ d dlmZ d dlZddlmZ ddlmZm	Z	m
Z
mZmZ ddlmZ ddlmZ dd	lmZmZ dd
lmZmZ ddlmZmZ ddlmZmZ ddlmZmZ ddgZ  G d de          Z! G d de          Z" G d d          Z# G d d          Z$ G d d          Z% G d d          Z&dS )    )annotations)LiteralN   )_legacy_response)	NOT_GIVENBodyQueryHeadersNotGiven)maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)MessageFilefile_list_paramsFiles
AsyncFilesc            	      n    e Zd Zed d            Zed!d            Zdddedd"dZeeeedddedd#dZdS )$r   returnFilesWithRawResponsec                     t          |           S N)r   selfs    C:\Users\Terasoftware\OneDrive\Desktop\faahhh\fyndo\fyndo\venv\Lib\site-packages\openai/resources/beta/threads/messages/files.pywith_raw_responsezFiles.with_raw_response   s    #D)))    FilesWithStreamingResponsec                     t          |           S r   )r$   r   s    r!   with_streaming_responsezFiles.with_streaming_response   s    )$///r#   Nextra_headersextra_query
extra_bodytimeoutfile_idstr	thread_id
message_idr(   Headers | Noner)   Query | Noner*   Body | Noner+   'float | httpx.Timeout | None | NotGivenr   c          	         |st          d|          |st          d|          |st          d|          ddi|pi }|                     d| d| d| t          ||||	          t          
          S )M  
        Retrieves a message 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
        8Expected a non-empty value for `thread_id` but received 9Expected a non-empty value for `message_id` but received 6Expected a non-empty value for `file_id` but received OpenAI-Betaassistants=v1	/threads/
/messages//files/r'   optionscast_to
ValueError_getr   r   r    r,   r.   r/   r(   r)   r*   r+   s           r!   retrievezFiles.retrieve"   s    2  	geXaeefff 	igYcgghhh 	caV]aabbb&QM<ORQyyI	IIZIIII(+Q[el      
 
 	
r#   afterbeforelimitorderr(   r)   r*   r+   rG   str | NotGivenrH   rI   int | NotGivenrJ   !Literal['asc', 'desc'] | NotGivenSyncCursorPage[MessageFile]c       	        *   |st          d|          |st          d|          ddi|pi }|                     d| d| dt          t                   t	          |||	|
t          ||||dt          j                  	          t          
          S a  Returns a list of message 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.

          before: A cursor for use in pagination. `before` 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 before=obj_foo in order to
              fetch the previous page of the list.

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

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

          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
        r6   r7   r9   r:   r;   r<   z/files)rG   rH   rI   rJ   )r(   r)   r*   r+   query)pager?   model)rB   _get_api_listr   r   r   r   r   FileListParamsr    r/   r.   rG   rH   rI   rJ   r(   r)   r*   r+   s              r!   listz
Files.listJ   s    Z  	geXaeefff 	igYcgghhh&QM<ORQ!!?	??Z???,(+'%%!&"(!&!&	  %3    % " 
 
 	
r#   )r   r   )r   r$   r,   r-   r.   r-   r/   r-   r(   r0   r)   r1   r*   r2   r+   r3   r   r   )r/   r-   r.   r-   rG   rK   rH   rK   rI   rL   rJ   rM   r(   r0   r)   r1   r*   r2   r+   r3   r   rN   	__name__
__module____qualname__r   r"   r&   r   rE   rW    r#   r!   r   r      s        * * * _* 0 0 0 _0 )-$("&;D&
 &
 &
 &
 &
 &
Z !*!* )3< )-$("&;DE
 E
 E
 E
 E
 E
 E
 E
r#   c            	      n    e Zd Zed d            Zed!d            Zdddedd"dZeeeedddedd#dZdS )$r   r   AsyncFilesWithRawResponsec                     t          |           S r   )r_   r   s    r!   r"   zAsyncFiles.with_raw_response   s    (...r#   AsyncFilesWithStreamingResponsec                     t          |           S r   )ra   r   s    r!   r&   z"AsyncFiles.with_streaming_response   s    .t444r#   Nr'   r,   r-   r.   r/   r(   r0   r)   r1   r*   r2   r+   r3   r   c          	       K   |st          d|          |st          d|          |st          d|          ddi|pi }|                     d| d| d| t          ||||	          t          
           d{V S )r5   r6   r7   r8   r9   r:   r;   r<   r=   r'   r>   NrA   rD   s           r!   rE   zAsyncFiles.retrieve   s      2  	geXaeefff 	igYcgghhh 	caV]aabbb&QM<ORQYYI	IIZIIII(+Q[el      
 
 
 
 
 
 
 
 	
r#   rF   rG   rK   rH   rI   rL   rJ   rM   9AsyncPaginator[MessageFile, AsyncCursorPage[MessageFile]]c       	        *   |st          d|          |st          d|          ddi|pi }|                     d| d| dt          t                   t	          |||	|
t          ||||dt          j                  	          t          
          S rP   )rB   rT   r   r   r   r   r   rU   rV   s              r!   rW   zAsyncFiles.list   s    Z  	geXaeefff 	igYcgghhh&QM<ORQ!!?	??Z??? -(+'%%!&"(!&!&	  %3    % " 
 
 	
r#   )r   r_   )r   ra   rX   )r/   r-   r.   r-   rG   rK   rH   rK   rI   rL   rJ   rM   r(   r0   r)   r1   r*   r2   r+   r3   r   rd   rY   r]   r#   r!   r   r      s        / / / _/ 5 5 5 _5 )-$("&;D&
 &
 &
 &
 &
 &
Z !*!* )3< )-$("&;DE
 E
 E
 E
 E
 E
 E
 E
r#   c                      e Zd ZddZdS )r   filesr   r   Nonec                    || _         t          j        |j                  | _        t          j        |j                  | _        d S r   )_filesr   to_raw_response_wrapperrE   rW   r    rg   s     r!   __init__zFilesWithRawResponse.__init__  sA    (@N
 
 %<J
 
			r#   Nrg   r   r   rh   rZ   r[   r\   rm   r]   r#   r!   r   r     (        
 
 
 
 
 
r#   r   c                      e Zd ZddZdS )r_   rg   r   r   rh   c                    || _         t          j        |j                  | _        t          j        |j                  | _        d S r   )rj   r   async_to_raw_response_wrapperrE   rW   rl   s     r!   rm   z"AsyncFilesWithRawResponse.__init__  sA    (FN
 
 %BJ
 
			r#   Nrg   r   r   rh   ro   r]   r#   r!   r_   r_     rp   r#   r_   c                      e Zd ZddZdS )r$   rg   r   r   rh   c                x    || _         t          |j                  | _        t          |j                  | _        d S r   )rj   r   rE   rW   rl   s     r!   rm   z#FilesWithStreamingResponse.__init__$  s;    4N
 
 1J
 
			r#   Nrn   ro   r]   r#   r!   r$   r$   #  rp   r#   r$   c                      e Zd ZddZdS )ra   rg   r   r   rh   c                x    || _         t          |j                  | _        t          |j                  | _        d S r   )rj   r   rE   rW   rl   s     r!   rm   z(AsyncFilesWithStreamingResponse.__init__0  s;    :N
 
 7J
 
			r#   Nrt   ro   r]   r#   r!   ra   ra   /  rp   r#   ra   )'
__future__r   typing_extensionsr   httpx r   _typesr   r   r	   r
   r   _utilsr   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r   types.beta.threads.messagesr   r   __all__r   r   r   r_   r$   ra   r]   r#   r!   <module>r      s:   # " " " " " % % % % % %  " " " " " " A A A A A A A A A A A A A A ' ' ' ' ' ' ( ( ( ( ( ( < < < < < < < < [ [ [ [ [ [ [ [ ; ; ; ; ; ; ; ;        K J J J J J J JL
!v
 v
 v
 v
 v
O v
 v
 v
rv
 v
 v
 v
 v
! v
 v
 v
r	
 	
 	
 	
 	
 	
 	
 	
	
 	
 	
 	
 	
 	
 	
 	
	
 	
 	
 	
 	
 	
 	
 	
	
 	
 	
 	
 	
 	
 	
 	
 	
 	
r#   