§
    Ý
@g‡-  ã                  ó’  — d dl mZ d dlZd dlmZ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 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  ddl!m"Z"m#Z# ddl$m%Z% ddl&m'Z' ddl(m)Z) ddgZ* G d„ de¦  «        Z+ G d„ de ¦  «        Z, G d„ d¦  «        Z- G d„ d¦  «        Z. G d„ d¦  «        Z/ G d„ d¦  «        Z0dS )é    )ÚannotationsN)ÚListÚUnionÚIterableÚcast)ÚLiteralé   )Ú_legacy_response)Úembedding_create_params)Ú	NOT_GIVENÚBodyÚQueryÚHeadersÚNotGiven)Úis_givenÚmaybe_transform)Úcached_property)ÚnumpyÚ	has_numpy)ÚSyncAPIResourceÚAsyncAPIResource)Úto_streamed_response_wrapperÚ"async_to_streamed_response_wrapper)Úmake_request_options)ÚEmbeddingModel)ÚCreateEmbeddingResponseÚ
EmbeddingsÚAsyncEmbeddingsc                  óX   — e Zd Zedd„¦   «         Zedd„¦   «         Zeeedddedœdd„ZdS )r   ÚreturnÚEmbeddingsWithRawResponsec                ó    — t          | ¦  «        S ©a  
        This property can be used as a prefix for any HTTP method call to return the
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/openai/openai-python#accessing-raw-response-data-eg-headers
        )r!   ©Úselfs    úO/var/www/piapp/venv/lib/python3.11/site-packages/openai/resources/embeddings.pyÚwith_raw_responsezEmbeddings.with_raw_response   s   € õ )¨Ñ.Ô.Ð.ó    ÚEmbeddingsWithStreamingResponsec                ó    — t          | ¦  «        S ©zÌ
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/openai/openai-python#with_streaming_response
        )r)   r$   s    r&   Úwith_streaming_responsez"Embeddings.with_streaming_response%   s   € õ /¨tÑ4Ô4Ð4r(   N©Ú
dimensionsÚencoding_formatÚuserÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutÚinputú=Union[str, List[str], Iterable[int], Iterable[Iterable[int]]]ÚmodelúUnion[str, EmbeddingModel]r.   úint | NotGivenr/   ú%Literal['float', 'base64'] | NotGivenr0   ústr | NotGivenr1   úHeaders | Noner2   úQuery | Noner3   úBody | Noner4   ú'float | httpx.Timeout | None | NotGivenr   c       	        óô   ‡— ||||‰dœ}
t          ‰¦  «        st          ¦   «         rd|
d<   dˆfd„}|                      dt          |
t          j        ¦  «        t          ||||	|¬	¦  «        t          ¬
¦  «        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 (8192 tokens for
              `text-embedding-ada-002`), cannot be an empty string, and any array must be 2048
              dimensions or less.
              [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken)
              for counting tokens.

          model: ID of the model to use. You can use the
              [List models](https://platform.openai.com/docs/api-reference/models/list) API to
              see all of your available models, or see our
              [Model overview](https://platform.openai.com/docs/models) for descriptions of
              them.

          dimensions: The number of dimensions the resulting output embeddings should have. Only
              supported in `text-embedding-3` and later models.

          encoding_format: The format to return the embeddings in. Can be either `float` or
              [`base64`](https://pypi.org/project/pybase64/).

          user: A unique identifier representing your end-user, which can help OpenAI to monitor
              and detect abuse.
              [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids).

          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
        ©r5   r7   r0   r.   r/   Úbase64r/   Úobjr   r    c                ó  •— t          ‰¦  «        r| S | j        D ]q}t          t          |j        ¦  «        }t          |t          ¦  «        sŒ2t          j        t          j
        |¦  «        d¬¦  «                             ¦   «         |_        Œr| S ©NÚfloat32)Údtype©r   Údatar   ÚobjectÚ	embeddingÚ
