
    i                      n   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ZddlmZmZmZmZmZm Z m!Z! ddl"Z"erHd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/m0Z0 ddl1m2Z2 ddl3m4Z4 ddl5m6Z6 ddl7m8Z8 ddl9m: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)Agents)Audio)Batch)Beta)Chat)Classifiers)
Embeddings)Files)Fim)
FineTuning)Models)Ocrc                       e Zd ZU dZded<   	 ded<   ded<   	 ded	<   d
ed<   ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   	 ded<   ddddddd d!d"d#d$d%d&Z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   d0ee   d1d'fd2Zd;d3Zd4e	fd5Z fd6Zd7 Zd8 Zd9 Zd: Z xZS )<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#   r   r   betar    filesr"   fine_tuningr   batchr   chatr!   fimr   agentsr   
embeddingsr   classifiersr$   ocrr   audio)zmistralai.models_r#   )zmistralai.betar   )zmistralai.filesr    )zmistralai.fine_tuningr"   )zmistralai.batchr   )zmistralai.chatr   )zmistralai.fimr!   )zmistralai.agentsr   )zmistralai.embeddingsr   )zmistralai.classifiersr   )zmistralai.ocrr$   )zmistralai.audior   )r   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   Napi_keyserver
server_url
url_paramsclientasync_clientretry_config
timeout_msdebug_loggerreturnc
                    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        ||
||||||||	
      | 	       t!               }|| j"                  j$                  d
<   | j"                  j'                         ^}}|j)                  ||      \  }| j"                  _        ||k7  r|| j"                  _        t/        j0                  | t2        t5        t6        | j"                        | j"                  j*                  | j"                  j8                  | j"                  j:                  | j"                  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
        TNFz;The provided client must implement the HttpClient protocol.zFThe provided async_client must implement the AsyncHttpClient protocol.c                  :    t        j                                 S )Nr2   )r   Securityr>   s   K/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/mistralai/sdk.py<lambda>z"Mistral.__init__.<locals>.<lambda>u   s    vwyA     r>   )
r6   client_suppliedr7   async_client_suppliedsecurityr4   r3   r8   r9   r:   
parent_ref_hooks)httpxClient
issubclasstyper   AsyncClientr
   r   callabler   r?   r   template_urlr   __init__r   r   sdk_configuration__dict__get_server_detailssdk_initr6   r4   weakreffinalizer   r   r   rC   r7   rD   )selfr2   r3   r4   r5   r6   r7   r8   r9   r:   rC   rD   rE   hookscurrent_server_url_s    `              r@   rP   zMistral.__init__F   s   . >\\^F#OL*
 	IH	I 
 !% ,,.L$)!-/L
 	TS	T 
 GAHw7H!%"//
JG
 /)&;!%)%) 	
" 
 5:''1!%!7!7!J!J!LQ49NN5
1
D**1 +0:D""-d445""))""22""//""88	
rB   c                     t        |      D ]  }	 t        j                  |      c S  t        d| d| d      # t        $ r. t        j
                  j                  |d        ||dz
  k(  rY  FY dw xY w)Nr   zFailed to import module 'z' after z	 attempts)range	importlibimport_moduleKeyErrorsysmodulespop)rW   modnameretriesattempts       r@   dynamic_importzMistral.dynamic_import   s    W~ 	G ..w77	 27)8G9IVWW  .gk) *s   :1A10A1namec                    || j                   v rS| j                   |   \  }}	 | 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)	NrF   zFailed to import module z for attribute z: zFailed to find class z in module 'z' object has no attribute ')	_sub_sdk_maprf   getattrrQ   setattrImportErrorAttributeErrorrL   __name__)rW   rg   module_path
class_namemoduleklassinstancees           r@   __getattr__zMistral.__getattr__   s   4$$$&*&7&7&=#K,,[9
3 !7!7DIdH- T
##$$?vQG
 	
  $.{m?4&PRSTRUV " $+J<{;-_c^ddfghfijs#   ?B 	CB%%C1C		Cc                     t        t        | 	               }t        | j                  j	                               }t        t        t        ||z                     S N)listsuper__dir__rj   keyssortedset)rW   default_attrs
lazy_attrs	__class__s      r@   r{   zMistral.__dir__   sG    UW_./$++0023
d3}z9:;<<rB   c                     | S rx    rW   s    r@   	__enter__zMistral.__enter__   s    rB   c                    K   | S wrx   r   r   s    r@   
__aenter__zMistral.__aenter__   s     s   c                     | j                   j                  :| j                   j                  s$| j                   j                  j                          d | j                   _        y rx   )rQ   r6   rC   closerW   exc_typeexc_valexc_tbs       r@   __exit__zMistral.__exit__   sI    ""))5**::""))//1(,%rB   c                    K   | j                   j                  B| j                   j                  s,| j                   j                  j                          d {    d | j                   _        y 7 wrx   )rQ   r7   rD   acloser   s       r@   	__aexit__zMistral.__aexit__   sX     ""//;**@@((55<<>>>.2+ ?s   AA/A-A/)   )ro   
__module____qualname____doc____annotations__rj   r   r   r   strr   r   r   r   r   r   intr	   rP   rf   rv   r{   r   r   r   r   __classcell__)r   s   @r@   r&   r&       s    h
LNN
L	J"	JN1*->-*'0<?'-L" PT $$(/3'+266;$()-\
%xHSM8I/J JKL\
 \
 SM	\

 T#s(^,\
 $\
 /\
 '{3\
 SM\
 v&\
 
\
|	X
 
,=
-3rB   r&   )<r   basesdkr   
httpclientr   r   r   r   sdkconfigurationr   utils.loggerr	   r
   utils.retriesr   rI   r]   	mistralair   r   mistralai._hooksr   mistralai.typesr   r   r`   typingr   r   r   r   r   r   r   rU   mistralai.agentsr   mistralai.audior   mistralai.batchr   mistralai.betar   mistralai.chatr   mistralai.classifiersr   mistralai.embeddingsr   mistralai.filesr    mistralai.fimr!   mistralai.fine_tuningr"   mistralai.models_r#   mistralai.ocrr$   r&   r   rB   r@   <module>r      sm    G  O O . 4 &   # % 3 
 L L L '%%##1/%!0(!~3g ~3rB   