
    i#                         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 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    )modelsutils)HookContext)OptionalNullableUNSET)get_security_from_env)unmarshal_json_response)AnyMappingOptionalUnionc                       e Zd ZdZeddedddddedeej                  ej                  f   de
e   deej                     deej                     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edddddedeej                  ej                  f   de
e   deej                     deej                     d	e
ej                      d
ee   dee   deeeef      dej$                  fdZy)
EmbeddingszEmbeddings API.N)output_dimensionoutput_dtypeencoding_formatretries
server_url
timeout_mshttp_headersmodelinputsr   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                  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        j                              |g d|      }d}t        j                   |dd      rt#        t        j$                  |      S t        j                   |dd      r0t#        t        j&                  |      }t        j(                  ||      t        j                   |dd      r,t        j*                  |      }t        j,                  d||      t        j                   |dd      r,t        j*                  |      }t        j,                  d||      t        j,                  d|      )[  Embeddings

        Embeddings

        :param model: ID of the model to use.
        :param inputs: Text to embed.
        :param output_dimension: The dimension of the output embeddings.
        :param output_dtype:
        :param encoding_format:
        :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   POST/v1/embeddingsTF
user-agentapplication/jsonc                  R    t        j                   dddt        j                        S NFjsonr   serialize_request_bodyr   EmbeddingRequestrequests   R/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/mistralai/embeddings.py<lambda>z#Embeddings.create.<locals>.<lambda>K   #    (D(Dvv/F/F)     methodpathbase_urlurl_variablesr*   request_body_requiredrequest_has_path_paramsrequest_has_query_paramsuser_agent_headeraccept_header_valuer   securityget_serialized_bodyr   429500502503504 embeddings_v1_embeddings_postconfigr2   operation_idoauth2_scopessecurity_source4224XX5XXhook_ctxr*   error_status_codesretry_config200rI   rJ   *API error occurredrK   Unexpected response received)sdk_configurationr   _get_urlr   r(   _build_requestr9   r	   rO   
isinstancer   RetryConfig
do_requestr   r
   Securitymatch_responser   EmbeddingResponseHTTPValidationErrorDataHTTPValidationErrorstream_to_textSDKErrorselfr   r   r   r   r   r   r   r   r   r2   r3   reqrO   http_resresponse_datahttp_res_textr*   s                    @r+   createzEmbeddings.create   sA   : //::J!!H}}X}=H))-%+
 !!!'"&$)%)* 2%++44! "! " 
& e%%22%?00==gu001#%HIL?? --!R<  5**33V__! 4% # 
 "%1CD*6+C+CXNN%1CD3..M ,,]HEE%5!00:M//"6-PP%5!00:M//"6-PPoo<hGGr.   c       	           K   d}
d}|| j                   j                  }||}
n| 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        | j                   |
xs ddg t        | j                   j                  t        j                              |g d|       d{   }d}t        j                   |dd      rt#        t        j$                  |      S t        j                   |dd      r0t#        t        j&                  |      }t        j(                  ||      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 6w)r   Nr   r   r    TFr!   r"   c                  R    t        j                   dddt        j                        S r$   r&   r)   s   r+   r,   z)Embeddings.create_async.<locals>.<lambda>   r-   r.   r/   r;   rA   rB   rC   rH   rL   rP   rI   rJ   rQ   rR   rK   rS   )rT   r   rU   r   r(   _build_request_asyncr9   r	   rO   rW   r   rX   do_request_asyncr   r
   rZ   r[   r   r\   r]   r^   stream_to_text_asyncr`   ra   s                    @r+   create_asynczEmbeddings.create_asyncy   se    : //::J!!H}}X}=H))-%+
 ''!'"&$)%)* 2%++44! "! ( 
& e%%22%?00==gu001#%HIL.. --!R<  5**33V__! 4% / 
 
 "%1CD*6+C+CXNN%1CD3..M ,,]HEE%5"'"<"<X"FFM//"6-PP%5"'"<"<X"FFM//"6-PPoo<hGG=
0 G Gs8   EI8I1B-I84I45A
I8?I6 2I84I86I8)__name__
__module____qualname____doc__r	   strr   r   EmbeddingRequestInputsEmbeddingRequestInputsTypedDictr   intr   EmbeddingDtypeEncodingFormatr   rX   r   r\   rg   rm    r.   r+   r   r      s    388<;?7<$($(48hH hH ))6+Q+QQ
	hH +3/hH v445hH "&"7"78hH "%"3"34hH SMhH SMhH wsCx01hH 
	!	!hHb 388<;?7<$($(48hH hH ))6+Q+QQ
	hH +3/hH v445hH "&"7"78hH "%"3"34hH SMhH SMhH wsCx01hH 
	!	!hHr.   r   N)rq   basesdkr   	mistralair   r   mistralai._hooksr   mistralai.typesr   r	   mistralai.utilsr
   'mistralai.utils.unmarshal_json_responser   typingr   r   r   r   r   rx   r.   r+   <module>r      s0    G  # ( 3 1 K 0 0UH UHr.   