
    gʣ                     v    d 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mZmZ  G d	 d
e      Zy)zACode generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.   )BaseSDK    )modelsutils)HookContext)OptionalNullableUNSET)get_security_from_env)AnyMappingOptionalc                      e Zd ZdZedddddeej                     dee	   dee
   deee	e	f      deej                     f
d	Zedddddeej                     dee	   dee
   deee	e	f      de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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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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ej&                     fdZeeeddddd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ej,                     fdZeeeddddd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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ej2                     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ej2                     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ej8                     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ej8                     fdZy)ModelszModel Management APIN)retries
server_url
timeout_mshttp_headersr   r   r   r   returnc                   d}d}|| j                   j                  }||}| j                  d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        d
g t        | j                   j                  t        j                              |g d|      }	d}
t        j                  |	dd      r5t        j                  |	j                   t"        t        j$                           S t        j                  |	dd      rDt        j                  |	j                   t        j&                        }
t        j(                  |
      t        j                  |	ddgd      r7t        j*                  |	      }t        j,                  d|	j.                  ||	      |	j0                  j3                  d      }t        j*                  |	      }t        j,                  d|	j.                   d| d|	j.                  ||	      a  List Models

        List all models available to the user.

        :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GETz
/v1/modelsFT
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list_models_v1_models_getoperation_idoauth2_scopessecurity_source4224XX5XXhook_ctxr   error_status_codesretry_config200r2   datar3   r4   *API error occurredContent-Type$Unexpected response received (code: , type: ))sdk_configurationr   _build_requestr%   r	   r8   
isinstancer   RetryConfig
do_requestr   r
   r   Securitymatch_responseunmarshal_jsontextr   	ModelListHTTPValidationErrorDataHTTPValidationErrorstream_to_textSDKErrorstatus_codeheadersgetselfr   r   r   r   r   r   reqr8   http_resr;   http_res_textcontent_types                F/var/www/openai/venv/lib/python3.12/site-packages/mistralai/models_.pylistzModels.list   s6   " //::J!!H!!'"'$)%)* 2%++44! " 
  e%%22%?00==gu001#%HIL?? 8  5**33V__! 4% # 
 %1CD''x@P@P7QRR%1CD''v7U7UVD,,$775%.#>!00:M//$h&:&:M8   ''++N;,,X6oo283G3G2HQ]P^^_`  	
 	
    c                  K   d}d}|| j                   j                  }||}| j                  d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        d
g t        | j                   j                  t        j                              |g d|       d{   }	d}
t        j                  |	dd      r5t        j                  |	j                   t"        t        j$                           S t        j                  |	dd      rDt        j                  |	j                   t        j&                        }
t        j(                  |
      t        j                  |	ddgd      r?t        j*                  |	       d{   }t        j,                  d|	j.                  ||	      |	j0                  j3                  d      }t        j*                  |	       d{   }t        j,                  d|	j.                   d| d|	j.                  ||	      7 q7 7 <wr   )rB   r   _build_request_asyncr%   r	   r8   rD   r   rE   do_request_asyncr   r
   r   rG   rH   rI   rJ   r   rK   rL   rM   stream_to_text_asyncrO   rP   rQ   rR   rS   s                rY   
list_asynczModels.list_async`   sZ    " //::J!!H'''"'$)%)* 2%++44! ( 
  e%%22%?00==gu001#%HIL.. 8  5**33V__! 4% / 
 
 %1CD''x@P@P7QRR%1CD''v7U7UVD,,$775%.#>"'"<"<X"FFM//$h&:&:M8   ''++N;#88BBoo283G3G2HQ]P^^_`  	
 	
