
    2Rjb                       d dl mZ d dl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mZmZmZ ddlmZmZ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mZm Z  ddl!m"Z"m#Z# ddl$m%Z%m&Z&m'Z' ddl(m)Z) ddl*m+Z+ ddl,m-Z- ddl.m/Z/ ddgZ0 G d de      Z1 G d de      Z2 G d d      Z3 G d d      Z4 G d d      Z5 G d d      Z6y)    )annotationsN)Literal   )_legacy_response)BodyOmitQueryHeadersNotGivenSequenceNotStromit	not_given)path_templatemaybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncPage	AsyncPageSyncConversationCursorPageAsyncConversationCursorPage)AsyncPaginatormake_request_options)permission_list_paramspermission_create_paramspermission_retrieve_params)PermissionListResponse)PermissionCreateResponse)PermissionDeleteResponse)PermissionRetrieveResponsePermissionsAsyncPermissionsc            
      >   e Zd ZdZedd       Zedd       Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ e	j                  d      eeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	       Zeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r$   IManage fine-tuning jobs to tailor a model to your specific training data.c                    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
        )PermissionsWithRawResponseselfs    |/var/www/html/meridian/meridian-ai/venv/lib/python3.12/site-packages/openai/resources/fine_tuning/checkpoints/permissions.pywith_raw_responsezPermissions.with_raw_response"   s     *$//    c                    t        |       S 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
        ) PermissionsWithStreamingResponser+   s    r-   with_streaming_responsez#Permissions.with_streaming_response,   s     055r/   Nextra_headersextra_query
extra_bodytimeoutc                   |st        d|      | j                  t        d|      t        t           t        d|it        j                        t        ||||ddi      t        d	      S 
a?  
        **NOTE:** Calling this endpoint requires an [admin API key](../admin-api-keys).

        This enables organization owners to share fine-tuned models with other projects
        in their organization.

        Args:
          project_ids: The project identifiers to grant access to.

          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
        JExpected a non-empty value for `fine_tuned_model_checkpoint` but received B/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissionsfine_tuned_model_checkpointproject_idsbearer_authTr5   r6   r7   r8   securitypost)pagebodyoptionsmodelmethod)	
ValueError_get_api_listr   r   r!   r   r   PermissionCreateParamsr   r,   r>   r?   r5   r6   r7   r8   s          r-   createzPermissions.create5   s    : +\]x\{|  !!T,G 23 -!=?W?n?no(+'%'. + " 
 	
r/   IRetrieve is deprecated. Please swap to the paginated list method instead.afterlimitorder
project_idr5   r6   r7   r8   c                   |st        d|      | j                  t        d|      t        ||||	t	        ||||dt
        j                        ddi      t              S )	  
        **NOTE:** This endpoint requires an [admin API key](../admin-api-keys).

        Organization owners can use this endpoint to view all permissions for a
        fine-tuned model checkpoint.

        Args:
          after: Identifier for the last permission ID from the previous pagination request.

          limit: Number of permissions to retrieve.

          order: The order in which to retrieve permissions.

          project_id: The ID of the project to get permissions for.

          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
        r;   r<   r=   rP   rQ   rR   rS   r@   Tr5   r6   r7   r8   queryrB   rF   cast_to)rI   _getr   r   r   r   PermissionRetrieveParamsr#   
r,   r>   rP   rQ   rR   rS   r5   r6   r7   r8   s
             r-   retrievezPermissions.retrieveh   s    N +\]x\{|  yyT,G )+'%%!&!&!&&0	 /GG (.  /+  
 	
