
    i                         d Z ddlmZ ddlmZ ddlmZmZ ddlmZ ddl	m
Z
mZ ddlmZ dd	lmZ dd
lmZmZmZmZ  G d de      Zy)zACode generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.   )BaseSDK    )datetime)modelsutils)HookContext)OptionalNullableUNSET)get_security_from_env)unmarshal_json_response)ListMappingOptionalUnionc            "        	   e Zd Zddeeedeeeeedddddee   dee   dee   d	ee   d
ee   dee	   dee
j                     dee   dee   dee   deej                     dee   dee   deeeef      de
j                  fdZddeeedeeeeedddddee   dee   dee   d	ee   d
ee   dee	   dee
j                     dee   dee   dee   deej                     dee   dee   deeeef      de
j                  fdZdeeeddeeeedddddedee
j&                  e
j(                  f   deeee
j,                     ee
j.                     f      deee      dee   deeee
j0                     ee
j2                     f      dee	   dee   dee
j6                     deeee
j8                     ee
j:                     f      d eeee
j<                     ee
j>                     f      deej                     dee   dee   deeeef      de
j@                  f d!Z!deeeddeeeedddddedee
j&                  e
j(                  f   deeee
j,                     ee
j.                     f      deee      dee   deeee
j0                     ee
j2                     f      dee	   dee   dee
j6                     deeee
j8                     ee
j:                     f      d eeee
j<                     ee
j>                     f      deej                     dee   dee   deeeef      de
j@                  f d"Z"edddd#d$edeej                     dee   dee   deeeef      de
jF                  fd%Z$edddd#d$edeej                     dee   dee   deeeef      de
jF                  fd&Z%edddd#d$edeej                     dee   dee   deeeef      de
jL                  fd'Z'edddd#d$edeej                     dee   dee   deeeef      de
jL                  fd(Z(edddd#d$edeej                     dee   dee   deeeef      de
jR                  fd)Z*edddd#d$edeej                     dee   dee   deeeef      de
jR                  fd*Z+y)+Jobsr   d   FN)page	page_sizemodelcreated_aftercreated_beforecreated_by_mestatuswandb_project
wandb_namesuffixretries
server_url
timeout_mshttp_headersr   r   r   r   r   r   r   r   r   r   r   r   r    r!   returnc                   d}d}|| j                   j                  }||}n| j                  ||      }t        j                  |||||||||	|

      }| j                  dd|||ddddd|| j                   j                  |	      }|t        k(  r2| j                   j                  t        ur| j                   j                  }d}t        |t        j                        r|g d
f}| j                  t        | j                   |xs ddg t        | j                   j                  t        j                              |ddg|      }t        j                   |dd      rt#        t        j$                  |      S t        j                   |dd      r,t        j&                  |      }t        j(                  d||      t        j                   |dd      r,t        j&                  |      }t        j(                  d||      t        j(                  d|      a  Get Fine Tuning Jobs

        Get a list of fine-tuning jobs for your organization and user.

        :param page: The page number of the results to be returned.
        :param page_size: The number of items to return per page.
        :param model: The model name used for fine-tuning to filter on. When set, the other results are not displayed.
        :param created_after: The date/time to filter on. When set, the results for previous creation times are not displayed.
        :param created_before:
        :param created_by_me: When set, only return results for jobs created by the API caller. Other results are not displayed.
        :param status: The current job state to filter on. When set, the other results are not displayed.
        :param wandb_project: The Weights and Biases project to filter on. When set, the other results are not displayed.
        :param wandb_name: The Weight and Biases run name to filter on. When set, the other results are not displayed.
        :param suffix: The model suffix to filter on. When set, the other results are not displayed.
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        N)
r   r   r   r   r   r   r   r   r   r   GET/v1/fine_tuning/jobsFT
user-agentapplication/jsonmethodpathbase_urlurl_variablesrequestrequest_body_requiredrequest_has_path_paramsrequest_has_query_paramsuser_agent_headeraccept_header_valuer!   securityr    429500502503504 0jobs_api_routes_fine_tuning_get_fine_tuning_jobsconfigr,   operation_idoauth2_scopessecurity_source4XX5XXhook_ctxr.   error_status_codesretry_config200*API error occurredUnexpected response received)sdk_configurationr    _get_urlr   /JobsAPIRoutesFineTuningGetFineTuningJobsRequest_build_requestr4   r
   rG   