7
( G Cs8   DI<I5CI<#I8$AI<=I:>8I<8I<:I<model_idc                   d}d}|| j                   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        dg t        | j                   j
                  t        j                              |	g d|
      }d}t        j                  |dd      r5t        j                   |j"                  t$        t        j&                           S t        j                  |dd      rDt        j                   |j"                  t        j(                        }t        j*                  |      t        j                  |ddgd      r7t        j,                  |      }t        j.                  d|j0                  ||      |j2                  j5                  d      }t        j,                  |      }t        j.                  d|j0                   d| d|j0                  ||      a  Retrieve Model

        Retrieve a model information.

        :param model_id: The ID of the model to retrieve.
        :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ra   r   /v1/models/{model_id}FTr   r   r   r&   'retrieve_model_v1_models__model_id__getr-   r1   r5   r9   r2   r:   r3   r4   r<   r=   r>   r?   r@   rA   )rB   r   r   &RetrieveModelV1ModelsModelIDGetRequestrC   r%   r	   r8   rD   r   rE   rF   r   r
   rG   rH   rI   rJ   r   FRetrieveModelV1ModelsModelIDGetResponseRetrieveModelV1ModelsModelIDGetrL   rM   rN   rO   rP   rQ   rR   rT   ra   r   r   r   r   r   r   r   rU   r8   rV   r;   rW   rX   s                  rY   retrievezModels.retrieve   sV   * //::J!!H??
 !!('"'$(%)* 2%++44! " 
  e%%22%?00==gu001#%HIL?? F  5**33V__! 4% # 
 %1CD''aa  %1CD''v7U7UVD,,$775%.#>!00:M//$h&:&:M8   ''++N;,,X6oo283G3G2HQ]P^^_`  	
 	
r[   c                (  K   d}d}|| j                   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        dg t        | j                   j
                  t        j                              |	g d|
       d{   }d}t        j                  |dd      r5t        j                   |j"                  t$        t        j&                           S t        j                  |dd      rDt        j                   |j"                  t        j(                        }t        j*                  |      t        j                  |ddgd      r?t        j,                  |       d{   }t        j.                  d|j0                  ||      |j2                  j5                  d      }t        j,                  |       d{   }t        j.                  d|j0                   d| d|j0                  ||      7 q7 7 <wrc   )rB   r   r   rg   r]   r%   r	   r8   rD   r   rE   r^   r   r
   rG   rH   rI   rJ   r   rh   rL   rM   r_   rO   rP   rQ   rR   ri   s                  rY   retrieve_asynczModels.retrieve_async  s{    * //::J!!H??
 ''('"'$(%)* 2%++44! ( 
  e%%22%?00==gu001#%HIL.. F  5**33V__! 4% / 
 
 %1CD''aa  %1CD''v7U7UVD,,$775%.#>"'"<"<X"FFM//$h&:&:M8   ''++N;#88BBoo283G3G2HQ]P^^_`  	
 	
A
2 G C8   DJJCJ9J:AJJ8JJJc                   d}d}|| j                   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        dg t        | j                   j
                  t        j                              |	g d|
      }d}t        j                  |dd      r5t        j                   |j"                  t$        t        j&                           S t        j                  |dd      rDt        j                   |j"                  t        j(                        }t        j*                  |      t        j                  |ddgd      r7t        j,                  |      }t        j.                  d|j0                  ||      |j2                  j5                  d      }t        j,                  |      }t        j.                  d|j0                   d| d|j0                  ||      a  Delete Model

        Delete a fine-tuned model.

        :param model_id: The ID of the model to delete.
        :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.
        Nrd   DELETEre   FTr   r   r   r&   (delete_model_v1_models__model_id__deleter-   r1   r5   r9   r2   r:   r3   r4   r<   r=   r>   r?   r@   rA   )rB   r   r   'DeleteModelV1ModelsModelIDDeleteRequestrC   r%   r	   r8   rD   r   rE   rF   r   r
   rG   rH   rI   rJ   r   DeleteModelOutrL   rM   rN   rO   rP   rQ   rR   ri   s                  rY   deletezModels.deleter  sK   & //::J!!H@@
 !!('"'$(%)* 2%++44! " 
  e%%22%?00==gu001#%HIL?? G  5**33V__! 4% # 
 %1CD''x@U@U7VWW%1CD''v7U7UVD,,$775%.#>!00:M//$h&:&:M8   ''++N;,,X6oo283G3G2HQ]P^^_`  	
 	
r[   c                (  K   d}d}|| j                   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        dg t        | j                   j
                  t        j                              |	g d|
       d{   }d}t        j                  |dd      r5t        j                   |j"                  t$        t        j&                           S t        j                  |dd      rDt        j                   |j"                  t        j(                        }t        j*                  |      t        j                  |ddgd      r?t        j,                  |       d{   }t        j.                  d|j0                  ||      |j2                  j5                  d      }t        j,                  |       d{   }t        j.                  d|j0                   d| d|j0                  ||      7 q7 7 <wro   )rB   r   r   rr   r]   r%   r	   r8   rD   r   rE   r^   r   r
   rG   rH   rI   rJ   r   rs   rL   rM   r_   rO   rP   rQ   rR   ri   s                  rY   delete_asynczModels.delete_async  so    & //::J!!H@@
 ''('"'$(%)* 2%++44! ( 
  e%%22%?00==gu001#%HIL.. G  5**33V__! 4% / 
 
 %1CD''x@U@U7VWW%1CD''v7U7UVD,,$775%.#>"'"<"<X"FFM//$h&:&:M8   ''++N;#88BBoo283G3G2HQ]P^^_`  	
 	
7
( G Crm   )namedescriptionr   r   r   r   rw   rx   c                ^   d}d}	|| j                   j                  }||}t        j                  |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        dg t        | j                   j                  t        j                              |
ddg|      }t        j                   |dd      r5t        j"                  |j$                  t&        t        j(                           S t        j                   |ddgd      r7t        j*                  |      }t        j,                  d|j.                  ||      |j0                  j3                  d      }t        j*                  |      }t        j,                  d|j.                   d| d|j.                  ||      )  Update Fine Tuned Model

        Update a model name or description.

        :param model_id: The ID of the model to update.
        :param name:
        :param description:
        :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rw   rx   ra   update_ft_model_inPATCH!/v1/fine_tuning/models/{model_id}Tr   r   c                  f    t        j                   j                  dddt        j                        S NFjsonr   serialize_request_bodyr}   r   UpdateFTModelInr   s   rY   <lambda>zModels.update.<locals>.<lambda>X  '    (D(D**E5&&BXBX)r[   r   r   r   r   r   r    r!   r"   r#   r$   r   r%   get_serialized_bodyr   r&   3jobs_api_routes_fine_tuning_update_fine_tuned_modelr-   r3   r4   r5   r9   r<   r=   r>   r?   r@   rA   )rB   r   r   2JobsAPIRoutesFineTuningUpdateFineTunedModelRequestr   rC   r%   r	   r8   rD   r   rE   rF   r   r
   rG   rH   rI   rJ   r   
