
    _j                       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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/J0r0  SSK1J2r2  SSK3J4r4  SSK5J6r6  SS/r7 " S S\"5      r8 " S S\#5      r9 " S S5      r: " 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)path_template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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+   %   IManage fine-tuning jobs to tailor a model to your specific training data.c                ,    [        U R                  5      $ r/   )r   _clientselfs    [/home/rurouni/.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 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
)JobsWithRawResponser3   s    r5   with_raw_responseJobs.with_raw_response-   s     #4((r8   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
)JobsWithStreamingResponser3   s    r5   with_streaming_responseJobs.with_streaming_response7   s     )..r8   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      [	        U
UUUSS0S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_filerD   rE   rF   rG   rH   rI   rJ   bearer_authTrK   rL   rM   rN   securitybodyoptionscast_to)_postr   r&   JobCreateParamsr$   r)   r4   rS   rT   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   s                 r5   createJobs.create@   st    B zz "%2'6$0 ($ $'6
 "11 )+'%'. "/  
 	
r8   rK   rL   rM   rN   c                   U(       d  [        SU< 35      eU R                  [        SUS9[        UUUUSS0S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/{fine_tuning_job_id}fine_tuning_job_idrU   TrV   rZ   r[   
ValueError_getr   r$   r)   r4   rg   rK   rL   rM   rN   s         r5   retrieveJobs.retrieve   s_    2 "`as`vwxxyyBWij(+'%'. "  

 
	
r8   afterlimitrF   rK   rL   rM   rN   c                   U R                  S[        [           [        UUUU[	        UUUS.[
        R                  5      SS0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
rQ   )rp   rq   rF   rU   TrK   rL   rM   rN   queryrW   pagerZ   rS   )_get_api_listr!   r)   r$   r   r%   JobListParamsr4   rp   rq   rF   rK   rL   rM   rN   s           r5   list	Jobs.list   sl    @ !!.(+'%%!&!&$,
 $11 (.  % " 
 	
r8   c                   U(       d  [        SU< 35      eU R                  [        SUS9[        UUUUSS0S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
rd   -/fine_tuning/jobs/{fine_tuning_job_id}/cancelrf   rU   TrV   rh   rj   r\   r   r$   r)   rl   s         r5   cancelJobs.cancel  _    . "`as`vwxxzzI^pq(+'%'. "  

 
	
r8   rp   rq   rK   rL   rM   rN   c                   U(       d  [        SU< 35      eU R                  [        SUS9[        [           [        UUUU[        UUS.[        R                  5      SS0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
rd   z-/fine_tuning/jobs/{fine_tuning_job_id}/eventsrf   )rp   rq   rU   Trt   rv   )	rj   rx   r   r!   r*   r$   r   r'   JobListEventsParamsr4   rg   rp   rq   rK   rL   rM   rN   s           r5   list_eventsJobs.list_events<  s    : "`as`vwxx!!I^pq 23(+'%%!&!& +>> (. %# " 
 	
r8   c                   U(       d  [        SU< 35      eU R                  [        SUS9[        UUUUSS0S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
rd   ,/fine_tuning/jobs/{fine_tuning_job_id}/pauserf   rU   TrV   rh   r   rl   s         r5   pause
Jobs.pauseo  s_    . "`as`vwxxzzH]op(+'%'. "  

 
	
r8   c                   U(       d  [        SU< 35      eU R                  [        SUS9[        UUUUSS0S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
rd   -/fine_tuning/jobs/{fine_tuning_job_id}/resumerf   rU   TrV   rh   r   rl   s         r5   resumeJobs.resume  r   r8    )returnr   )r   r;   )r   r@   rS   zQUnion[str, Literal['babbage-002', 'davinci-002', 'gpt-3.5-turbo', 'gpt-4o-mini']]rT   strrD   z(job_create_params.Hyperparameters | OmitrE   z8Optional[Iterable[job_create_params.Integration]] | OmitrF   zOptional[Metadata] | OmitrG   zjob_create_params.Method | OmitrH   zOptional[int] | OmitrI   Optional[str] | OmitrJ   r   rK   Headers | NonerL   Query | NonerM   Body | NonerN   'float | httpx.Timeout | None | NotGivenr   r)   rg   r   rK   r   rL   r   rM   r   rN   r   r   r)   )rp   
str | Omitrq   
int | OmitrF   Optional[Dict[str, str]] | OmitrK   r   rL   r   rM   r   rN   r   r   zSyncCursorPage[FineTuningJob])rg   r   rp   r   rq   r   rK   r   rL   r   rM   r   rN   r   r   z"SyncCursorPage[FineTuningJobEvent]__name__
__module____qualname____firstlineno____doc__r   r6   r<   rA   r   r   r_   rm   r{   r   r   r   r   __static_attributes__r   r8   r5   r+   r+   %   s   S) ) ) ) / / EIQU.226%)'+04 )-$("&;D#y
 ay
 	y

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

 23
 &3
 "3
  3
 93
 
'3
v )-$("&;D#
#
 &#
 "#
  #
 9#
 
#
R !  )-$("&;D1
1
 	1

 1
 &1
 "1
  1
 91
 
,1
r )-$("&;D#
#
 &#
 "#
  #
 9#
 
#
V )-$("&;D#
#
 &#
 "#
  #
 9#
 
#
 #
r8   c                     \ rS 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  r/   c                ,    [        U R                  5      $ r1   )r   r2   r3   s    r5   r6   AsyncJobs.checkpoints  s      --r8   c                    [        U 5      $ r:   )AsyncJobsWithRawResponser3   s    r5   r<   AsyncJobs.with_raw_response  s     (--r8   c                    [        U 5      $ r?   )AsyncJobsWithStreamingResponser3   s    r5   rA   !AsyncJobs.with_streaming_response  s     .d33r8   NrC   c                  #    U R                  S[        UUUUUUUUU	S.	[        R                  5      I Sh  vN [	        U
UUUSS0S9[
        S9I Sh  vN $  N! N7f)rP   rQ   rR   NrU   TrV   rX   )r\   r   r&   r]   r$   r)   r^   s                 r5   r_   AsyncJobs.create  s     B ZZ,"%2'6$0 ($ $'6
 "11  )+'%'. "/   
 
 	

s!   4AA
AAAAra   c                  #    U(       d  [        SU< 35      eU R                  [        SUS9[        UUUUSS0S9[        S9I Sh  vN $  N7f)	rc   rd   re   rf   rU   TrV   rh   Nri   rl   s         r5   rm   AsyncJobs.retrieveP  sl     2 "`as`vwxxYYBWij(+'%'. "  

 

 
	
 

   AAAAro   c                   U R                  S[        [           [        UUUU[	        UUUS.[
        R                  5      SS0S9[        S9$ rs   )rx   r"   r)   r$   r   r%   ry   rz   s           r5   r{   AsyncJobs.listw  sl    @ !! /(+'%%!&!&$,
 $11 (.  % " 
 	
r8   c                  #    U(       d  [        SU< 35      eU R                  [        SUS9[        UUUUSS0S9[        S9I Sh  vN $  N7f)	r~   rd   r   rf   rU   TrV   rh   Nr   rl   s         r5   r   AsyncJobs.cancel  l     . "`as`vwxxZZI^pq(+'%'. "   

 

 
	
 

r   r   c                   U(       d  [        SU< 35      eU R                  [        SUS9[        [           [        UUUU[        UUS.[        R                  5      SS0S9[        S9$ r   )	rj   rx   r   r"   r*   r$   r   r'   r   r   s           r5   r   AsyncJobs.list_events  s    : "`as`vwxx!!I^pq !34(+'%%!&!& +>> (. %# " 
 	
r8   c                  #    U(       d  [        SU< 35      eU R                  [        SUS9[        UUUUSS0S9[        S9I Sh  vN $  N7f)	r   rd   r   rf   rU   TrV   rh   Nr   rl   s         r5   r   AsyncJobs.pause  sl     . "`as`vwxxZZH]op(+'%'. "   

 

 
	
 

r   c                  #    U(       d  [        SU< 35      eU R                  [        SUS9[        UUUUSS0S9[        S9I Sh  vN $  N7f)	r   rd   r   rf   rU   TrV   rh   Nr   rl   s         r5   r   AsyncJobs.resume)  r   r   r   )r   r   )r   r   )r   r   r   r   )rp   r   rq   r   rF   r   rK   r   rL   r   rM   r   rN   r   r   z=AsyncPaginator[FineTuningJob, AsyncCursorPage[FineTuningJob]])rg   r   rp   r   rq   r   rK   r   rL   r   rM   r   rN   r   r   zGAsyncPaginator[FineTuningJobEvent, AsyncCursorPage[FineTuningJobEvent]]r   r   r8   r5   r,   r,     s!   S. . . . 4 4 EIQU.226%)'+04 )-$("&;D#y
 ay
 	y

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

 23
 &3
 "3
  3
 93
 
G3
v )-$("&;D#
#
 &#
 "#
  #
 9#
 
#
R !  )-$("&;D1
1
 	1

 1
 &1
 "1
  1
 91
 
Q1
r )-$("&;D#
#
 &#
 "#
  #
 9#
 
#
V )-$("&;D#
#
 &#
 "#
  #
 9#
 
#
 #
r8   c                  2    \ rS rSrSS jr\SS j5       rSrg)r;   iO  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 N)
_jobsr
   to_raw_response_wrapperr_   rm   r{   r   r   r   r   r4   jobss     r5   __init__JobsWithRawResponse.__init__P  s    
&>>KK
 )@@MM
 %<<II
	 '>>KK
 ,CC
 &==JJ

 '>>KK
r8   c                @    [        U R                  R                  5      $ r1   )r   r   r6   r3   s    r5   r6   JobsWithRawResponse.checkpointsi  s     *$***@*@AAr8   r   r   r_   r{   r   r   r   rm   Nr   r+   r   None)r   r   r   r   r   r   r   r   r6   r   r   r8   r5   r;   r;   O  s    
2 B Br8   r;   c                  2    \ rS rSrSS jr\SS j5       rSrg)r   io  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_   rm   r{   r   r   r   r   r   s     r5   r   !AsyncJobsWithRawResponse.__init__p  s    
&DDKK
 )FFMM
 %BBII
	 'DDKK
 ,II
 &CCJJ

 'DDKK
r8   c                @    [        U R                  R                  5      $ r1   )r   r   r6   r3   s    r5   r6   $AsyncJobsWithRawResponse.checkpoints  s     /tzz/E/EFFr8   r   Nr   r,   r   r   )r   r   r   r   r8   r5   r   r   o  s    
2 G Gr8   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_   rm   r{   r   r   r   r   r   s     r5   r   "JobsWithStreamingResponse.__init__  s    
2KK
 5MM
 1II
	 3KK
 8
 2JJ

 3KK
r8   c                @    [        U R                  R                  5      $ r1   )r   r   r6   r3   s    r5   r6   %JobsWithStreamingResponse.checkpoints  s     0

0F0FGGr8   r   Nr   )r   r   r   r   r8   r5   r@   r@     s    
2 H Hr8   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_   rm   r{   r   r   r   r   r   s     r5   r   'AsyncJobsWithStreamingResponse.__init__  s    
8KK
 ;MM
 7II
	 9KK
 >
 8JJ

 9KK
r8   c                @    [        U R                  R                  5      $ r1   )r   r   r6   r3   s    r5   r6   *AsyncJobsWithStreamingResponse.checkpoints  s     5TZZ5K5KLLr8   r   Nr   )r   r   r   r   r8   r5   r   r     s    
2 M Mr8   r   )>
__future__r   typingr   r   r   r   typing_extensionsr   httpx r
   _typesr   r   r   r   r   r   r   _utilsr   r   r   _compatr   r6   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,   r;   r   r@   r   r   r8   r5   <module>r      s    # 2 2 %  ! L L L L L '  < Z : ] \ 5 ? J;
R
? R
jR
  R
jB B@G G@H H@M Mr8   