
    gD                        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Zdd	lmZmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddl!m"Z" ddl#m$Z$ ddl%m&Z&m'Z' ddl(m)Z)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)AsyncHttpClient
HttpClient)SDKConfiguration)Loggerget_default_logger)RetryConfig    N)modelsutils)SDKHooks)Agents)Batch)Chat)Classifiers)
Embeddings)Files)Fim)
FineTuning)Models)OptionalNullableUNSET)AnyCallableDictOptionalUnionc                   <   e Zd ZU dZeed<   	 eed<   	 eed<   eed<   e	ed<   	 e
ed<   	 eed<   	 eed	<   	 eed
<   	 ddddddeddf	deeee   eg ee   f   f      dee   dee   deeeef      dee   dee   dee   dee   dee   ddfdZd Zd Zd Zd Zd Zy)MistralzMistral AI API: Our Chat Completion and Embeddings APIs specification. Create your account on [La Plateforme](https://console.mistral.ai) to get access and read the [docs](https://docs.mistral.ai) to learn how to use it.r   filesfine_tuningbatchchatfimagents
embeddingsclassifiersNapi_keyserver
server_url
url_paramsclientasync_clientretry_config
timeout_msdebug_loggerreturnc
                    |t        j                         }t        t        |      t              sJ d       |t        j
                         }|	
t               }	t        t        |      t              sJ d       d}
t              rfd}
nt        j                        }
||t        j                  ||      }t        j                  | t        |||
|||||	             t!               }| j"                  j%                         ^}}|j'                  || j"                  j(                        \  }| j"                  _        ||k7  r|| j"                  _        || j"                  j,                  d<   | j/                          y)a  Instantiates the SDK configuring it with the provided parameters.

        :param api_key: The api_key required for authentication
        :param server: The server by name to use for all methods
        :param server_url: The server URL to use for all methods
        :param url_params: Parameters to optionally template the server URL with
        :param client: The HTTP client to use for all synchronous methods
        :param async_client: The Async HTTP client to use for all asynchronous methods
        :param retry_config: The retry configuration to use for all supported methods
        :param timeout_ms: Optional request timeout applied to each operation in milliseconds
        Nz;The provided client must implement the HttpClient protocol.zFThe provided async_client must implement the AsyncHttpClient protocol.c                  :    t        j                                 S )Nr(   )r   Securityr4   s   B/var/www/openai/venv/lib/python3.12/site-packages/mistralai/sdk.py<lambda>z"Mistral.__init__.<locals>.<lambda>V   s    vwyA    r4   )r,   r-   securityr*   r)   r.   r/   r0   _hooks)httpxClient
issubclasstyper   AsyncClientr   r   callabler   r5   r   template_urlr   __init__r   r   sdk_configurationget_server_detailssdk_initr,   r*   __dict__
_init_sdks)selfr(   r)   r*   r+   r,   r-   r.   r/   r0   r9   hookscurrent_server_url_s    `            r6   rB   zMistral.__init__,   s   . >\\^FL*
 	IH	I 
  ,,.L-/L
 	TS	T 
 GAHw7H!%"//
JG
)!%)%)		
 
!%!7!7!J!J!LQ49NN 6 6 = =5
1
D**1 +0:D""- 5:''1r8   c                    t        | j                        | _        t        | j                        | _        t        | j                        | _        t        | j                        | _        t        | j                        | _
        t        | j                        | _        t        | j                        | _        t        | j                        | _        t#        | j                        | _        y N)r   rC   r   r   r    r   r!   r   r"   r   r#   r   r$   r   r%   r   r&   r   r'   rH   s    r6   rG   zMistral._init_sdksz   s    T3344112
%d&<&<=4112
//0	t--.T334$T%;%;<&t'='=>r8   c                     | S rM    rN   s    r6   	__enter__zMistral.__enter__   s    r8   c                    K   | S wrM   rP   rN   s    r6   
__aenter__zMistral.__aenter__   s     s   c                 z    | j                   j                  %| j                   j                  j                          y y rM   )rC   r,   closerH   exc_typeexc_valexc_tbs       r6   __exit__zMistral.__exit__   s1    !!((4""))//1 5r8   c                    K   | j                   j                  -| j                   j                  j                          d {    y y 7 wrM   )rC   r-   acloserV   s       r6   	__aexit__zMistral.__aexit__   s>     !!..:((55<<>>> ;>s   >A	 AA	) __name__
__module____qualname____doc__r   __annotations__r   r   r   r   r   r   r   r   r   r   r   strr   r   r   r   r   r	   intr   rB   rG   rQ   rS   rZ   r]   rP   r8   r6   r   r      sF    hNLL
J	H"N PT $$(/3'+266;$()-L%xHSM8I/J JKLL L SM	L
 T#s(^,L $L /L '{3L SML v&L 
L\	?2?r8   r   )/ra   basesdkr   
httpclientr   r   sdkconfigurationr   utils.loggerr   r   utils.retriesr	   r;   	mistralair   r   mistralai._hooksr   mistralai.agentsr   mistralai.batchr   mistralai.chatr   mistralai.classifiersr   mistralai.embeddingsr   mistralai.filesr   mistralai.fimr   mistralai.fine_tuningr   mistralai.models_r   mistralai.typesr   r   typingr   r   r   r   r   r   rP   r8   r6   <module>rw      sR    G  3 . 4 &  # % # !  - + !  , $ 3 7 7y?g y?r8   