
    h y                       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  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K0J1r1  SSK2J3r3  SS/r4 " S S\5      r5 " S S\ 5      r6 " S S5      r7 " S S5      r8 " S S5      r9 " S S5      r:g)     )annotations)Dict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)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rg)r(   (   c                ,    [        U R                  5      $ N)r   _clientselfs    X/var/www/html/env/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
)JobsWithRawResponser/   s    r1   with_raw_responseJobs.with_raw_response-   s     #4((r4   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    r1   with_streaming_responseJobs.with_streaming_response7   s     )..r4   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/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),
      [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/fine-tuning)
      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/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@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   bodyoptionscast_to)_postr   r#   JobCreateParamsr!   r&   r0   rO   rP   r@   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   s                 r1   createJobs.create@   sf    ~ zz "%2'6$0 ($ $'6
 "11 )+Q[ "'  
 	
r4   rQ   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/rQ   rT   rU   
ValueError_getr!   r&   r0   fine_tuning_job_idrG   rH   rI   rJ   s         r1   retrieveJobs.retrieve   sQ    2 "`as`vwxxyy !3 45(+Q[ "  
 	
r4   afterlimitrB   rG   rH   rI   rJ   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
rM   )rh   ri   rB   rG   rH   rI   rJ   querypagerT   rO   )_get_api_listr   r&   r!   r   r"   JobListParamsr0   rh   ri   rB   rG   rH   rI   rJ   s           r1   list	Jobs.list   sb    @ !!.(+'%%!&!&$,
 $11  # " 
 	
r4   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^   /cancelrQ   r_   ra   rV   r!   r&   rc   s         r1   cancelJobs.cancel  sS    . "`as`vwxxzz !3 4G<(+Q[ "  
 	
r4   rh   ri   rG   rH   rI   rJ   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)rh   ri   rl   rn   )ra   rp   r   r'   r!   r   r$   JobListEventsParamsr0   rd   rh   ri   rG   rH   rI   rJ   s           r1   list_eventsJobs.list_events-  s    : "`as`vwxx!! !3 4G< 23(+'%%!&!& +>> %! " 
 	
r4    )returnr   )r   r7   )r   r<   rO   zQUnion[str, Literal['babbage-002', 'davinci-002', 'gpt-3.5-turbo', 'gpt-4o-mini']]rP   strr@   z,job_create_params.Hyperparameters | NotGivenrA   z<Optional[Iterable[job_create_params.Integration]] | NotGivenrB   zOptional[Metadata] | NotGivenrC   z#job_create_params.Method | NotGivenrD   zOptional[int] | NotGivenrE   Optional[str] | NotGivenrF   r   rG   Headers | NonerH   Query | NonerI   Body | NonerJ   'float | httpx.Timeout | None | NotGivenr   r&   rd   r   rG   r   rH   r   rI   r   rJ   r   r   r&   )rh   str | NotGivenri   int | NotGivenrB   #Optional[Dict[str, str]] | NotGivenrG   r   rH   r   rI   r   rJ   r   r   zSyncCursorPage[FineTuningJob])rd   r   rh   r   ri   r   rG   r   rH   r   rI   r   rJ   r   r   z"SyncCursorPage[FineTuningJobEvent]__name__
__module____qualname____firstlineno__r   r2   r8   r=   r   rY   re   rs   ry   r   __static_attributes__r   r4   r1   r(   r(   (   s   ) ) ) ) / / IRU^2;6?)2+44= )-$("&;D#s
 as
 	s

 Fs
 Ss
 0s
 4s
 's
 )s
 2s
 &s
 "s
   !s
" 9#s
$ 
%s
v )-$("&;D!
!
 &!
 "!
  !
 9!
 
!
L !* )8A )-$("&;D2
 2
 	2

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

 0
 &0
 "0
  0
 90
 
,0
 0
r4   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rg)r)   i`  c                ,    [        U R                  5      $ r-   )r   r.   r/   s    r1   r2   AsyncJobs.checkpointsa  s    --r4   c                    [        U 5      $ r6   )AsyncJobsWithRawResponser/   s    r1   r8   AsyncJobs.with_raw_responsee  s     (--r4   c                    [        U 5      $ r;   )AsyncJobsWithStreamingResponser/   s    r1   r=   !AsyncJobs.with_streaming_responseo  s     .d33r4   Nr?   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)rL   rM   rN   NrQ   rR   )rV   r   r#   rW   r!   r&   rX   s                 r1   rY   AsyncJobs.createx  s}     ~ ZZ,"%2'6$0 ($ $'6
 "11  )+Q[ "'   
 
 	

s!   4AA
AAAArQ   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^   rQ   r_   Nr`   rc   s         r1   re   AsyncJobs.retrieve  s^     2 "`as`vwxxYY !3 45(+Q[ "  
 
 	
 
