
    хiho                       S SK Jr  S SK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  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K-J.r.  SSK/J0r0  SS/r1 " S S\5      r2 " S S\5      r3 " S S5      r4 " S S5      r5 " S S5      r6 " S S5      r7g)    )annotations)UnionIterableOptional)LiteralN   )_legacy_response)	NOT_GIVENBodyQueryHeadersNotGiven)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)FineTuningJob)FineTuningJobEventJobs	AsyncJobsc            
      l   \ 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rg)r&   '   c                ,    [        U R                  5      $ N)r   _clientselfs    `/home/james-whalen/.local/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
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
)JobsWithRawResponser-   s    r/   with_raw_responseJobs.with_raw_response,   s     #4((r2   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
)JobsWithStreamingResponser-   s    r/   with_streaming_responseJobs.with_streaming_response6   s     )..r2   N	hyperparametersintegrationsseedsuffixvalidation_fileextra_headersextra_query
extra_bodytimeoutc               ~    U R                  S[        UUUUUUUS.[        R                  5      [	        XXS9[
        S9$ )Y
  
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/fine-tuning)

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) or
      [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input)
      format.

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

  hyperparameters: The hyperparameters used for the fine-tuning job.

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

  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/fine-tuning)
      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_filer>   r?   r@   rA   rB   rC   rD   rE   rF   bodyoptionscast_to)_postr   r"   JobCreateParamsr    r$   r.   rK   rL   r>   r?   r@   rA   rB   rC   rD   rE   rF   s               r/   createJobs.create?   s`    b zz "%2'6$0 $'6 "11 )+Q[ "#  
 	
r2   rM   c          
     n    U(       d  [        SU< 35      eU R                  SU 3[        X#XES9[        S9$ )r  
Get info about a fine-tuning job.

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

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/rM   rP   rQ   
ValueError_getr    r$   r.   fine_tuning_job_idrC   rD   rE   rF   s         r/   retrieveJobs.retrieve   sQ    2 "`as`vwxxyy !3 45(+Q[ "  
 	
r2   afterlimitrC   rD   rE   rF   c                   U R                  S[        [           [        UUUU[	        UUS.[
        R                  5      S9[        S9$ a  
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.

  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
rI   rd   re   rC   rD   rE   rF   querypagerP   rK   )_get_api_listr   r$   r    r   r!   JobListParamsr.   rd   re   rC   rD   rE   rF   s          r/   list	Jobs.list   s^    8 !!.(+'%%!&!& $11  ! " 
 	
r2   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
rY   rZ   /cancelrM   r[   r]   rR   r    r$   r_   s         r/   cancelJobs.cancel   sS    . "`as`vwxxzz !3 4G<(+Q[ "  
 	
r2   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
rY   rZ   z/eventsrh   ri   rk   )r]   rm   r   r%   r    r   r#   JobListEventsParamsr.   r`   rd   re   rC   rD   rE   rF   s           r/   list_eventsJobs.list_events  s    : "`as`vwxx!! !3 4G< 23(+'%%!&!& +>> %! " 
 	
r2    )returnr   )r   r5   )r   r:   rK   zQUnion[str, Literal['babbage-002', 'davinci-002', 'gpt-3.5-turbo', 'gpt-4o-mini']]rL   strr>   z,job_create_params.Hyperparameters | NotGivenr?   z<Optional[Iterable[job_create_params.Integration]] | NotGivenr@   zOptional[int] | NotGivenrA   Optional[str] | NotGivenrB   r   rC   Headers | NonerD   Query | NonerE   Body | NonerF   'float | httpx.Timeout | None | NotGivenr   r$   r`   r   rC   r   rD   r   rE   r   rF   r   r   r$   )rd   str | NotGivenre   int | NotGivenrC   r   rD   r   rE   r   rF   r   r   zSyncCursorPage[FineTuningJob])r`   r   rd   r   re   r   rC   r   rD   r   rE   r   rF   r   r   z"SyncCursorPage[FineTuningJobEvent]__name__
__module____qualname____firstlineno__r   r0   r6   r;   r
   rU   ra   rp   rv   r|   __static_attributes__r~   r2   r/   r&   r&   '   sW   ) ) ) ) / / IRU^)2+44= )-$("&;Dc
 ac
 	c

 Fc
 Sc
 'c
 )c
 2c
 &c
 "c
  c
 9c
  
!c
V )-$("&;D!
!
 &!
 "!
  !
 9!
 
!
L !* ) )-$("&;D-
 -
 	-
 &-
 "-
  -
 9-
 
'-
j )-$("&;D

 &
 "
  
 9
 

J !* ) )-$("&;D0
0
 	0

 0
 &0
 "0
  0
 90
 
,0
 0
r2   c            
      l   \ 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rg)r'   iJ  c                ,    [        U R                  5      $ r+   )r   r,   r-   s    r/   r0   AsyncJobs.checkpointsK  s    --r2   c                    [        U 5      $ r4   )AsyncJobsWithRawResponser-   s    r/   r6   AsyncJobs.with_raw_responseO  s     (--r2   c                    [        U 5      $ r9   )AsyncJobsWithStreamingResponser-   s    r/   r;   !AsyncJobs.with_streaming_responseY  s     .d33r2   Nr=   c                  #    U R                  S[        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)rH   rI   rJ   NrM   rN   )rR   r   r"   rS   r    r$   rT   s               r/   rU   AsyncJobs.createb  sw     b ZZ,"%2'6$0 $'6 "11  )+Q[ "#   
 
 	