isinstancer   RetryConfig
do_requestr   r   Securitymatch_responser   JobsOutstream_to_textSDKErrorselfr   r   r   r   r   r   r   r   r   r   r   r   r    r!   r,   r-   r.   reqrG   http_reshttp_res_texts                         L/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/mistralai/jobs.pylistz	Jobs.list   s	   J //::J!!H}}X}=HHH')''!
 !!''"'$)%)* 2%++44! " 
  e%%22%?00==gu001#%HIL?? --!RO  5**33V__!  %u~% # 
 %1CD*6>>8DD%5!00:M//"6-PP%5!00:M//"6-PPoo<hGG    c                `  K   d}d}|| j                   j                  }||}n| j                  ||      }t        j                  |||||||||	|

      }| j                  dd|||ddddd|| j                   j                  |	      }|t        k(  r2| j                   j                  t        ur| j                   j                  }d}t        |t        j                        r|g d
f}| j                  t        | j                   |xs ddg t        | j                   j                  t        j                              |ddg|       d{   }t        j                   |dd      rt#        t        j$                  |      S t        j                   |dd      r4t        j&                  |       d{   }t        j(                  d||      t        j                   |dd      r4t        j&                  |       d{   }t        j(                  d||      t        j(                  d|      7 7 ~7 5wr$   )rL   r    rM   r   rN   _build_request_asyncr4   r
   rG   rP   r   rQ   do_request_asyncr   r   rS   rT   r   rU   stream_to_text_asyncrW   rX   s                         r]   