r/   c                   |st        d|      | j                  t        d|      t        t           t        ||||	t        ||||dt        j                        ddi      t              S 	rU   r;   r<   r=   rV   r@   TrW   )rD   rF   rG   )	rI   rJ   r   r   r    r   r   r   PermissionListParamsr]   s
             r-   listzPermissions.list   s    L +\]x\{|  !!T,G ,,BC(+'%%!&!&!&&0	 +?? (.  )- " 
 	
r/   c                   |st        d|      |st        d|      | j                  t        d||      t        ||||ddi      t              S )	  
        **NOTE:** This endpoint requires an [admin API key](../admin-api-keys).

        Organization owners can use this endpoint to delete a permission for a
        fine-tuned model checkpoint.

        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
        r;   <Expected a non-empty value for `permission_id` but received R/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}r>   permission_idr@   TrA   rY   rI   _deleter   r   r"   r,   rh   r>   r5   r6   r7   r8   s          r-   deletezPermissions.delete   s    6 +\]x\{|  [\i[lmnn||d,G+
 )+'%'. -  
 	
r/   )returnr*   )rm   r2   )r>   strr?   SequenceNotStr[str]r5   Headers | Noner6   Query | Noner7   Body | Noner8   'float | httpx.Timeout | None | NotGivenrm   z"SyncPage[PermissionCreateResponse]r>   rn   rP   
str | OmitrQ   
int | OmitrR   )Literal['ascending', 'descending'] | OmitrS   ru   r5   rp   r6   rq   r7   rr   r8   rs   rm   r#   )r>   rn   rP   ru   rQ   rv   rR   rw   rS   ru   r5   rp   r6   rq   r7   rr   r8   rs   rm   z2SyncConversationCursorPage[PermissionListResponse]rh   rn   r>   rn   r5   rp   r6   rq   r7   rr   r8   rs   rm   r"   __name__
__module____qualname____doc__r   r.   r3   r   rM   typing_extensions
deprecatedr   r^   rb   rl    r/   r-   r$   r$      s   S0 0 6 6 )-$("&;D1
%(1
 )	1
 &1
 "1
  1
 91
 
,1
f "!!"mn
 ! ;?!% )-$("&;D@
%(@
 	@

 @
 9@
 @
 &@
 "@
  @
 9@
 
$@
 o@
L ! ;?!% )-$("&;DA
%(A
 	A

 A
 9A
 A
 &A
 "A
  A
 9A
 
<A
T )-$("&;D/
/
 &)	/
 &/
 "/
  /
 9/
 
"/
r/   c            
      >   e Zd ZdZedd       Zedd       Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZ e	j                  d      eeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd	       Zeeeeddded	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd
Zddded	 	 	 	 	 	 	 	 	 	 	 	 	 ddZy)r%   r'   c                    t        |       S r)   )AsyncPermissionsWithRawResponser+   s    r-   r.   z"AsyncPermissions.with_raw_response#  s     /t44r/   c                    t        |       S r1   )%AsyncPermissionsWithStreamingResponser+   s    r-   r3   z(AsyncPermissions.with_streaming_response-  s     5T::r/   Nr4   c                   |st        d|      | j                  t        d|      t        t           t        d|it        j                        t        ||||ddi      t        d	      S r:   )	rI   rJ   r   r   r!   r   r   rK   r   rL   s          r-   rM   zAsyncPermissions.create6  s    : +\]x\{|  !!T,G 34 -!=?W?n?no(+'%'. + " 
 	
r/   rN   rO   c                  K   |st        d|      | j                  t        d|      t        ||||	t	        ||||dt
        j                         d{   ddi      t        	       d{   S 7 7 w)
rU   r;   r<   r=   rV   Nr@   TrW   rY   )rI   r[   r   r   r   r   r\   r#   r]   s
             r-   r^   zAsyncPermissions.retrievei  s     N +\]x\{|  YYT,G )+'%1!&!&!&&0	 /GG  (.  /+  
 
 	

s$   AA8A4A8/A60A86A8c                   |st        d|      | j                  t        d|      t        t           t        ||||	t        ||||dt        j                        ddi      t              S r`   )	rI   rJ   r   r   r    r   r   r   ra   r]   s
             r-   rb   zAsyncPermissions.list  s    L +\]x\{|  !!T,G --CD(+'%%!&!&!&&0	 +?? (.  )- " 
 	
r/   c                  K   |st        d|      |st        d|      | j                  t        d||      t        ||||ddi      t               d	{   S 7 w)
rd   r;   re   rf   rg   r@   TrA   rY   Nri   rk   s          r-   rl   zAsyncPermissions.delete  s     6 +\]x\{|  [\i[lmnn\\d,G+
 )+'%'. - " 
 
 	
 
s   AA!AA!)rm   r   )rm   r   )r>   rn   r?   ro   r5   rp   r6   rq   r7   rr   r8   rs   rm   zMAsyncPaginator[PermissionCreateResponse, AsyncPage[PermissionCreateResponse]]rt   )r>   rn   rP   ru   rQ   rv   rR   rw   rS   ru   r5   rp   r6   rq   r7   rr   r8   rs   rm   z[AsyncPaginator[PermissionListResponse, AsyncConversationCursorPage[PermissionListResponse]]rx   ry   r   r/   r-   r%   r%      s   S5 5 ; ; )-$("&;D1
%(1
 )	1
 &1
 "1
  1
 91
 
W1
f "!!"mn
 ! ;?!% )-$("&;D@
%(@
 	@

 @
 9@
 @
 &@
 "@
  @
 9@
 
$@
 o@
L ! ;?!% )-$("&;DA
%(A
 	A

 A
 9A
 A
 &A
 "A
  A
 9A
 
eA
T )-$("&;D/
/
 &)	/
 &/
 "/
  /
 9/
 
"/
r/   c                      e Zd ZddZy)r*   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y N)_permissionsr   to_raw_response_wrapperrM   r^   rb   rl   r,   permissionss     r-   __init__z#PermissionsWithRawResponse.__init__"  s    '&>>
 44$$ 	
 %<<
	 '>>
r/   Nr   r$   rm   Nonerz   r{   r|   r   r   r/   r-   r*   r*   !      
r/   r*   c                      e Zd ZddZy)r   c                2   || _         t        j                  |j                        | _        t        j                  |j                        | _        t        j                  |j
                        | _        t        j                  |j                        | _        y r   )r   r   async_to_raw_response_wrapperrM   r^   rb   rl   r   s     r-   r   z(AsyncPermissionsWithRawResponse.__init__6  s    '&DD
 ::$$ 	
 %BB
	 'DD
r/   Nr   r%   rm   r   r   r   r/   r-   r   r   5  r   r/   r   c                      e Zd ZddZy)r2   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r   )r   r   rM   r^   rb   rl   r   s     r-   r   z)PermissionsWithStreamingResponse.__init__J  sg    '2
 )$$ 	
 1
	 3
r/   Nr   r   r   r/   r-   r2   r2   I  r   r/   r2   c                      e Zd ZddZy)r   c                    || _         t        |j                        | _        t        |j                        | _        t        |j                        | _        t        |j
                        | _        y r   )r   r   rM   r^   rb   rl   r   s     r-   r   z.AsyncPermissionsWithStreamingResponse.__init__^  sg    '8
 /$$ 	
 7
	 9
r/   Nr   r   r   r/   r-   r   r   ]  r   r/   r   )7
__future__r   r~   r   httpx r   _typesr   r   r	   r
   r   r   r   r   _utilsr   r   r   _compatr   	_resourcer   r   	_responser   r   
paginationr   r   r   r   _base_clientr   r   types.fine_tuning.checkpointsr   r   r   6types.fine_tuning.checkpoints.permission_list_responser    8types.fine_tuning.checkpoints.permission_create_responser!   8types.fine_tuning.checkpoints.permission_delete_responser"   :types.fine_tuning.checkpoints.permission_retrieve_responser#   __all__r$   r%   r*   r   r2   r   r   r/   r-   <module>r      s    #  %  ! \ \ \ L L ' ; Z g g A 
 ^ a a e,
-~
/ ~
B~
' ~
B
 
(
 
(
 
(
 
r/   