s!   2AA
AAAArM   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)rX   rY   rZ   rM   r[   Nr\   r_   s         r/   ra   AsyncJobs.retrieve  s^     2 "`as`vwxxYY !3 45(+Q[ "  
 
 	
 
s   :AAArc   c                   U R                  S[        [           [        UUUU[	        UUS.[
        R                  5      S9[        S9$ rg   )rm   r   r$   r    r   r!   rn   ro   s          r/   rp   AsyncJobs.list  s^    8 !! /(+'%%!&!& $11  ! " 
 	
r2   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)rs   rY   rZ   rt   rM   r[   Nru   r_   s         r/   rv   AsyncJobs.cancel  s`     . "`as`vwxxZZ !3 4G<(+Q[ "   
 
 	
 
s   ;AAA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$ ry   )r]   rm   r   r%   r    r   r#   rz   r{   s           r/   r|   AsyncJobs.list_events:  s    : "`as`vwxx!! !3 4G< !34(+'%%!&!& +>> %! " 
 	
r2   r~   )r   r   )r   r   )r   r   r   r   )rd   r   re   r   rC   r   rD   r   rE   r   rF   r   r   z=AsyncPaginator[FineTuningJob, AsyncCursorPage[FineTuningJob]])r`   r   rd   r   re   r   rC   r   rD   r   rE   r   rF   r   r   zGAsyncPaginator[FineTuningJobEvent, AsyncCursorPage[FineTuningJobEvent]]r   r~   r2   r/   r'   r'   J  sY   . . . . 4 4 IRU^)2+44= )-$("&;Dc
 ac
 	c

 Fc
 Sc
 'c
 )c
 2c
 &c
 "c
  c
 9c
  
!c
V )-$("&;D!
!
 &!
 "!
  !
 9!
 
!
L !* ) )-$("&;D-
 -
 	-
 &-
 "-
  -
 9-
 
G-
j )-$("&;D

 &
 "
  
 9
 

J !* ) )-$("&;D0
0
 	0

 0
 &0
 "0
  0
 90
 
Q0
 0
r2   c                  2    \ rS rSrSS jr\SS j5       rSrg)r5   im  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        g r+   )_jobsr	   to_raw_response_wrapperrU   ra   rp   rv   r|   r.   jobss     r/   __init__JobsWithRawResponse.__init__n  s    
&>>KK
 )@@MM
 %<<II
	 '>>KK
 ,CC
r2   c                @    [        U R                  R                  5      $ r+   )r   r   r0   r-   s    r/   r0   JobsWithRawResponse.checkpoints  s    )$***@*@AAr2   r   rv   rU   rp   r|   ra   Nr   r&   r   None)r   r   r   r   r   r   r   r   r0   r   r~   r2   r/   r5   r5   m  s    
& B Br2   r5   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        g r+   )r   r	   async_to_raw_response_wrapperrU   ra   rp   rv   r|   r   s     r/   r   !AsyncJobsWithRawResponse.__init__  s    
&DDKK
 )FFMM
 %BBII
	 'DDKK
 ,II
r2   c                @    [        U R                  R                  5      $ r+   )r   r   r0   r-   s    r/   r0   $AsyncJobsWithRawResponse.checkpoints  s    .tzz/E/EFFr2   r   Nr   r'   r   r   )r   r   r   r~   r2   r/   r   r     s    
& G Gr2   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        g r+   )r   r   rU   ra   rp   rv   r|   r   s     r/   r   "JobsWithStreamingResponse.__init__  sq    
2KK
 5MM
 1II
	 3KK
 8
r2   c                @    [        U R                  R                  5      $ r+   )r   r   r0   r-   s    r/   r0   %JobsWithStreamingResponse.checkpoints  s    /

0F0FGGr2   r   Nr   )r   r   r   r~   r2   r/   r:   r:     s    
& H Hr2   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        g r+   )r   r   rU   ra   rp   rv   r|   r   s     r/   r   'AsyncJobsWithStreamingResponse.__init__  sq    
8KK
 ;MM
 7II
	 9KK
 >
r2   c                @    [        U R                  R                  5      $ r+   )r   r   r0   r-   s    r/   r0   *AsyncJobsWithStreamingResponse.checkpoints  s    4TZZ5K5KLLr2   r   Nr   )r   r   r   r~   r2   r/   r   r     s    
& M Mr2   r   )8
__future__r   typingr   r   r   typing_extensionsr   httpx r	   _typesr
   r   r   r   r   _utilsr   r   _compatr   r0   r   r   r   r   r   r   	_resourcer   r   	_responser   r   
paginationr   r   _base_clientr   r    types.fine_tuningr!   r"   r#   !types.fine_tuning.fine_tuning_jobr$   'types.fine_tuning.fine_tuning_job_eventr%   __all__r&   r'   r5   r   r:   r   r~   r2   r/   <module>r      s    # , , %  ! @ @ (  < Z : ] \ ? J;
`
? `
F	`
  `
F	B B2G G2H H2M Mr2   