s   :AAArg   c                   U R                  S[        [           [        UUUU[	        UUUS.[
        R                  5      S9[        S9$ rk   )rp   r   r&   r!   r   r"   rq   rr   s           r1   rs   AsyncJobs.list  sb    @ !! /(+'%%!&!&$,
 $11  # " 
 	
r4   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)rv   r]   r^   rw   rQ   r_   Nrx   rc   s         r1   ry   AsyncJobs.cancelD  s`     . "`as`vwxxZZ !3 4G<(+Q[ "   
 
 	
 
s   ;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}   )ra   rp   r   r'   r!   r   r$   r~   r   s           r1   r   AsyncJobs.list_eventse  s    : "`as`vwxx!! !3 4G< !34(+'%%!&!& +>> %! " 
 	
r4   r   )r   r   )r   r   )r   r   r   r   )rh   r   ri   r   rB   r   rG   r   rH   r   rI   r   rJ   r   r   z=AsyncPaginator[FineTuningJob, AsyncCursorPage[FineTuningJob]])rd   r   rh   r   ri   r   rG   r   rH   r   rI   r   rJ   r   r   zGAsyncPaginator[FineTuningJobEvent, AsyncCursorPage[FineTuningJobEvent]]r   r   r4   r1   r)   r)   `  s   . . . . 4 4 IRU^2;6?)2+44= )-$("&;D#s
 as
 	s

 Fs
 Ss
 0s
 4s
 's
 )s
 2s
 &s
 "s
   !s
" 9#s
$ 
%s
v )-$("&;D!
!
 &!
 "!
  !
 9!
 
!
L !* )8A )-$("&;D2
 2
 	2

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

 0
 &0
 "0
  0
 90
 
Q0
 0
r4   c                  2    \ rS rSrSS jr\SS j5       rSrg)r7   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-   )_jobsr
   to_raw_response_wrapperrY   re   rs   ry   r   r0   jobss     r1   __init__JobsWithRawResponse.__init__  s    
&>>KK
 )@@MM
 %<<II
	 '>>KK
 ,CC
r4   c                @    [        U R                  R                  5      $ r-   )r   r   r2   r/   s    r1   r2   JobsWithRawResponse.checkpoints  s    )$***@*@AAr4   r   ry   rY   rs   r   re   Nr   r(   r   None)r   r   r   r   r   r   r   r   r2   r   r   r4   r1   r7   r7     s    
& B Br4   r7   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_wrapperrY   re   rs   ry   r   r   s     r1   r   !AsyncJobsWithRawResponse.__init__  s    
&DDKK
 )FFMM
 %BBII
	 'DDKK
 ,II
r4   c                @    [        U R                  R                  5      $ r-   )r   r   r2   r/   s    r1   r2   $AsyncJobsWithRawResponse.checkpoints  s    .tzz/E/EFFr4   r   Nr   r)   r   r   )r   r   r   r   r4   r1   r   r     s    
& G Gr4   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   rY   re   rs   ry   r   r   s     r1   r   "JobsWithStreamingResponse.__init__  sq    
2KK
 5MM
 1II
	 3KK
 8
r4   c                @    [        U R                  R                  5      $ r-   )r   r   r2   r/   s    r1   r2   %JobsWithStreamingResponse.checkpoints  s    /

0F0FGGr4   r   Nr   )r   r   r   r   r4   r1   r<   r<     s    
& H Hr4   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   rY   re   rs   ry   r   r   s     r1   r   'AsyncJobsWithStreamingResponse.__init__  sq    
8KK
 ;MM
 7II
	 9KK
 >
r4   c                @    [        U R                  R                  5      $ r-   )r   r   r2   r/   s    r1   r2   *AsyncJobsWithStreamingResponse.checkpoints  s    4TZZ5K5KLLr4   r   Nr   )r   r   r   r   r4   r1   r   r     s    
& M Mr4   r   );
__future__r   typingr   r   r   r   typing_extensionsr   httpx r
   _typesr   r   r   r   r   _utilsr   r   _compatr   r2   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)   r7   r   r<   r   r   r4   r1   <module>r      s    # 2 2 %  ! @ @ (  < Z : ] \ 5 ? J;
u
? u
p	u
  u
p	B B2G G2H H2M Mr4   