o
    h                     @  s  d dl mZ d dlmZmZmZ d dlmZ d dlZddl	m
Z
 ddlmZmZmZmZ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mZmZmZ ddlmZ ddl m!Z! ddgZ"G dd deZ#G dd deZ$G dd dZ%G dd dZ&G dd dZ'G dd dZ(dS )    )annotations)ListUnionOptional)LiteralN   )embedding_create_params)	NOT_GIVENBodyQueryHeadersNotGiven)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                   @  B   e Zd ZedddZedddZeeddded	dddZdS ) r   returnEmbeddingsWithRawResponsec                 C     t | S a  
        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
        )r   self r"   m/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/groq/resources/embeddings.pywith_raw_response      zEmbeddings.with_raw_responseEmbeddingsWithStreamingResponsec                 C  r   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
        )r&   r    r"   r"   r#   with_streaming_response)      z"Embeddings.with_streaming_responseNencoding_formatuserextra_headersextra_query
extra_bodytimeoutinputUnion[str, List[str]]model,Union[str, Literal['nomic-embed-text-v1_5']]r+   %Literal['float', 'base64'] | NotGivenr,   Optional[str] | NotGivenr-   Headers | Noner.   Query | Noner/   Body | Noner0   'float | httpx.Timeout | None | NotGivenr   c          	   	   C  s0   | j dt||||dtjt||||dtdS )  
        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r1   r3   r+   r,   r-   r.   r/   r0   bodyoptionscast_to)_postr   r   EmbeddingCreateParamsr   r   	r!   r1   r3   r+   r,   r-   r.   r/   r0   r"   r"   r#   create2   s   &	zEmbeddings.create)r   r   )r   r&   r1   r2   r3   r4   r+   r5   r,   r6   r-   r7   r.   r8   r/   r9   r0   r:   r   r   __name__
__module____qualname__r   r$   r(   r	   rF   r"   r"   r"   r#   r          	c                   @  r   ) r   r   AsyncEmbeddingsWithRawResponsec                 C  r   r   )rM   r    r"   r"   r#   r$   k   r%   z!AsyncEmbeddings.with_raw_response$AsyncEmbeddingsWithStreamingResponsec                 C  r   r'   )rN   r    r"   r"   r#   r(   u   r)   z'AsyncEmbeddings.with_streaming_responseNr*   r1   r2   r3   r4   r+   r5   r,   r6   r-   r7   r.   r8   r/   r9   r0   r:   r   c          	   	     s>   | j dt||||dtjI dH t||||dtdI dH S )r;   r<   r=   Nr>   r?   )rC   r   r   rD   r   r   rE   r"   r"   r#   rF   ~   s    &	zAsyncEmbeddings.create)r   rM   )r   rN   rG   rH   r"   r"   r"   r#   r   j   rL   c                   @     e Zd ZdddZdS )	r   
embeddingsr   r   Nonec                 C     || _ t|j| _d S N)_embeddingsr   rF   r!   rP   r"   r"   r#   __init__      
z"EmbeddingsWithRawResponse.__init__NrP   r   r   rQ   rI   rJ   rK   rV   r"   r"   r"   r#   r          r   c                   @  rO   )	rM   rP   r   r   rQ   c                 C  rR   rS   )rT   r   rF   rU   r"   r"   r#   rV      rW   z'AsyncEmbeddingsWithRawResponse.__init__NrP   r   r   rQ   rY   r"   r"   r"   r#   rM      rZ   rM   c                   @  rO   )	r&   rP   r   r   rQ   c                 C  rR   rS   )rT   r   rF   rU   r"   r"   r#   rV      rW   z(EmbeddingsWithStreamingResponse.__init__NrX   rY   r"   r"   r"   r#   r&      rZ   r&   c                   @  rO   )	rN   rP   r   r   rQ   c                 C  rR   rS   )rT   r   rF   rU   r"   r"   r#   rV      rW   z-AsyncEmbeddingsWithStreamingResponse.__init__Nr[   rY   r"   r"   r"   r#   rN      rZ   rN   ))
__future__r   typingr   r   r   typing_extensionsr   httpxtypesr   _typesr	   r
   r   r   r   _utilsr   r   _compatr   	_resourcer   r   	_responser   r   r   r   _base_clientr   types.create_embedding_responser   __all__r   r   r   rM   r&   rN   r"   r"   r"   r#   <module>   s&   LL			