
    i                         d Z ddlmZ ddlmZmZ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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mZmZmZmZmZm Z  ddl!Z!erddl"m#Z# ddl$m%Z%  G d de      Z&y)zACode generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.   )BaseSDK)AsyncHttpClientClientOwner
HttpClientclose_clients)SDKConfiguration)Loggerget_default_logger)RetryConfig    N)modelsutils)SDKHooks)OptionalNullableUNSET)AnyCallableDictOptionalTYPE_CHECKINGUnioncast)Chat)Ocrc                        e Zd ZU dZded<   	 ded<   dddZd	d	d	ed	d	fd
eee	g ef   f   d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efdZ fdZd Zd Zd Zd Z xZS )MistralAzurezMistral 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   chatr   ocr)zmistralai_azure.chatr   )zmistralai_azure.ocrr   )r   r   Nazure_api_keyazure_endpoint
url_paramsclientasync_clientretry_config
timeout_msdebug_loggerreturnc	                 :   |j                  d      s|dz  }|j                  d      s|dz  }|}	d}
|t        j                         }d}
t        t	        |      t
              sJ d       d}|t        j                         }d}|
t               }t        t	        |      t              sJ d       d}t              rfd}nt        j                  	      }|	|t        j                  |	|      }	t        j                  | t!        ||
||||	d|||

             t#               }|| j$                  j&                  d<   | j$                  j)                         ^}}|j+                  ||      \  }	| j$                  _        ||	k7  r|	| j$                  _        t1        j2                  | t4        t7        t8        | j$                        | j$                  j,                  | j$                  j:                  | j$                  j<                  | j$                  j>                         y)a  Instantiates the SDK configuring it with the provided parameters.

        :param azure_api_key: The azure_api_key required for authentication
        :param azure_endpoint: The Azure AI endpoint 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
        /zv1/TNFz;The provided client must implement the HttpClient protocol.zFThe provided async_client must implement the AsyncHttpClient protocol.c                  :    t        j                                 S )Napi_key)r   Security)r   s   Q/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/mistralai_azure/sdk.py<lambda>z'MistralAzure.__init__.<locals>.<lambda>T   s    v}G     r+   )
r"   client_suppliedr#   async_client_suppliedsecurity
server_urlserverr$   r%   r&   _hooks) endswithhttpxClient
issubclasstyper   AsyncClientr
   r   callabler   r-   r   template_urlr   __init__r   r   sdk_configuration__dict__get_server_detailssdk_initr"   r4   weakreffinalizer   r   r   r1   r#   r2   )selfr   r    r!   r"   r#   r$   r%   r&   r4   r1   r2   r3   hookscurrent_server_url_s    `              r.   r?   zMistralAzure.__init__    s   . &&s+c!N&&u-e#N#
>\\^F#OL*
 	IH	I 
 !% ,,.L$)!-/L
 	TS	T 
 M"GH}=H!%"//
JG
 /)&;!%)%)	
  
 5:''1!%!7!7!J!J!LQ49NN5
1
D**1 +0:D""-d445""))""22""//""88	
r0   namec                    || j                   v rU| j                   |   \  }}	 t        j                  |      }t        ||      } || j                        }t        | ||       |S t        dt        |       j                   d| d      # t        $ r}t        d| d| d|       |d }~wt        $ r}t        d| d| d| d|       |d }~ww xY w)NzFailed to import module z for attribute z: zFailed to find class z in module 'z' object has no attribute ')
_sub_sdk_map	importlibimport_modulegetattrr@   setattrImportErrorAttributeErrorr;   __name__)rF   rJ   module_path
class_namemoduleklassinstancees           r.   __getattr__zMistralAzure.__getattr__   s   4$$$&*&7&7&=#K"00=
3 !7!78dH- T
##$$?vQG
 	
  $.{m?4&PRSTRUV " $+J<{;-_c^ddfghfijs$   AB	 		CB''C3CCc                     t        t        | 	               }t        | j                  j	                               }t        t        t        ||z                     S N)listsuper__dir__rM   keyssortedset)rF   default_attrs
lazy_attrs	__class__s      r.   r`   zMistralAzure.__dir__   sG    UW_./$++0023
d3}z9:;<<r0   c                     | S r]    rF   s    r.   	__enter__zMistralAzure.__enter__   s    r0   c                    K   | S wr]   rh   ri   s    r.   
__aenter__zMistralAzure.__aenter__   s     s   c                     | j                   j                  :| j                   j                  s$| j                   j                  j                          d | j                   _        y r]   )r@   r"   r1   closerF   exc_typeexc_valexc_tbs       r.   __exit__zMistralAzure.__exit__   sI    ""))5**::""))//1(,%r0   c                    K   | j                   j                  B| j                   j                  s,| j                   j                  j                          d {    d | j                   _        y 7 wr]   )r@   r#   r2   aclosero   s       r.   	__aexit__zMistralAzure.__aexit__   sX     ""//;**@@((55<<>>>.2+ ?s   AA/A-A/)rT   
__module____qualname____doc____annotations__rM   r   r   strr   r   r   r   r   r   r   intr	   r?   r[   r`   rj   rl   rs   rv   __classcell__)rf   s   @r.   r   r      s     h
L	J0-L 04'+266;$()-`
S(2s7"334`
 `
 T#s(^,	`

 $`
 /`
 '{3`
 SM`
 v&`
 
`
D
 
,=
-3r0   r   )'ry   basesdkr   
httpclientr   r   r   r   sdkconfigurationr   utils.loggerr	   r
   utils.retriesr   r8   rN   mistralai_azurer   r   mistralai_azure._hooksr   mistralai_azure.typesr   r   typingr   r   r   r   r   r   r   rD   mistralai_azure.chatr   mistralai_azure.ocrr   r   rh   r0   r.   <module>r      sL    G  O O . 4 &   ) + 9 L L L )'\37 \3r0   