o
    i                     @  s   d dl mZ d dl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 dd
lmZ ddlmZ ddlmZmZ erHd dlmZ d ddZG dd deZG dd deZG dd deZG dd deZG dd deZG dd dZdS )!    )annotationsN)TYPE_CHECKING)ArgumentParser   )
get_clientprint_model   )	Omittableomit)is_given)	BaseModel)SyncCursorPage)FineTuningJobFineTuningJobEvent)_SubParsersAction	subparser!_SubParsersAction[ArgumentParser]returnNonec                 C  sV  |  d}|jddddd |jddd	dd |jd
ddtd |jdddd |jdddd |jtjtd |  d}|jddddd |jtjtd |  d}|jdddd |jddd t	d |jtj
td |  d!}|jddd"dd |jtjtd |  d#}|jddd$dd |jddd%d |jddd&t	d |jtjtd d S )'Nzfine_tuning.jobs.createz-mz--modelzThe model to fine-tune.T)helprequiredz-Fz--training-filez,The training file to fine-tune the model on.z-Hz--hyperparametersz6JSON string of hyperparameters to use for fine-tuning.)r   typez-sz--suffixz-A suffix to add to the fine-tuned model name.)r   z-Vz--validation-filez+The validation file to use for fine-tuning.)funcZ
args_modelzfine_tuning.jobs.retrievez-iz--idz*The ID of the fine-tuning job to retrieve.zfine_tuning.jobs.listz-az--afterzIdentifier for the last job from the previous pagination request. If provided, only jobs created after this job will be returned.z-lz--limitz'Number of fine-tuning jobs to retrieve.zfine_tuning.jobs.cancelz(The ID of the fine-tuning job to cancel.zfine_tuning.jobs.list_eventsz1The ID of the fine-tuning job to list events for.zIdentifier for the last event from the previous pagination request. If provided, only events created after this event will be returned.z-Number of fine-tuning job events to retrieve.)
add_parseradd_argumentstrset_defaultsCLIFineTuningJobscreateCLIFineTuningJobsCreateArgsretrieveCLIFineTuningJobsRetrieveArgsintlistCLIFineTuningJobsListArgscancelCLIFineTuningJobsCancelArgslist_eventsCLIFineTuningJobsListEventsArgs)r   sub r*   Z/home/kim/smarthome/.venv/lib/python3.10/site-packages/openai/cli/_api/fine_tuning/jobs.pyregister   s   




r,   c                   @  sB   e Zd ZU ded< ded< eZded< eZded< eZded< dS )	r   r   modeltraining_fileOmittable[str]hyperparameterssuffixvalidation_fileN)__name__
__module____qualname____annotations__r
   r0   r1   r2   r*   r*   r*   r+   r   j   s   
 r   c                   @     e Zd ZU ded< dS )r!   r   idNr3   r4   r5   r6   r*   r*   r*   r+   r!   r      
 r!   c                   @  s&   e Zd ZU eZded< eZded< dS )r$   r/   afterOmittable[int]limitN)r3   r4   r5   r
   r;   r6   r=   r*   r*   r*   r+   r$   v   s   
 r$   c                   @  r7   )r&   r   r8   Nr9   r*   r*   r*   r+   r&   {   r:   r&   c                   @  s.   e Zd ZU ded< eZded< eZded< dS )r(   r   r8   r/   r;   r<   r=   N)r3   r4   r5   r6   r
   r;   r=   r*   r*   r*   r+   r(      s   
 r(   c                   @  sR   e Zd ZedddZeddd	ZedddZedddZedddZdS )r   argsr   r   r   c                 C  sL   t | jrtt| jnt}t jjj	| j
| j|| j| jd}t| d S )N)r-   r.   r0   r1   r2   )r   r0   jsonloadsr   r
   r   fine_tuningjobsr   r-   r.   r1   r2   r   )r>   r0   fine_tuning_jobr*   r*   r+   r      s   
zCLIFineTuningJobs.creater!   c                 C      t  jjj| jd}t| d S N)fine_tuning_job_id)r   rA   rB   r    r8   r   r>   rC   r*   r*   r+   r          zCLIFineTuningJobs.retriever$   c                 C  s,   t  jjj| jp	t| jptd}t| d S )N)r;   r=   )r   rA   rB   r#   r;   r
   r=   r   )r>   Zfine_tuning_jobsr*   r*   r+   r#      s   
zCLIFineTuningJobs.listr&   c                 C  rD   rE   )r   rA   rB   r%   r8   r   rG   r*   r*   r+   r%      rH   zCLIFineTuningJobs.cancelr(   c                 C  s0   t  jjj| j| jpt| jptd}t| d S )N)rF   r;   r=   )	r   rA   rB   r'   r8   r;   r
   r=   r   )r>   Zfine_tuning_job_eventsr*   r*   r+   r'      s   
zCLIFineTuningJobs.list_eventsN)r>   r   r   r   )r>   r!   r   r   )r>   r$   r   r   )r>   r&   r   r   )r>   r(   r   r   )	r3   r4   r5   staticmethodr   r    r#   r%   r'   r*   r*   r*   r+   r      s    r   )r   r   r   r   )
__future__r   r?   typingr   argparser   Z_utilsr   r   _typesr	   r
   r   Z_modelsr   Z
paginationr   Ztypes.fine_tuningr   r   r   r,   r   r!   r$   r&   r(   r   r*   r*   r*   r+   <module>   s&    
U