
    2ix\                       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 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Z/ G d de          Z0 G d de          Z1 G d d          Z2 G d d          Z3 G d d          Z4 G d d          Z5dS )    )annotationsN)Literal   )_legacy_response)BodyOmitQueryHeadersNotGivenSequenceNotStromit	not_given)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dS )-r#   IManage fine-tuning jobs to tailor a model to your specific training data.returnPermissionsWithRawResponsec                     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(   selfs    {/root/.openclaw/workspace/.venv-openai/lib/python3.11/site-packages/openai/resources/fine_tuning/checkpoints/permissions.pywith_raw_responsezPermissions.with_raw_response"   s     *$///     PermissionsWithStreamingResponsec                     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
        )r0   r+   s    r-   with_streaming_responsez#Permissions.with_streaming_response,   s     0555r/   Nextra_headersextra_query
extra_bodytimeoutfine_tuned_model_checkpointstrproject_idsSequenceNotStr[str]r5   Headers | Noner6   Query | Noner7   Body | Noner8   'float | httpx.Timeout | None | NotGiven"SyncPage[PermissionCreateResponse]c                   |st          d|          |                     d| dt          t                   t	          d|it
          j                  t          ||||          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 /fine_tuning/checkpoints//permissionsr;   r4   post)pagebodyoptionsmodelmethod)
