
    Zi                    H   S SK Jr  S SKJrJr  S SKJr  S SKrSSKJ	r	  SSK
JrJrJrJrJrJrJrJr  SSKJrJr  SS	KJr  SS
KJrJr  SSKJrJrJrJr  SSK J!r!  SSK"J#r#  SS/r$ " S S\5      r% " S S\5      r& " S S5      r' " S S5      r( " S S5      r) " S S5      r*g)    )annotations)UnionOptional)LiteralN   )embedding_create_params)BodyOmitQueryHeadersNotGivenSequenceNotStromit	not_given)maybe_transformasync_maybe_transform)cached_property)SyncAPIResourceAsyncAPIResource)to_raw_response_wrapperto_streamed_response_wrapperasync_to_raw_response_wrapper"async_to_streamed_response_wrapper)make_request_options)CreateEmbeddingResponse
EmbeddingsAsyncEmbeddingsc                  z    \ rS rSr\SS j5       r\S	S j5       r\\SSS\S.                 S
S jjr	Sr
g)r      c                    [        U 5      $ z
This property can be used as a prefix for any HTTP method call to return
the raw response object instead of the parsed content.

For more information, see https://www.github.com/groq/groq-python#accessing-raw-response-data-eg-headers
)EmbeddingsWithRawResponseselfs    s/var/www/eduai.edurigo.com/question_generate/ques_gen_env/lib/python3.13/site-packages/groq/resources/embeddings.pywith_raw_responseEmbeddings.with_raw_response   s     )..    c                    [        U 5      $ z
An alternative to `.with_raw_response` that doesn't eagerly read the response body.

For more information, see https://www.github.com/groq/groq-python#with_streaming_response
)EmbeddingsWithStreamingResponser#   s    r%   with_streaming_response"Embeddings.with_streaming_response&   s     /t44r(   Nencoding_formatuserextra_headersextra_query
extra_bodytimeoutc               x    U R                  S[        UUUUS.[        R                  5      [	        XVXxS9[
        S9$ )`  
Creates an embedding vector representing the input text.

Args:
  input: Input text to embed, encoded as a string or array of tokens. To embed multiple
      inputs in a single request, pass an array of strings or array of token arrays.
      The input must not exceed the max input tokens for the model, cannot be an empty
      string, and any array must be 2048 dimensions or less.

  model: ID of the model to use.

  encoding_format: The format to return the embeddings in. Can only be `float` or `base64`.

  user: A unique identifier representing your end-user, which can help us monitor and
      detect abuse.

  extra_headers: Send extra headers

  extra_query: Add additional query parameters to the request

  extra_body: Add additional JSON properties to the request

  timeout: Override the client-level default timeout for this request, in seconds
/openai/v1/embeddingsinputmodelr/   r0   r1   r2   r3   r4   bodyoptionscast_to)_postr   r   EmbeddingCreateParamsr   r   	r$   r9   r:   r/   r0   r1   r2   r3   r4   s	            r%   createEmbeddings.create/   sW    L zz# ""'6 	 (== )+Q[ ,  
 	
r(    )returnr"   )rF   r+   r9   zUnion[str, SequenceNotStr[str]]r:   z,Union[str, Literal['nomic-embed-text-v1_5']]r/   z!Literal['float', 'base64'] | Omitr0   zOptional[str] | Omitr1   zHeaders | Noner2   zQuery | Noner3   zBody | Noner4   z'float | httpx.Timeout | None | NotGivenrF   r   __name__
__module____qualname____firstlineno__r   r&   r,   r   r   rC   __static_attributes__rE   r(   r%   r   r      s    / / 5 5 >B%) )-$("&;D5
 /5
 <	5

 ;5
 #5
 &5
 "5
  5
 95
 
!5
 5
r(   c                  z    \ rS rSr\SS j5       r\S	S j5       r\\SSS\S.                 S
S jjr	Sr
g)r   g   c                    [        U 5      $ r!   )AsyncEmbeddingsWithRawResponser#   s    r%   r&   !AsyncEmbeddings.with_raw_responseh   s     .d33r(   c                    [        U 5      $ r*   )$AsyncEmbeddingsWithStreamingResponser#   s    r%   r,   'AsyncEmbeddings.with_streaming_responser   s     4D99r(   Nr.   c                  #    U R                  S[        UUUUS.[        R                  5      I Sh  vN [	        XVXxS9[
        S9I Sh  vN $  N N7f)r6   r7   r8   Nr;   r<   )r@   r   r   rA   r   r   rB   s	            r%   rC   AsyncEmbeddings.create{   sn     L ZZ#,""'6 	 (==  )+Q[ ,   
 
 	

s!   /AA
A	A
AArE   )rF   rQ   )rF   rT   rG   rH   rE   r(   r%   r   r   g   s    4 4 : : >B%) )-$("&;D5
 /5
 <	5

 ;5
 #5
 &5
 "5
  5
 95
 
!5
 5
r(   c                      \ rS rSrSS jrSrg)r"      c                D    Xl         [        UR                  5      U l        g N)_embeddingsr   rC   r$   
embeddingss     r%   __init__"EmbeddingsWithRawResponse.__init__   s    %-
r(   r\   rC   Nr^   r   rF   NonerI   rJ   rK   rL   r_   rM   rE   r(   r%   r"   r"          
r(   r"   c                      \ rS rSrSS jrSrg)rQ      c                D    Xl         [        UR                  5      U l        g r[   )r\   r   rC   r]   s     r%   r_   'AsyncEmbeddingsWithRawResponse.__init__   s    %3
r(   ra   Nr^   r   rF   rc   rd   rE   r(   r%   rQ   rQ      re   r(   rQ   c                      \ rS rSrSS jrSrg)r+      c                D    Xl         [        UR                  5      U l        g r[   )r\   r   rC   r]   s     r%   r_   (EmbeddingsWithStreamingResponse.__init__   s    %2
r(   ra   Nrb   rd   rE   r(   r%   r+   r+      re   r(   r+   c                      \ rS rSrSS jrSrg)rT      c                D    Xl         [        UR                  5      U l        g r[   )r\   r   rC   r]   s     r%   r_   -AsyncEmbeddingsWithStreamingResponse.__init__   s    %8
r(   ra   Nrj   rd   rE   r(   r%   rT   rT      re   r(   rT   )+
__future__r   typingr   r   typing_extensionsr   httpxtypesr   _typesr	   r
   r   r   r   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   r   r   _base_clientr   types.create_embedding_responser   __all__r   r   r"   rQ   r+   rT   rE   r(   r%   <module>r      s    # " %  + Z Z Z ; % 9  0 E*
+I
 I
XI
& I
X
 

 

 

 
r(   