isinstanceÚstrÚnpÚ
frombufferrC   Ú	b64decodeÚtolist©rD   rL   rJ   r/   s      €r&   Úparserz!Embeddings.create.<locals>.parserk   ó�   ø€ Ý˜Ñ(Ô(ð à�
à œXð ð �	Ý�F IÔ$7Ñ8Ô8�Ý! $­Ñ,Ô,ð àå&(¤mÝÔ$ TÑ*Ô*°)ð'ñ 'ô 'ç’&‘(”(ð Ô#Ð#ð ˆJr(   ú/embeddings©r1   r2   r3   r4   Úpost_parser©ÚbodyÚoptionsÚcast_to©rD   r   r    r   ©r   r   Ú_postr   r   ÚEmbeddingCreateParamsr   r   ©r%   r5   r7   r.   r/   r0   r1   r2   r3   r4   ÚparamsrT   s       `       r&   ÚcreatezEmbeddings.create.   s¾   ø€ ðh ØØØ$Ø.ð
ð 
ˆõ ˜Ñ(Ô(ð 	1­Y©[¬[ð 	1Ø(0ˆFÐ$Ñ%ð	ð 	ð 	ð 	ð 	ð 	ð" �zŠzØÝ  Õ)@Ô)VÑWÔWÝ(Ø+Ø'Ø%ØØ"ðñ ô õ ,ð ñ 
ô 
ð 	
r(   )r    r!   )r    r)   ©r5   r6   r7   r8   r.   r9   r/   r:   r0   r;   r1   r<   r2   r=   r3   r>   r4   r?   r    r   ©Ú__name__Ú
__module__Ú__qualname__r   r'   r,   r   rc   © r(   r&   r   r      s‘   € € € € € Øð/ð /ð /ñ „_ð/ð ð5ð 5ð 5ñ „_ð5ð &/ØAJØ(ð )-Ø$(Ø"&Ø;DðY
ð Y
ð Y
ð Y
ð Y
ð Y
ð Y
ð Y
r(   c                  óX   — e Zd Zedd„¦   «         Zedd„¦   «         Zeeedddedœdd„ZdS )r   r    ÚAsyncEmbeddingsWithRawResponsec                ó    — t          | ¦  «        S r#   )rk   r$   s    r&   r'   z!AsyncEmbeddings.with_raw_response‹   s   € õ .¨dÑ3Ô3Ð3r(   Ú$AsyncEmbeddingsWithStreamingResponsec                ó    — t          | ¦  «        S r+   )rm   r$   s    r&   r,   z'AsyncEmbeddings.with_streaming_response•   s   € õ 4°DÑ9Ô9Ð9r(   Nr-   r5   r6   r7   r8   r.   r9   r/   r:   r0   r;   r1   r<   r2   r=   r3   r>   r4   r?   r   c       	      ƒ  ó  ‡K  — ||||‰dœ}
t          ‰¦  «        st          ¦   «         rd|
d<   dˆfd„}|                      dt          |
t          j        ¦  «        t          ||||	|¬	¦  «        t          ¬
¦  «        ƒ d{V —†S )rA   rB   rC   r/   rD   r   r    c                ó  •— t          ‰¦  «        r| S | j        D ]q}t          t          |j        ¦  «        }t          |t          ¦  «        sŒ2t          j        t          j
        |¦  «        d¬¦  «                             ¦   «         |_        Œr| S rF   rI   rS   s      €r&   rT   z&AsyncEmbeddings.create.<locals>.parserÛ   rU   r(   rV   rW   rY   Nr]   r^   ra   s       `       r&   rc   zAsyncEmbeddings.createž   sà   øè è € ðh ØØØ$Ø.ð
ð 
ˆõ ˜Ñ(Ô(ð 	1­Y©[¬[ð 	1Ø(0ˆFÐ$Ñ%ð	ð 	ð 	ð 	ð 	ð 	ð" —Z’ZØÝ  Õ)@Ô)VÑWÔWÝ(Ø+Ø'Ø%ØØ"ðñ ô õ ,ð  ñ 
ô 
ð 
ð 
ð 
ð 
ð 
ð 
ð 	
r(   )r    rk   )r    rm   rd   re   ri   r(   r&   r   r   Š   s‘   € € € € € Øð4ð 4ð 4ñ „_ð4ð ð:ð :ð :ñ „_ð:ð &/ØAJØ(ð )-Ø$(Ø"&Ø;DðY
ð Y
ð Y
ð Y
ð Y
ð Y
ð Y
ð Y
r(   c                  ó   — e Zd Zdd„ZdS )r!   Ú
embeddingsr   r    ÚNonec                óP   — || _         t          j        |j        ¦  «        | _        d S ©N)Ú_embeddingsr
   Úto_raw_response_wrapperrc   ©r%   rr   s     r&   Ú__init__z"EmbeddingsWithRawResponse.__init__û   s(   € Ø%ˆÔå&Ô>ØÔñ
ô 
ˆŒˆˆr(   N©rr   r   r    rs   ©rf   rg   rh   ry   ri   r(   r&   r!   r!   ú   ó(   € € € € € ð
ð 
ð 
ð 
ð 
ð 
r(   r!   c                  ó   — e Zd Zdd„ZdS )rk   rr   r   r    rs   c                óP   — || _         t          j        |j        ¦  «        | _        d S ru   )rv   r
   Úasync_to_raw_response_wrapperrc   rx   s     r&   ry   z'AsyncEmbeddingsWithRawResponse.__init__  s(   € Ø%ˆÔå&ÔDØÔñ
ô 
ˆŒˆˆr(   N©rr   r   r    rs   r{   ri   r(   r&   rk   rk     r|   r(   rk   c                  ó   — e Zd Zdd„ZdS )r)   rr   r   r    rs   c                óF   — || _         t          |j        ¦  «        | _        d S ru   )rv   r   rc   rx   s     r&   ry   z(EmbeddingsWithStreamingResponse.__init__  s%   € Ø%ˆÔå2ØÔñ
ô 
ˆŒˆˆr(   Nrz   r{   ri   r(   r&   r)   r)     r|   r(   r)   c                  ó   — e Zd Zdd„ZdS )rm   rr   r   r    rs   c                óF   — || _         t          |j        ¦  «        | _        d S ru   )rv   r   rc   rx   s     r&   ry   z-AsyncEmbeddingsWithStreamingResponse.__init__  s%   € Ø%ˆÔå8ØÔñ
ô 
ˆŒˆˆr(   Nr€   r{   ri   r(   r&   rm   rm     r|   r(   rm   )1Ú
__future__r   rC   Útypingr   r   r   r   Útyping_extensionsr   ÚhttpxÚ r
   Útypesr   Ú_typesr   r   r   r   r   Ú_utilsr   r   Ú_compatr   Ú_extrasr   rO   r   Ú	_resourcer   r   Ú	_responser   r   Ú_base_clientr   Útypes.embedding_modelr   Útypes.create_embedding_responser   Ú__all__r   r   r!   rk   r)   rm   ri   r(   r&   ú<module>r•      ss  ðð #Ð "Ð "Ð "Ð "Ð "à €€€Ø .Ð .Ð .Ð .Ð .Ð .Ð .Ð .Ð .Ð .Ð .Ð .Ø %Ð %Ð %Ð %Ð %Ð %à €€€à Ð Ð Ð Ð Ð Ø +Ð +Ð +Ð +Ð +Ð +Ø >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ø .Ð .Ð .Ð .Ð .Ð .Ð .Ð .Ø %Ð %Ð %Ð %Ð %Ð %Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø XÐ XÐ XÐ XÐ XÐ XÐ XÐ XØ /Ð /Ð /Ð /Ð /Ð /Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø EÐ EÐ EÐ EÐ EÐ EàÐ*Ð
+€ðm
ð m
ð m
ð m
ð m
�ñ m
ô m
ð m
ð`m
ð m
ð m
ð m
ð m
Ð&ñ m
ô m
ð m
ð`
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð
ð 
ð 
ð 
ð 
ñ 
ô 
ð 
ð 
ð 
r(   