list_asynczJobs.list_async|   s-    J //::J!!H}}X}=HHH')''!
 ''''"'$)%)* 2%++44! ( 
  e%%22%?00==gu001#%HIL.. --!RO  5**33V__!  %u~% / 
 
 %1CD*6>>8DD%5"'"<"<X"FFM//"6-PP%5"'"<"<X"FFM//"6-PPoo<hGG1
$ G Gs8   EH.H(A$H.+H*,A
H.6H,72H.*H.,H.)training_filesvalidation_filesr   integrations
auto_startinvalid_sample_skip_percentagejob_typerepositoriesclassifier_targetsr   r   r    r!   hyperparametersre   rf   rg   rh   ri   rj   rk   rl   c                   d}d}|| j                   j                  }||}n| j                  ||      }t        j                  |t        j                  |t        t        t        j                              ||t        j                  |t        t        t        j                              |||	t        j                  |t        j                        t        j                  |
t        t        t        j                              t        j                  |t        t        t        j                                    | j                  dd||ddddd|| j                   j                   fd	|
      }|t"        k(  r2| j                   j$                  t"        ur| j                   j$                  }d}t'        |t
        j(                        r|g df}| j+                  t-        | j                   |xs ddg t/        | j                   j                   t        j0                              |ddg|      }t        j2                  |dd      rt5        t        j6                  |      S t        j2                  |dd      r,t        j8                  |      }t        j:                  d||      t        j2                  |dd      r,t        j8                  |      }t        j:                  d||      t        j:                  d|      )  Create Fine Tuning Job

        Create a new fine-tuning job, it will be queued for processing.

        :param model: The name of the model to fine-tune.
        :param hyperparameters:
        :param training_files:
        :param validation_files: A list containing the IDs of uploaded files that contain validation data. If you provide these files, the data is used to generate validation metrics periodically during fine-tuning. These metrics can be viewed in `checkpoints` when getting the status of a running fine-tuning job. The same data should not be present in both train and validation files.
        :param suffix: A string that will be added to your fine-tuning model name. For example, a suffix of \"my-great-model\" would produce a model name like `ft:open-mistral-7b:my-great-model:xxx...`
        :param integrations: A list of integrations to enable for your fine-tuning job.
        :param auto_start: This field will be required in a future release.
        :param invalid_sample_skip_percentage:
        :param job_type:
        :param repositories:
        :param classifier_targets:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        Nr   re   rf   r   rg   rh   ri   rj   rm   rk   rl   POSTr&   TFr'   r(   c                  R    t        j                   dddt        j                        S NFjsonr   serialize_request_bodyr   JobInr.   s   r]   <lambda>zJobs.create.<locals>.<lambda>O  !    (D(Dvv||) r_   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r!   r4   get_serialized_bodyr    r5   r;   2jobs_api_routes_fine_tuning_create_fine_tuning_jobr=   rB   rC   rD   rH   rI   rJ   rK   )rL   r    rM   r   rw   r   get_pydantic_modelr   r   TrainingFiler	   JobInIntegrationsHyperparametersJobInRepositoriesClassifierTargetInrO   r4   r
   rG   rP   rQ   rR   r   r   rS   rT   r   2JobsAPIRoutesFineTuningCreateFineTuningJobResponserV   rW   rY   r   rm   re   rf   r   rg   rh   ri   rj   rk   rl   r   r   r    r!   r,   r-   rZ   rG   r[   r\   r.   s                         @r]   createzJobs.create   s   l //::J!!H}}X}=H,, 33f.A.A)B C .11.tF4L4L/MN "+I!44!7!7 11.tF4L4L/MN  %77"$4T&:S:S5T$U '
0 !!''"&$)%)* 2%++44! "! " 
& e%%22%?00==gu001#%HIL?? --!RQ  5**33V__!  %u~% # 
 %1CD*II8  %5!00:M//"6-PP%5!00:M//"6-PPoo<hGGr_   c                0  K   d}d}|| j                   j                  }||}n| j                  ||      }t        j                  |t        j                  |t        t        t        j                              ||t        j                  |t        t        t        j                              |||	t        j                  |t        j                        t        j                  |
t        t        t        j                              t        j                  |t        t        t        j                                    | j                  dd||ddddd|| j                   j                   fd	|
      }|t"        k(  r2| j                   j$                  t"        ur| j                   j$                  }d}t'        |t
        j(                        r|g df}| j+                  t-        | j                   |xs ddg t/        | j                   j                   t        j0                              |ddg|       d{   }t        j2                  |dd      rt5        t        j6                  |      S t        j2                  |dd      r4t        j8                  |       d{   }t        j:                  d||      t        j2                  |dd      r4t        j8                  |       d{   }t        j:                  d||      t        j:                  d|      7 7 ~7 5w)ro   Nrp   rq   r&   TFr'   r(   c                  R    t        j                   dddt        j                        S rs   ru   rx   s   r]   ry   z#Jobs.create_async.<locals>.<lambda>  rz   r_   r{   r5   r;   r}   r=   rB   rC   rD   rH   rI   rJ   rK   )rL   r    rM   r   rw   r   r~   r   r   r   r	   r   r   r   r   ra   r4   r
   rG   rP   rQ   rb   r   r   rS   rT   r   r   rc   rW   r   s                         @r]   create_asynczJobs.create_asyncy  s    l //::J!!H}}X}=H,, 33f.A.A)B C .11.tF4L4L/MN "+I!44!7!7 11.tF4L4L/MN  %77"$4T&:S:S5T$U '
0 ''''"&$)%)* 2%++44! "! ( 
& e%%22%?00==gu001#%HIL.. --!RQ  5**33V__!  %u~% / 
 
 %1CD*II8  %5"'"<"<X"FFM//"6-PP%5"'"<"<X"FFM//"6-PPoo<hGG5
