
    _i                       S SK Jr  S SKJrJrJrJr  S SKJr  S SK	r	SSK
Jr  SSKJrJrJrJrJrJrJr  SSKJrJr  SS	KJr  S
SKJrJrJrJrJrJr  SSK J!r!J"r"  SSK#J$r$J%r%  SSK&J'r'J(r(  SSK)J*r*J+r+  SSK,J-r-J.r.J/r/  SSK0J1r1  SSK2J3r3  SSK4J5r5  SS/r6 " S S\!5      r7 " S S\"5      r8 " S S5      r9 " S S5      r: " S S5      r; " S S5      r<g)     )annotations)DictUnionIterableOptional)LiteralN   )_legacy_response)BodyOmitQueryHeadersNotGivenomit	not_given)maybe_transformasync_maybe_transform)cached_property   )CheckpointsAsyncCheckpointsCheckpointsWithRawResponseAsyncCheckpointsWithRawResponse CheckpointsWithStreamingResponse%AsyncCheckpointsWithStreamingResponse)SyncAPIResourceAsyncAPIResource)to_streamed_response_wrapper"async_to_streamed_response_wrapper)SyncCursorPageAsyncCursorPage)AsyncPaginatormake_request_options)job_list_paramsjob_create_paramsjob_list_events_params)Metadata)FineTuningJob)FineTuningJobEventJobs	AsyncJobsc                     \ rS rSr\SS j5       r\SS j5       r\SS j5       r\\\\\\\SSS\	S.                           SS jjr
SSS\	S.           SS	 jjr\\\SSS\	S
.               SS jjrSSS\	S.           SS jjr\\SSS\	S.               SS jjrSSS\	S.           SS jjrSSS\	S.           SS jjrSrg)r*   %   c                ,    [        U R                  5      $ N)r   _clientselfs    b/var/www/html/land-ocr/venv/lib/python3.13/site-packages/openai/resources/fine_tuning/jobs/jobs.pycheckpointsJobs.checkpoints&   s    4<<((    c                    [        U 5      $ z
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
)JobsWithRawResponser1   s    r3   with_raw_responseJobs.with_raw_response*   s     #4((r6   c                    [        U 5      $ 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
)JobsWithStreamingResponser1   s    r3   with_streaming_responseJobs.with_streaming_response4   s     )..r6   Nhyperparametersintegrationsmetadatamethodseedsuffixvalidation_fileextra_headersextra_query
extra_bodytimeoutc                   U R                  S[        UUUUUUUUU	S.	[        R                  5      [	        XXS9[
        S9$ )  
Creates a fine-tuning job which begins the process of creating a new model from
a given dataset.

Response includes details of the enqueued job including job status and the name
of the fine-tuned models once complete.

[Learn more about fine-tuning](https://platform.openai.com/docs/guides/model-optimization)

Args:
  model: The name of the model to fine-tune. You can select one of the
      [supported models](https://platform.openai.com/docs/guides/fine-tuning#which-models-can-be-fine-tuned).

  training_file: The ID of an uploaded file that contains training data.

      See [upload file](https://platform.openai.com/docs/api-reference/files/create)
      for how to upload a file.

      Your dataset must be formatted as a JSONL file. Additionally, you must upload
      your file with the purpose `fine-tune`.

      The contents of the file should differ depending on if the model uses the
      [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input),
      [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input)
      format, or if the fine-tuning method uses the
      [preference](https://platform.openai.com/docs/api-reference/fine-tuning/preference-input)
      format.

      See the
      [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization)
      for more details.

  hyperparameters: The hyperparameters used for the fine-tuning job. This value is now deprecated
      in favor of `method`, and should be passed in under the `method` parameter.

  integrations: A list of integrations to enable for your fine-tuning job.

  metadata: Set of 16 key-value pairs that can be attached to an object. This can be useful
      for storing additional information about the object in a structured format, and
      querying for objects via API or the dashboard.

      Keys are strings with a maximum length of 64 characters. Values are strings with
      a maximum length of 512 characters.

  method: The method used for fine-tuning.

  seed: The seed controls the reproducibility of the job. Passing in the same seed and
      job parameters should produce the same results, but may differ in rare cases. If
      a seed is not specified, one will be generated for you.

  suffix: A string of up to 64 characters that will be added to your fine-tuned model
      name.

      For example, a `suffix` of "custom-model-name" would produce a model name like
      `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`.

  validation_file: The ID of an uploaded file that contains validation data.

      If you provide this file, the data is used to generate validation metrics
      periodically during fine-tuning. These metrics can be viewed in the fine-tuning
      results file. The same data should not be present in both train and validation
      files.

      Your dataset must be formatted as a JSONL file. You must upload your file with
      the purpose `fine-tune`.

      See the
      [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization)
      for more details.

  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
/fine_tuning/jobs	modeltraining_filerB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   bodyoptionscast_to)_postr   r%   JobCreateParamsr#   r(   r2   rQ   rR   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   s                 r3   createJobs.create=   sf    B zz "%2'6$0 ($ $'6
 "11 )+Q[ "'  
 	
r6   rS   c          
     n    U(       d  [        SU< 35      eU R                  SU 3[        X#XES9[        S9$ )y  
Get info about a fine-tuning job.

[Learn more about fine-tuning](https://platform.openai.com/docs/guides/model-optimization)

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
AExpected a non-empty value for `fine_tuning_job_id` but received /fine_tuning/jobs/rS   rV   rW   
ValueError_getr#   r(   r2   fine_tuning_job_idrI   rJ   rK   rL   s         r3   retrieveJobs.retrieve   sQ    2 "`as`vwxxyy !3 45(+Q[ "  
 	
r6   afterlimitrD   rI   rJ   rK   rL   c                   U R                  S[        [           [        UUUU[	        UUUS.[
        R                  5      S9[        S9$ a7  
List your organization's fine-tuning jobs

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

  limit: Number of fine-tuning jobs to retrieve.

  metadata: Optional metadata filter. To filter, use the syntax `metadata[k]=v`.
      Alternatively, set `metadata=null` to indicate no metadata.

  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
rO   )rj   rk   rD   rI   rJ   rK   rL   querypagerV   rQ   )_get_api_listr    r(   r#   r   r$   JobListParamsr2   rj   rk   rD   rI   rJ   rK   rL   s           r3   list	Jobs.list   sb    @ !!.(+'%%!&!&$,
 $11  # " 
 	
r6   c          
     p    U(       d  [        SU< 35      eU R                  SU S3[        X#XES9[        S9$ )  
Immediately cancel a fine-tune job.

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_   r`   /cancelrS   ra   rc   rX   r#   r(   re   s         r3   cancelJobs.cancel  S    . "`as`vwxxzz !3 4G<(+Q[ "  
 	
r6   rj   rk   rI   rJ   rK   rL   c                   U(       d  [        SU< 35      eU R                  SU S3[        [           [	        UUUU[        UUS.[        R                  5      S9[        S9$ a  
Get status updates for a fine-tuning job.

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

  limit: Number of events 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
r_   r`   z/events)rj   rk   rn   rp   )rc   rr   r    r)   r#   r   r&   JobListEventsParamsr2   rf   rj   rk   rI   rJ   rK   rL   s           r3   list_eventsJobs.list_events,  s    : "`as`vwxx!! !3 4G< 23(+'%%!&!& +>> %! " 
 	
r6   c          
     p    U(       d  [        SU< 35      eU R                  SU S3[        X#XES9[        S9$ )  
Pause a fine-tune job.

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_   r`   /pauserS   ra   rz   re   s         r3   pause
Jobs.pause^  sS    . "`as`vwxxzz !3 4F;(+Q[ "  
 	
r6   c          
     p    U(       d  [        SU< 35      eU R                  SU S3[        X#XES9[        S9$ )  
Resume a fine-tune job.

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_   r`   /resumerS   ra   rz   re   s         r3   resumeJobs.resume  r}   r6    )returnr   )r   r9   )r   r>   rQ   zQUnion[str, Literal['babbage-002', 'davinci-002', 'gpt-3.5-turbo', 'gpt-4o-mini']]rR   strrB   z(job_create_params.Hyperparameters | OmitrC   z8Optional[Iterable[job_create_params.Integration]] | OmitrD   zOptional[Metadata] | OmitrE   zjob_create_params.Method | OmitrF   zOptional[int] | OmitrG   Optional[str] | OmitrH   r   rI   Headers | NonerJ   Query | NonerK   Body | NonerL   'float | httpx.Timeout | None | NotGivenr   r(   rf   r   rI   r   rJ   r   rK   r   rL   r   r   r(   )rj   
str | Omitrk   
int | OmitrD   Optional[Dict[str, str]] | OmitrI   r   rJ   r   rK   r   rL   r   r   zSyncCursorPage[FineTuningJob])rf   r   rj   r   rk   r   rI   r   rJ   r   rK   r   rL   r   r   z"SyncCursorPage[FineTuningJobEvent]__name__
__module____qualname____firstlineno__r   r4   r:   r?   r   r   r[   rg   ru   r{   r   r   r   __static_attributes__r   r6   r3   r*   r*   %   s   ) ) ) ) / / EIQU.226%)'+04 )-$("&;D#u
 au
 	u

 Bu
 Ou
 ,u
 0u
 #u
 %u
 .u
 &u
 "u
   !u
" 9#u
$ 
%u
z )-$("&;D!
!
 &!
 "!
  !
 9!
 
!
L ! 48 )-$("&;D2
 2
 	2

 22
 &2
 "2
  2
 92
 
'2
t )-$("&;D

 &
 "
  
 9
 

J !  )-$("&;D0
0
 	0

 0
 &0
 "0
  0
 90
 
,0
p )-$("&;D

 &
 "
  
 9
 

N )-$("&;D

 &
 "
  
 9
 

 
r6   c                     \ rS rSr\SS j5       r\SS j5       r\SS j5       r\\\\\\\SSS\	S.                           SS jjr
SSS\	S.           SS	 jjr\\\SSS\	S
.               SS jjrSSS\	S.           SS jjr\\SSS\	S.               SS jjrSSS\	S.           SS jjrSSS\	S.           SS jjrSrg)r+   i  c                ,    [        U R                  5      $ r/   )r   r0   r1   s    r3   r4   AsyncJobs.checkpoints  s    --r6   c                    [        U 5      $ r8   )AsyncJobsWithRawResponser1   s    r3   r:   AsyncJobs.with_raw_response  s     (--r6   c                    [        U 5      $ r=   )AsyncJobsWithStreamingResponser1   s    r3   r?   !AsyncJobs.with_streaming_response  s     .d33r6   NrA   c                  #    U R                  S[        UUUUUUUUU	S.	[        R                  5      I Sh  vN [	        XXS9[
        S9I Sh  vN $  N N7f)rN   rO   rP   NrS   rT   )rX   r   r%   rY   r#   r(   rZ   s                 r3   r[   AsyncJobs.create  s}     B ZZ,"%2'6$0 ($ $'6
 "11  )+Q[ "'   
 
 	

s!   4AA
AAAArS   c          
        #    U(       d  [        SU< 35      eU R                  SU 3[        X#XES9[        S9I Sh  vN $  N7f)r^   r_   r`   rS   ra   Nrb   re   s         r3   rg   AsyncJobs.retrieve0  s^     2 "`as`vwxxYY !3 45(+Q[ "  
 
 	
 
s   :AAAri   c                   U R                  S[        [           [        UUUU[	        UUUS.[
        R                  5      S9[        S9$ rm   )rr   r!   r(   r#   r   r$   rs   rt   s           r3   ru   AsyncJobs.listS  sb    @ !! /(+'%%!&!&$,
 $11  # " 
 	
r6   c          
        #    U(       d  [        SU< 35      eU R                  SU S3[        X#XES9[        S9I Sh  vN $  N7f)rx   r_   r`   ry   rS   ra   Nrz   re   s         r3   r{   AsyncJobs.cancel  `     . "`as`vwxxZZ !3 4G<(+Q[ "   
 
 	
 
   ;AAAr~   c                   U(       d  [        SU< 35      eU R                  SU S3[        [           [	        UUUU[        UUS.[        R                  5      S9[        S9$ r   )rc   rr   r!   r)   r#   r   r&   r   r   s           r3   r   AsyncJobs.list_events  s    : "`as`vwxx!! !3 4G< !34(+'%%!&!& +>> %! " 
 	
r6   c          
        #    U(       d  [        SU< 35      eU R                  SU S3[        X#XES9[        S9I Sh  vN $  N7f)r   r_   r`   r   rS   ra   Nrz   re   s         r3   r   AsyncJobs.pause  s`     . "`as`vwxxZZ !3 4F;(+Q[ "   
 
 	
 
r   c          
        #    U(       d  [        SU< 35      eU R                  SU S3[        X#XES9[        S9I Sh  vN $  N7f)r   r_   r`   r   rS   ra   Nrz   re   s         r3   r   AsyncJobs.resume  r   r   r   )r   r   )r   r   )r   r   r   r   )rj   r   rk   r   rD   r   rI   r   rJ   r   rK   r   rL   r   r   z=AsyncPaginator[FineTuningJob, AsyncCursorPage[FineTuningJob]])rf   r   rj   r   rk   r   rI   r   rJ   r   rK   r   rL   r   r   zGAsyncPaginator[FineTuningJobEvent, AsyncCursorPage[FineTuningJobEvent]]r   r   r6   r3   r+   r+     s   . . . . 4 4 EIQU.226%)'+04 )-$("&;D#u
 au
 	u

 Bu
 Ou
 ,u
 0u
 #u
 %u
 .u
 &u
 "u
   !u
" 9#u
$ 
%u
z )-$("&;D!
!
 &!
 "!
  !
 9!
 
!
L ! 48 )-$("&;D2
 2
 	2

 22
 &2
 "2
  2
 92
 
G2
t )-$("&;D

 &
 "
  
 9
 

J !  )-$("&;D0
0
 	0

 0
 &0
 "0
  0
 90
 
Q0
p )-$("&;D

 &
 "
  
 9
 

N )-$("&;D

 &
 "
  
 9
 

 
r6   c                  2    \ rS rSrSS jr\SS j5       rSrg)r9   i  c                   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l	        g r/   )
_jobsr
   to_raw_response_wrapperr[   rg   ru   r{   r   r   r   r2   jobss     r3   __init__JobsWithRawResponse.__init__  s    
&>>KK
 )@@MM
 %<<II
	 '>>KK
 ,CC
 &==JJ

 '>>KK
r6   c                @    [        U R                  R                  5      $ r/   )r   r   r4   r1   s    r3   r4   JobsWithRawResponse.checkpoints7  s    )$***@*@AAr6   r   r{   r[   ru   r   r   r   rg   Nr   r*   r   None)r   r   r   r   r   r   r   r   r4   r   r   r6   r3   r9   r9     s    
2 B Br6   r9   c                  2    \ rS rSrSS jr\SS j5       rSrg)r   i<  c                   Xl         [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR
                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l        [        R                  " UR                  5      U l	        g r/   )
r   r
   async_to_raw_response_wrapperr[   rg   ru   r{   r   r   r   r   s     r3   r   !AsyncJobsWithRawResponse.__init__=  s    
&DDKK
 )FFMM
 %BBII
	 'DDKK
 ,II
 &CCJJ

 'DDKK
r6   c                @    [        U R                  R                  5      $ r/   )r   r   r4   r1   s    r3   r4   $AsyncJobsWithRawResponse.checkpointsV  s    .tzz/E/EFFr6   r   Nr   r+   r   r   )r   r   r   r   r6   r3   r   r   <  s    
2 G Gr6   r   c                  2    \ rS rSrSS jr\SS j5       rSrg)r>   i[  c                |   Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        g r/   )	r   r   r[   rg   ru   r{   r   r   r   r   s     r3   r   "JobsWithStreamingResponse.__init__\  s    
2KK
 5MM
 1II
	 3KK
 8
 2JJ

 3KK
r6   c                @    [        U R                  R                  5      $ r/   )r   r   r4   r1   s    r3   r4   %JobsWithStreamingResponse.checkpointsu  s    /

0F0FGGr6   r   Nr   )r   r   r   r   r6   r3   r>   r>   [  s    
2 H Hr6   r>   c                  2    \ rS rSrSS jr\SS j5       rSrg)r   iz  c                |   Xl         [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR
                  5      U l        [        UR                  5      U l        [        UR                  5      U l        [        UR                  5      U l        g r/   )	r   r   r[   rg   ru   r{   r   r   r   r   s     r3   r   'AsyncJobsWithStreamingResponse.__init__{  s    
8KK
 ;MM
 7II
	 9KK
 >
 8JJ

 9KK
r6   c                @    [        U R                  R                  5      $ r/   )r   r   r4   r1   s    r3   r4   *AsyncJobsWithStreamingResponse.checkpoints  s    4TZZ5K5KLLr6   r   Nr   )r   r   r   r   r6   r3   r   r   z  s    
2 M Mr6   r   )=
__future__r   typingr   r   r   r   typing_extensionsr   httpx r
   _typesr   r   r   r   r   r   r   _utilsr   r   _compatr   r4   r   r   r   r   r   r   	_resourcer   r   	_responser   r   
paginationr    r!   _base_clientr"   r#   types.fine_tuningr$   r%   r&   types.shared_params.metadatar'   !types.fine_tuning.fine_tuning_jobr(   'types.fine_tuning.fine_tuning_job_eventr)   __all__r*   r+   r9   r   r>   r   r   r6   r3   <module>r      s    # 2 2 %  ! L L L = '  < Z : ] \ 5 ? J;
y
? y
xy
  y
xB B>G G>H H>M Mr6   