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.)func
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+   S/var/www/html/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
   r1   r2   r3   r+   r+   r+   r,   r    j   s   
 r    c                   @     e Zd ZU ded< dS )r"   r   idNr4   r5   r6   r7   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%   r0   afterOmittable[int]limitN)r4   r5   r6   r
   r<   r7   r>   r+   r+   r+   r,   r%   v   s   
 r%   c                   @  r8   )r'   r   r9   Nr:   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   r9   r0   r<   r=   r>   N)r4   r5   r6   r7   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/   r1   r2   r3   )r   r1   jsonloadsr   r
   r   fine_tuningjobsr   r.   r/   r2   r3   r   )r?   r1   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   rB   rC   r!   r9   r   r?   rD   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   rB   rC   r$   r<   r
   r>   r   )r?   fine_tuning_jobsr+   r+   r,   r$      s   
zCLIFineTuningJobs.listr'   c                 C  rE   rF   )r   rB   rC   r&   r9   r   rH   r+   r+   r,   r&      rI   zCLIFineTuningJobs.cancelr)   c                 C  s0   t  jjj| j| jpt| jptd}t| d S )N)rG   r<   r>   )	r   rB   rC   r(   r9   r<   r
   r>   r   )r?   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   )	r4   r5   r6   staticmethodr   r!   r$   r&   r(   r+   r+   r+   r,   r      s    r   )r   r   r   r   )
__future__r   r@   typingr   argparser   _utilsr   r   _typesr	   r
   r   _modelsr   
paginationr   types.fine_tuningr   r   r   r-   r    r"   r%   r'   r)   r   r+   r+   r+   r,   <module>   s&    
U