o
    i5                     @  s  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 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 ddlmZmZ ddlmZ ddl m!Z! ddgZ"G dd deZ#G dd deZ$G dd dZ%G dd dZ&G dd dZ'G dd dZ(dS )    )annotationsN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)path_templatemaybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)checkpoint_list_params)FineTuningJobCheckpointCheckpointsAsyncCheckpointsc                   @  F   e Zd ZdZedddZedddZeed	d	d	ed
dddZ	d	S )r   IManage fine-tuning jobs to tailor a model to your specific training data.returnCheckpointsWithRawResponsec                 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
        )r   self r#   g/home/kim/smarthome/.venv/lib/python3.10/site-packages/openai/resources/fine_tuning/jobs/checkpoints.pywith_raw_response      zCheckpoints.with_raw_response CheckpointsWithStreamingResponsec                 C  r   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
        )r'   r!   r#   r#   r$   with_streaming_response%      z#Checkpoints.with_streaming_responseNafterlimitextra_headersextra_query
extra_bodytimeoutfine_tuning_job_idstrr,   
str | Omitr-   
int | Omitr.   Headers | Noner/   Query | Noner0   Body | Noner1   'float | httpx.Timeout | None | NotGiven'SyncCursorPage[FineTuningJobCheckpoint]c                C  L   |s	t d|| jtd|dtt t||||t||dtjdtdS a  
        List checkpoints for a fine-tuning job.

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

          limit: Number of checkpoints to retrieve.

          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
        zAExpected a non-empty value for `fine_tuning_job_id` but received z2/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints)r2   )r,   r-   )r.   r/   r0   r1   query)pageoptionsmodel)	
ValueError_get_api_listr   r   r   r   r   r   CheckpointListParamsr"   r2   r,   r-   r.   r/   r0   r1   r#   r#   r$   list.   &   
zCheckpoints.list)r   r   )r   r'   )r2   r3   r,   r4   r-   r5   r.   r6   r/   r7   r0   r8   r1   r9   r   r:   
__name__
__module____qualname____doc__r   r%   r)   r
   r   rE   r#   r#   r#   r$   r          	c                   @  r   )r   r   r   AsyncCheckpointsWithRawResponsec                 C  r   r    )rM   r!   r#   r#   r$   r%   d   r&   z"AsyncCheckpoints.with_raw_response%AsyncCheckpointsWithStreamingResponsec                 C  r   r(   )rN   r!   r#   r#   r$   r)   n   r*   z(AsyncCheckpoints.with_streaming_responseNr+   r2   r3   r,   r4   r-   r5   r.   r6   r/   r7   r0   r8   r1   r9   QAsyncPaginator[FineTuningJobCheckpoint, AsyncCursorPage[FineTuningJobCheckpoint]]c                C  r;   r<   )	rA   rB   r   r   r   r   r   r   rC   rD   r#   r#   r$   rE   w   rF   zAsyncCheckpoints.list)r   rM   )r   rN   )r2   r3   r,   r4   r-   r5   r.   r6   r/   r7   r0   r8   r1   r9   r   rO   rG   r#   r#   r#   r$   r   a   rL   c                   @     e Zd ZdddZdS )	r   checkpointsr   r   Nonec                 C     || _ t|j| _d S N)_checkpointsr   Zto_raw_response_wrapperrE   r"   rQ   r#   r#   r$   __init__      
z#CheckpointsWithRawResponse.__init__NrQ   r   r   rR   rH   rI   rJ   rW   r#   r#   r#   r$   r          r   c                   @  rP   )	rM   rQ   r   r   rR   c                 C  rS   rT   )rU   r   Zasync_to_raw_response_wrapperrE   rV   r#   r#   r$   rW      rX   z(AsyncCheckpointsWithRawResponse.__init__NrQ   r   r   rR   rZ   r#   r#   r#   r$   rM      r[   rM   c                   @  rP   )	r'   rQ   r   r   rR   c                 C     || _ t|j| _d S rT   )rU   r   rE   rV   r#   r#   r$   rW         
z)CheckpointsWithStreamingResponse.__init__NrY   rZ   r#   r#   r#   r$   r'      r[   r'   c                   @  rP   )	rN   rQ   r   r   rR   c                 C  r]   rT   )rU   r   rE   rV   r#   r#   r$   rW      r^   z.AsyncCheckpointsWithStreamingResponse.__init__Nr\   rZ   r#   r#   r#   r$   rN      r[   rN   ))
__future__r   Zhttpx r   _typesr   r   r   r   r	   r
   r   Z_utilsr   r   Z_compatr   Z	_resourcer   r   	_responser   r   Z
paginationr   r   Z_base_clientr   r   Ztypes.fine_tuning.jobsr   Z1types.fine_tuning.jobs.fine_tuning_job_checkpointr   __all__r   r   r   rM   r'   rN   r#   r#   r#   r$   <module>   s&   $II			