ValueError_get_api_listr   r    r   r   PermissionCreateParamsr   r,   r9   r;   r5   r6   r7   r8   s          r-   createzPermissions.create5   s    : + 	|]x||   !!Q(CQQQ23 -!=?W?noo(+Q[el   + " 	
 	
 		
r/   IRetrieve is deprecated. Please swap to the paginated list method instead.afterlimitorder
project_idr5   r6   r7   r8   rT   
str | OmitrU   
int | OmitrV   )Literal['ascending', 'descending'] | OmitrW   r"   c                   |st          d|          |                     d| dt          ||||	t          ||||dt          j                            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
        rD   rE   rF   rT   rU   rV   rW   r5   r6   r7   r8   queryrJ   cast_to)rM   _getr   r   r   PermissionRetrieveParamsr"   
r,   r9   rT   rU   rV   rW   r5   r6   r7   r8   s
             r-   retrievezPermissions.retrievea   s    N + 	|]x||   yyQ(CQQQ(+'%%!&!&!&&0	  /G    /#  
 
 	
r/   2SyncConversationCursorPage[PermissionListResponse]c                   |st          d|          |                     d| dt          t                   t	          ||||	t          ||||dt          j                            t                    S r\   rD   rE   rF   r]   r^   )rH   rJ   rK   )rM   rN   r   r   r   r   r   PermissionListParamsrd   s
             r-   listzPermissions.list   s    L + 	|]x||   !!Q(CQQQ+,BC(+'%%!&!&!&&0	  +?    )% " 
 
 	
r/   permission_idr!   c          	         |st          d|          |st          d|          |                     d| d| t          ||||          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
        rD   <Expected a non-empty value for `permission_id` but received rE   /permissions/r4   r`   rM   _deleter   r!   r,   rk   r9   r5   r6   r7   r8   s          r-   deletezPermissions.delete   s    6 + 	|]x||    	om\immnnn||a(CaaR_aa(+Q[el   -  
 
 	
r/   )r'   r(   )r'   r0   )r9   r:   r;   r<   r5   r=   r6   r>   r7   r?   r8   r@   r'   rA   r9   r:   rT   rX   rU   rY   rV   rZ   rW   rX   r5   r=   r6   r>   r7   r?   r8   r@   r'   r"   )r9   r:   rT   rX   rU   rY   rV   rZ   rW   rX   r5   r=   r6   r>   r7   r?   r8   r@   r'   rf   rk   r:   r9   r:   r5   r=   r6   r>   r7   r?   r8   r@   r'   r!   __name__
__module____qualname____doc__r   r.   r3   r   rQ   typing_extensions
deprecatedr   re   rj   rs    r/   r-   r#   r#      sD       SS0 0 0 _0 6 6 6 _6 )-$("&;D*
 *
 *
 *
 *
 *
X "!"mnn
 ! ;?!% )-$("&;D<
 <
 <
 <
 <
 on<
D ! ;?!% )-$("&;D=
 =
 =
 =
 =
 =
L )-$("&;D'
 '
 '
 '
 '
 '
 '
 '
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dS )-r$   r&   r'   AsyncPermissionsWithRawResponsec                     t          |           S r*   )r   r+   s    r-   r.   z"AsyncPermissions.with_raw_response  s     /t444r/   %AsyncPermissionsWithStreamingResponsec                     t          |           S r2   )r   r+   s    r-   r3   z(AsyncPermissions.with_streaming_response  s     5T:::r/   Nr4   r9   r:   r;   r<   r5   r=   r6   r>   r7   r?   r8   r@   MAsyncPaginator[PermissionCreateResponse, AsyncPage[PermissionCreateResponse]]c                   |st          d|          |                     d| dt          t                   t	          d|it
          j                  t          ||||          t          d          S rC   )rM   rN   r   r    r   r   rO   r   rP   s          r-   rQ   zAsyncPermissions.create  s    : + 	|]x||   !!Q(CQQQ34 -!=?W?noo(+Q[el   + " 	
 	
 		
r/   rR   rS   rT   rX   rU   rY   rV   rZ   rW   r"   c                  K   |st          d|          |                     d| dt          ||||	t          ||||dt          j                   d{V           t                     d{V S )r\   rD   rE   rF   r]   Nr^   r`   )rM   rb   r   r   r   rc   r"   rd   s
             r-   re   zAsyncPermissions.retrieveK  s      N + 	|]x||   YYQ(CQQQ(+'%1!&!&!&&0	  /G          /#  
 
 
 
 
 
 
 
 	
r/   [AsyncPaginator[PermissionListResponse, AsyncConversationCursorPage[PermissionListResponse]]c                   |st          d|          |                     d| dt          t                   t	          ||||	t          ||||dt          j                            t                    S rh   )rM   rN   r   r   r   r   r   ri   rd   s
             r-   rj   zAsyncPermissions.list  s    L + 	|]x||   !!Q(CQQQ,-CD(+'%%!&!&!&&0	  +?    )% " 
 
 	
r/   rk   r!   c          	        K   |st          d|          |st          d|          |                     d| d| t          ||||          t                     d{V S )rm   rD   rn   rE   ro   r4   r`   Nrp   rr   s          r-   rs   zAsyncPermissions.delete  s      6 + 	|]x||    	om\immnnn\\a(CaaR_aa(+Q[el   - " 
 
 
 
 
 
 
 
 	
r/   )r'   r   )r'   r   )r9   r:   r;   r<   r5   r=   r6   r>   r7   r?   r8   r@   r'   r   rt   )r9   r:   rT   rX   rU   rY   rV   rZ   rW   rX   r5   r=   r6   r>   r7   r?   r8   r@   r'   r   ru   rv   r}   r/   r-   r$   r$   	  sD       SS5 5 5 _5 ; ; ; _; )-$("&;D*
 *
 *
 *
 *
 *
X "!"mnn
 ! ;?!% )-$("&;D<
 <
 <
 <
 <
 on<
D ! ;?!% )-$("&;D=
 =
 =
 =
 =
 =
L )-$("&;D'
 '
 '
 '
 '
 '
 '
 '
r/   c                      e Zd ZddZdS )r(   permissionsr#   r'   Nonec                   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S N)_permissionsr   to_raw_response_wrapperrQ   re   rj   rs   r,   r   s     r-   __init__z#PermissionsWithRawResponse.__init__  s    '&>
 
 4$  	
 %<
 
	 '>
 
r/   Nr   r#   r'   r   rw   rx   ry   r   r}   r/   r-   r(   r(     (        
 
 
 
 
 
r/   r(   c                      e Zd ZddZdS )r   r   r$   r'   r   c                   || _         t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        t          j        |j                  | _        d S r   )r   r   async_to_raw_response_wrapperrQ   re   rj   rs   r   s     r-   r   z(AsyncPermissionsWithRawResponse.__init__  s    '&D
 
 :$  	
 %B
 
	 'D
 
r/   Nr   r$   r'   r   r   r}   r/   r-   r   r     r   r/   r   c                      e Zd ZddZdS )r0   r   r#   r'   r   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r   )r   r   rQ   re   rj   rs   r   s     r-   r   z)PermissionsWithStreamingResponse.__init__  ss    '2
 
 )$  	
 1
 
	 3
 
r/   Nr   r   r}   r/   r-   r0   r0     r   r/   r0   c                      e Zd ZddZdS )r   r   r$   r'   r   c                    || _         t          |j                  | _        t          |j                  | _        t          |j                  | _        t          |j                  | _        d S r   )r   r   rQ   re   rj   rs   r   s     r-   r   z.AsyncPermissionsWithStreamingResponse.__init__0  ss    '8
 
 /$  	
 7
 
	 9
 
r/   Nr   r   r}   r/   r-   r   r   /  r   r/   r   )6
__future__r   r{   r   httpx r   _typesr   r   r	   r
   r   r   r   r   _utilsr   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   r0   r   r}   r/   r-   <module>r      s   # " " " " "     % % % % % %  ! ! ! ! ! ! \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ = = = = = = = = ' ' ' ' ' ' ; ; ; ; ; ; ; ; Z Z Z Z Z Z Z Z g g g g g g g g g g g g A A A A A A A A         
 ^ ] ] ] ] ] a a a a a a a a a a a a e e e e e e,
-g
 g
 g
 g
 g
/ g
 g
 g
Tg
 g
 g
 g
 g
' g
 g
 g
T
 
 
 
 
 
 
 
(
 
 
 
 
 
 
 
(
 
 
 
 
 
 
 
(
 
 
 
 
 
 
 
 
 
r/   