FTModelOutrN   rO   rP   rQ   rR   rT   ra   rw   rx   r   r   r   r   r   r   rU   r8   rV   rW   rX   r   s                  @rY   updatezModels.update$  s&   . //::J!!HKK%55' 
 !!4'"&$(%)* 2%++44! "! " 
& e%%22%?00==gu001#%HIL?? R  5**33V__!  %u~% # 
 %1CD''x@Q@Q7RSS5%.#>!00:M//$h&:&:M8   ''++N;,,X6oo283G3G2HQ]P^^_`  	
 	
r[   c                  K   d}d}	|| j                   j                  }||}t        j                  |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        dg t        | j                   j                  t        j                              |
ddg|       d{   }t        j                   |dd      r5t        j"                  |j$                  t&        t        j(                           S t        j                   |ddgd      r?t        j*                  |       d{   }t        j,                  d|j.                  ||      |j0                  j3                  d      }t        j*                  |       d{   }t        j,                  d|j.                   d| d|j.                  ||      7 7 7 <w)rz   Nr{   r|   r~   r   Tr   r   c                  f    t        j                   j                  dddt        j                        S r   r   r   s   rY   r   z%Models.update_async.<locals>.<lambda>  r   r[   r   r&   r   r-   r3   r4   r5   r9   r<   r=   r>   r?   r@   rA   )rB   r   r   r   r   r]   r%   r	   r8   rD   r   rE   r^   r   r
   rG   rH   rI   rJ   r   r   r_   rO   rP   rQ   rR   r   s                  @rY   update_asynczModels.update_async  sJ    . //::J!!HKK%55' 
 ''4'"&$(%)* 2%++44! "! ( 