( G Gs8   H+L.L/A$LLA
LL2LLL)r   r   r    r!   job_idc                
   d}d}|| j                   j                  }||}n| j                  ||      }t        j                  |      }| j                  dd|||ddddd|| j                   j                  |	      }	|t        k(  r2| j                   j                  t        ur| j                   j                  }d}
t        |t        j                        r|g d
f}
| j                  t        | j                   |xs ddg t        | j                   j                  t        j                              |	ddg|
      }t        j                   |dd      rt#        t        j$                  |      S t        j                   |dd      r,t        j&                  |      }t        j(                  d||      t        j                   |dd      r,t        j&                  |      }t        j(                  d||      t        j(                  d|      a  Get Fine Tuning Job

        Get a fine-tuned job details by its UUID.

        :param job_id: The ID of the job to analyse.
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        Nr   r%   z/v1/fine_tuning/jobs/{job_id}FTr'   r(   r)   r5   r;   /jobs_api_routes_fine_tuning_get_fine_tuning_jobr=   rB   rC   rD   rH   rI   rJ   rK   )rL   r    rM   r   .JobsAPIRoutesFineTuningGetFineTuningJobRequestrO   r4   r
   rG   rP   r   rQ   rR   r   r   rS   rT   r   /JobsAPIRoutesFineTuningGetFineTuningJobResponserV   rW   rY   r   r   r   r    r!   r,   r-   r.   rZ   rG   r[   r\   s                r]   getzJobs.get  s   & //::J!!H}}X}=HGG
 !!0'"'$(%)* 2%++44! " 
  e%%22%?00==gu001#%HIL?? --!RN  5**33V__!  %u~% # 
 %1CD*FF  %5!00:M//"6-PP%5!00:M//"6-PPoo<hGGr_   c                N  K   d}d}|| j                   j                  }||}n| j                  ||      }t        j                  |      }| j                  dd|||ddddd|| j                   j                  |	      }	|t        k(  r2| j                   j                  t        ur| j                   j                  }d}
t        |t        j                        r|g d
f}
| j                  t        | j                   |xs ddg t        | j                   j                  t        j                              |	ddg|
       d{   }t        j                   |dd      rt#        t        j$                  |      S t        j                   |dd      r4t        j&                  |       d{   }t        j(                  d||      t        j                   |dd      r4t        j&                  |       d{   }t        j(                  d||      t        j(                  d|      7 7 ~7 5wr   )rL   r    rM   r   r   ra   r4   r
   rG   rP   r   rQ   rb   r   r   rS   rT   r   r   rc   rW   r   s                r]   	get_asynczJobs.get_async]  s    & //::J!!H}}X}=HGG
 ''0'"'$(%)* 2%++44! ( 
  e%%22%?00==gu001#%HIL.. --!RN  5**33V__!  %u~% / 
 
 %1CD*FF  %5"'"<"<X"FFM//"6-PP%5"'"<"<X"FFM//"6-PPoo<hGG5
( G G8   D;H%=H>A$H%"H!#A
H%-H#.2H%!H%#H%c                
   d}d}|| j                   j                  }||}n| j                  ||      }t        j                  |      }| j                  dd|||ddddd|| j                   j                  |	      }	|t        k(  r2| j                   j                  t        ur| j                   j                  }d}
t        |t        j                        r|g d
f}
| j                  t        | j                   |xs ddg t        | j                   j                  t        j                              |	ddg|
      }t        j                   |dd      rt#        t        j$                  |      S t        j                   |dd      r,t        j&                  |      }t        j(                  d||      t        j                   |dd      r,t        j&                  |      }t        j(                  d||      t        j(                  d|      a  Cancel Fine Tuning Job

        Request the cancellation of a fine tuning job.

        :param job_id: The ID of the job to cancel.
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        Nr   rq   z$/v1/fine_tuning/jobs/{job_id}/cancelFTr'   r(   r)   r5   r;   2jobs_api_routes_fine_tuning_cancel_fine_tuning_jobr=   rB   rC   rD   rH   rI   rJ   rK   )rL   r    rM   r   1JobsAPIRoutesFineTuningCancelFineTuningJobRequestrO   r4   r
   rG   rP   r   rQ   rR   r   r   rS   rT   r   2JobsAPIRoutesFineTuningCancelFineTuningJobResponserV   rW   r   s                r]   cancelzJobs.cancel  s   & //::J!!H}}X}=HJJ
 !!7'"'$(%)* 2%++44! " 
  e%%22%?00==gu001#%HIL?? --!RQ  5**33V__!  %u~% # 
 %1CD*II8  %5!00:M//"6-PP%5!00:M//"6-PPoo<hGGr_   c                N  K   d}d}|| j                   j                  }||}n| j                  ||      }t        j                  |      }| j                  dd|||ddddd|| j                   j                  |	      }	|t        k(  r2| j                   j                  t        ur| j                   j                  }d}
t        |t        j                        r|g d
f}
| j                  t        | j                   |xs ddg t        | j                   j                  t        j                              |	ddg|
       d{   }t        j                   |dd      rt#        t        j$                  |      S t        j                   |dd      r4t        j&                  |       d{   }t        j(                  d||      t        j                   |dd      r4t        j&                  |       d{   }t        j(                  d||      t        j(                  d|      7 7 ~7 5wr   )rL   r    rM   r   r   ra   r4   r
   rG   rP   r   rQ   rb   r   r   rS   rT   r   r   rc   rW   r   s                r]   cancel_asynczJobs.cancel_async  s    & //::J!!H}}X}=HJJ
 ''7'"'$(%)* 2%++44! ( 
  e%%22%?00==gu001#%HIL.. --!RQ  5**33V__!  %u~% / 
 
 %1CD*II8  %5"'"<"<X"FFM//"6-PP%5"'"<"<X"FFM//"6-PPoo<hGG5
( G Gr   c                
   d}d}|| j                   j                  }||}n| j                  ||      }t        j                  |      }| j                  dd|||ddddd|| j                   j                  |	      }	|t        k(  r2| j                   j                  t        ur| j                   j                  }d}
t        |t        j                        r|g d
f}
| j                  t        | j                   |xs ddg t        | j                   j                  t        j                              |	ddg|
      }t        j                   |dd      rt#        t        j$                  |      S t        j                   |dd      r,t        j&                  |      }t        j(                  d||      t        j                   |dd      r,t        j&                  |      }t        j(                  d||      t        j(                  d|      a  Start Fine Tuning Job

        Request the start of a validated fine tuning job.

        :param job_id:
        :param retries: Override the default retry configuration for this method
        :param server_url: Override the default server URL for this method
        :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
        :param http_headers: Additional headers to set or replace on requests.
        Nr   rq   z#/v1/fine_tuning/jobs/{job_id}/startFTr'   r(   r)   r5   r;   1jobs_api_routes_fine_tuning_start_fine_tuning_jobr=   rB   rC   rD   rH   rI   rJ   rK   )rL   r    rM   r   0JobsAPIRoutesFineTuningStartFineTuningJobRequestrO   r4   r
   rG   rP   r   rQ   rR   r   r   rS   rT   r   1JobsAPIRoutesFineTuningStartFineTuningJobResponserV   rW   r   s                r]   startz