& e%%22%?00==gu001#%HIL.. R  5**33V__!  %u~% / 
 
 %1CD''x@Q@Q7RSS5%.#>"'"<"<X"FFM//$h&:&:M8   ''++N;#88BBoo283G3G2HQ]P^^_`  	
 	
/
  G Cs8   D2I5I	6BI7I8AII8IIIc                (   d}d}|| j                   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        dg t        | j                   j
                  t        j                              |	ddg|
      }t        j                  |dd      r5t        j                   |j"                  t$        t        j&                           S t        j                  |ddgd      r7t        j(                  |      }t        j*                  d|j,                  ||      |j.                  j1                  d      }t        j(                  |      }t        j*                  d|j,                   d| d|j,                  ||      a  Archive Fine Tuned Model

        Archive a fine-tuned model.

        :param model_id: The ID of the model to archive.
        :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.
        Nrd   POST)/v1/fine_tuning/models/{model_id}/archiveFTr   r   r   r&   4jobs_api_routes_fine_tuning_archive_fine_tuned_modelr-   r3   r4   r5   r9   r<   r=   r>   r?   r@   rA   )rB   r   r   3JobsAPIRoutesFineTuningArchiveFineTunedModelRequestrC   r%   r	   r8   rD   r   rE   rF   r   r
   rG   rH   rI   rJ   r   ArchiveFTModelOutrN   rO   rP   rQ   rR   rT   ra   r   r   r   r   r   r   r   rU   r8   rV   rW   rX   s                 rY   archivezModels.archive  s   & //::J!!HLL
 !!<'"'$(%)* 2%++44! " 
  e%%22%?00==gu001#%HIL?? S  5**33V__!  %u~% # 
 %1CD''x(@(@A  5%.#>!00:M//$h&:&:M8   ''++N;,,X6oo283G3G2HQ]P^^_`  	
 	
r[   c                n  K   d}d}|| j                   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        dg t        | j                   j
                  t        j                              |	ddg|
       d{   }t        j                  |dd      r5t        j                   |j"                  t$        t        j&                           S t        j                  |ddgd      r?t        j(                  |       d{   }t        j*                  d|j,                  ||      |j.                  j1                  d      }t        j(                  |       d{   }t        j*                  d|j,                   d| d|j,                  ||      7 7 7 <wr   )rB   r   r   r   r]   r%   r	   r8   rD   r   rE   r^   r   r
   rG   rH   rI   rJ   r   r   r_   rO   rP   rQ   rR   r   s                 rY   archive_asynczModels.archive_async;  s5    & //::J!!HLL
 ''<'"'$(%)* 2%++44! ( 
  e%%22%?00==gu001#%HIL.. S  5**33V__!  %u~% / 
 
 %1CD''x(@(@A  5%.#>"'"<"<X"FFM//$h&:&:M8   ''++N;#88BBoo283G3G2HQ]P^^_`  	
 	
3
$ G C8   DH5H.BH5H1AH56H378H51H53H5c                (   d}d}|| j                   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        dg t        | j                   j
                  t        j                              |	ddg|
      }t        j                  |dd      r5t        j                   |j"                  t$        t        j&                           S t        j                  |ddgd      r7t        j(                  |      }t        j*                  d|j,                  ||      |j.                  j1                  d      }t        j(                  |      }t        j*                  d|j,                   d| d|j,                  ||      a  Unarchive Fine Tuned Model

        Un-archive a fine-tuned model.

        :param model_id: The ID of the model to unarchive.
        :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.
        Nrd   rp   r   FTr   r   r   r&   6jobs_api_routes_fine_tuning_unarchive_fine_tuned_modelr-   r3   r4   r5   r9   r<   r=   r>   r?   r@   rA   )rB   r   r   5JobsAPIRoutesFineTuningUnarchiveFineTunedModelRequestrC   r%   r	   r8   rD   r   rE   rF   r   r
   rG   rH   rI   rJ   r   UnarchiveFTModelOutrN   rO   rP   rQ   rR   r   s                 rY   	unarchivezModels.unarchive  s   & //::J!!HNN
 !!<'"'$(%)* 2%++44! " 
  e%%22%?00==gu001#%HIL?? U  5**33V__!  %u~% # 
 %1CD''x(B(BC  5%.#>!00:M//$h&:&:M8   ''++N;,,X6oo283G3G2HQ]P^^_`  	
 	
r[   c                n  K   d}d}|| j                   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        dg t        | j                   j
                  t        j                              |	ddg|
       d{   }t        j                  |dd      r5t        j                   |j"                  t$        t        j&                           S t        j                  |ddgd      r?t        j(                  |       d{   }t        j*                  d|j,                  ||      |j.                  j1                  d      }t        j(                  |       d{   }t        j*                  d|j,                   d| d|j,                  ||      7 7 7 <wr   )rB   r   r   r   r]   r%   r	   r8   rD   r   rE   r^   r   r
   rG   rH   rI   rJ   r   r   r_   rO   rP   rQ   rR   r   s                 rY   unarchive_asynczModels.unarchive_async  s5    & //::J!!HNN
 ''<'"'$(%)* 2%++44! ( 
  e%%22%?00==gu001#%HIL.. U  5**33V__!  %u~% / 
 
 %1CD''x(B(BC  5%.#>"'"<"<X"FFM//$h&:&:M8   ''++N;#88BBoo283G3G2HQ]P^^_`  	
 	
3
$ G Cr   )__name__
__module____qualname____doc__r	   r   r   rE   r   strintr   r   rK   rZ   r`   rh   rj   rl   rs   rt   rv   r   r   r   r   r   r   r   r   r    r[   rY   r   r      sd   
 8=$($(48P
 "%"3"34P
 SM	P

 SMP
 wsCx01P
 
&""	#P
j 8=$($(48P
 "%"3"34P
 SM	P

 SMP
 wsCx01P
 
&""	#P
l 8=$($(48^
 ^
 "%"3"34	^

 SM^
 SM^
 wsCx01^
 
UU
^
H 8=$($(48^
 ^
 "%"3"34	^

 SM^
 SM^
 wsCx01^
 
UU
^
H 8=$($(48W
 W
 "%"3"34	W

 SMW
 SMW
 wsCx01W
 
&''	(W
z 8=$($(48W
 W
 "%"3"34	W

 SMW
 SMW
 wsCx01W
 
&''	(W
z ',-27<$($(48^
 ^
 s#	^

 &c*^
 "%"3"34^
 SM^
 SM^
 wsCx01^
 
&##	$^
H ',-27<$($(48^
 ^
 s#	^

 &c*^
 "%"3"34^
 SM^
 SM^
 wsCx01^
 
&##	$^
H 8=$($(48U
 U
 "%"3"34	U

 SMU
 SMU
 wsCx01U
 
&**	+U
v 8=$($(48U
 U
 "%"3"34	U

 SMU
 SMU
 wsCx01U
 
&**	+U
v 8=$($(48U
 U
 "%"3"34	U

 SMU
 SMU
 wsCx01U
 
&,,	-U
v 8=$($(48U
 U
 "%"3"34	U

 SMU
 SMU
 wsCx01U
 
&,,	-U
r[   r   N)r   basesdkr   	mistralair   r   mistralai._hooksr   mistralai.typesr   r	   mistralai.utilsr
   typingr   r   r   r   r   r[   rY   <module>r      s+    G  # ( 3 1 ) )s
W s
r[   