Jobs.start\  s   & //::J!!H}}X}=HII
 !!6'"'$(%)* 2%++44! " 
  e%%22%?00==gu001#%HIL?? --!RP  5**33V__!  %u~% # 
 %1CD*HH(  %5!00:M//"6-PP%5!00:M//"6-PPoo<hGGr_   c                N  K   d}d}|| j                   j                  }||}n| j                  ||      }t        j                  |      }| j                  dd|||ddddd|| j                   j                  |	      }	|t        k(  r2| j                   j                  t        ur| j                   j                  }d}
t        |t        j                        r|g d
f}
| j                  t        | j                   |xs ddg t        | j                   j                  t        j                              |	ddg|
       d{   }t        j                   |dd      rt#        t        j$                  |      S t        j                   |dd      r4t        j&                  |       d{   }t        j(                  d||      t        j                   |dd      r4t        j&                  |       d{   }t        j(                  d||      t        j(                  d|      7 7 ~7 5wr   )rL   r    rM   r   r   ra   r4   r
   rG   rP   r   rQ   rb   r   r   rS   rT   r   r   rc   rW   r   s                r]   start_asynczJobs.start_async  s    & //::J!!H}}X}=HII
 ''6'"'$(%)* 2%++44! ( 
  e%%22%?00==gu001#%HIL.. --!RP  5**33V__!  %u~% / 
 
 %1CD*HH(  %5"'"<"<X"FFM//"6-PP%5"'"<"<X"FFM//"6-PPoo<hGG5
( G Gr   ),__name__
__module____qualname__r
   r   intr	   strr   boolr   QueryParamStatusr   rQ   r   rU   r^   rd   r   r   HyperparametersTypedDictr   r   TrainingFileTypedDictr   JobInIntegrationsTypedDictfloatFineTuneableModelTyper   JobInRepositoriesTypedDictr   ClassifierTargetInTypedDictr   r   r   r   r   r   r   r   r   r   r   r    r_   r]   r   r      s	     #&',495:(-<A/4,1(-7<$($(48!lH smlH C=	lH
  $lH (1lH )2lH  ~lH !!8!89lH (,lH %S)lH !%lH "%"3"34lH SMlH SMlH  wsCx01!lH" 
#lHb  #&',495:(-<A/4,1(-7<$($(48!lH smlH C=	lH
  $lH (1lH )2lH  ~lH !!8!89lH (,lH %S)lH !%lH "%"3"34lH SMlH SMlH  wsCx01!lH" 
#lHj 8=(-
 %):;CH
  7<$($(48AMH MH v55v7V7VVW	MH
 !$v**+T&2N2N-OOP
MH +495MH !%MH 'V--.V5V5V0WW
MH TNMH  )1!MH" #6#?#?@#MH$ 'V--.V5V5V0WW
%MH. -V../V778:
/MH: "%"3"34;MH< SM=MH> SM?MH@ wsCx01AMHB 
	B	BCMHl 8=(-
 %):;CH
  7<$($(48AMH MH v55v7V7VVW	MH
 !$v**+T&2N2N-OOP
MH +495MH !%MH 'V--.V5V5V0WW
MH TNMH  )1!MH" #6#?#?@#MH$ 'V--.V5V5V0WW
%MH. -V../V778:
/MH: "%"3"34;MH< SM=MH> SM?MH@ wsCx01AMHB 
	B	BCMHf 8=$($(48SH SH "%"3"34	SH
 SMSH SMSH wsCx01SH 
	?	?SHr 8=$($(48SH SH "%"3"34	SH
 SMSH SMSH wsCx01SH 
	?	?SHr 8=$($(48SH SH "%"3"34	SH
 SMSH SMSH wsCx01SH 
	B	BSHr 8=$($(48SH SH "%"3"34	SH
 SMSH SMSH wsCx01SH 
	B	BSHr 8=$($(48SH SH "%"3"34	SH
 SMSH SMSH wsCx01SH 
	A	ASHr 8=$($(48SH SH "%"3"34	SH
 SMSH SMSH wsCx01SH 
	A	ASHr_   r   N)__doc__basesdkr   r   	mistralair   r   mistralai._hooksr   mistralai.typesr	   r
   mistralai.utilsr   'mistralai.utils.unmarshal_json_responser   typingr   r   r   r   r   r   r_   r]   <module>r      s3    G   # ( 3 1 K 1 1wH7 wHr_   