Ë
    F·j‡-  ã                  ól  — 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«      Z0y)é    )Ú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                  óp   — e Zd Zedd„«       Zedd„«       Zeeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zy)	r   c                ó   — 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
        )ÚEmbeddingsWithRawResponse©Úselfs    úi/var/www/html/ai-video-generator/backend/venv/lib/python3.12/site-packages/openai/resources/embeddings.pyÚwith_raw_responsezEmbeddings.with_raw_response   s   € ô )¨Ó.Ð.ó    c                ó   — 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
        )ÚEmbeddingsWithStreamingResponser#   s    r%   Úwith_streaming_responsez"Embeddings.with_streaming_response%   s   € ô /¨tÓ4Ð4r'   N©Ú
dimensionsÚencoding_formatÚuserÚextra_headersÚextra_queryÚ
extra_bodyÚtimeoutc       	        óÒ   ‡— ||||‰dœ}
t        ‰«      st        «       rd|
d<   dˆfd„}| j                  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
        ©ÚinputÚmodelr/   r-   r.   Úbase64r.   c                ó  •— t        ‰«      r| S | j                  D ]j  }t        t        |j                  «      }t        |t        «      sŒ.t        j                  t        j                  |«      d¬«      j                  «       |_        Œl | S ©NÚfloat32)Údtype©r   Údatar   ÚobjectÚ	embeddingÚ
isinstanceÚstrÚnpÚ
frombufferr9   Ú	b64decodeÚtolist©ÚobjrA   r?   r.   s      €r%   Úparserz!Embeddings.create.<locals>.parserk   ót   ø€ Ü˜Ô(à�
à ŸX™Xò �	ÜœF I×$7Ñ$7Ó8�Ü! $¬Ô,àä&(§m¡mÜ×$Ñ$ TÓ*°)ô'ç‘&“(ð Õ#ðð ˆJr'   ú/embeddings©r0   r1   r2   r3   Úpost_parser©ÚbodyÚoptionsÚcast_to©rI   r   Úreturnr   ©r   r   Ú_postr   r   ÚEmbeddingCreateParamsr   r   ©r$   r7   r8   r-   r.   r/   r0   r1   r2   r3   ÚparamsrJ   s       `       r%   ÚcreatezEmbeddings.create.   s‚   ø€ ðh ØØØ$Ø.ñ
ˆô ˜Ô(¬Y¬[Ø(0ˆFÐ$Ñ%õ	ð" �z‰zØÜ  Ô)@×)VÑ)VÓWÜ(Ø+Ø'Ø%ØØ"ôô ,ð ó 
ð 	
r'   )rT   r"   )rT   r*   ©r7   z=Union[str, List[str], Iterable[int], Iterable[Iterable[int]]]r8   zUnion[str, EmbeddingModel]r-   zint | NotGivenr.   z%Literal['float', 'base64'] | NotGivenr/   zstr | NotGivenr0   zHeaders | Noner1   zQuery | Noner2   zBody | Noner3   z'float | httpx.Timeout | None | NotGivenrT   r   ©Ú__name__Ú
__module__Ú__qualname__r   r&   r+   r   rZ   © r'   r%   r   r      s¶   „ Øò/ó ð/ð ò5ó ð5ð &/ØAJØ(ð )-Ø$(Ø"&Ø;DñY
ð MðY
ð *ð	Y
ð
 #ðY
ð ?ðY
ð ðY
ð &ðY
ð "ðY
ð  ðY
ð 9ðY
ð 
!ôY
r'   c                  óp   — e Zd Zedd„«       Zedd„«       Zeeedddedœ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zy)	r   c                ó   — t        | «      S r!   )ÚAsyncEmbeddingsWithRawResponser#   s    r%   r&   z!AsyncEmbeddings.with_raw_response‹   s   € ô .¨dÓ3Ð3r'   c                ó   — t        | «      S r)   )Ú$AsyncEmbeddingsWithStreamingResponser#   s    r%   r+   z'AsyncEmbeddings.with_streaming_response•   s   € ô 4°DÓ9Ð9r'   Nr,   c       	      ƒ  óî   ‡K  — ||||‰dœ}
t        ‰«      st        «       rd|
d<   d	ˆfd„}| j                  dt        |
t        j
                  «      t        ||||	|¬«      t        ¬«      ƒ d{  –—† S 7 Œ­w)
r5   r6   r9   r.   c                ó  •— t        ‰«      r| S | j                  D ]j  }t        t        |j                  «      }t        |t        «      sŒ.t        j                  t        j                  |«      d¬«      j                  «       |_        Œl | S r;   r>   rH   s      €r%   rJ   z&AsyncEmbeddings.create.<locals>.parserÛ   rK   r'   rL   rM   rO   NrS   rU   rX   s       `       r%   rZ   zAsyncEmbeddings.createž   s�   øè ø€ ðh ØØØ$Ø.ñ
ˆô ˜Ô(¬Y¬[Ø(0ˆFÐ$Ñ%õ	ð" —Z‘ZØÜ  Ô)@×)VÑ)VÓWÜ(Ø+Ø'Ø%ØØ"ôô ,ð  ó 
÷ 
ð 	
ð 
ús   ƒA+A5Á.A3Á/A5)rT   rc   )rT   re   r[   r\   r`   r'   r%   r   r   Š   s¶   „ Øò4ó ð4ð ò:ó ð:ð &/ØAJØ(ð )-Ø$(Ø"&Ø;DñY
ð MðY
ð *ð	Y
ð
 #ðY
ð ?ðY
ð ðY
ð &ðY
ð "ðY
ð  ðY
ð 9ðY
ð 
!ôY
r'   c                  ó   — e Zd Zdd„Zy)r"   c                óZ   — || _         t        j                  |j                  «      | _        y ©N)Ú_embeddingsr
   Úto_raw_response_wrapperrZ   ©r$   Ú
embeddingss     r%   Ú__init__z"EmbeddingsWithRawResponse.__init__û   s%   € Ø%ˆÔä&×>Ñ>Ø×Ñó
ˆ�r'   N©rn   r   rT   ÚNone©r]   r^   r_   ro   r`   r'   r%   r"   r"   ú   ó   „ ô
r'   r"   c                  ó   — e Zd Zdd„Zy)rc   c                óZ   — || _         t        j                  |j                  «      | _        y rj   )rk   r
   Úasync_to_raw_response_wrapperrZ   rm   s     r%   ro   z'AsyncEmbeddingsWithRawResponse.__init__  s%   € Ø%ˆÔä&×DÑDØ×Ñó
ˆ�r'   N©rn   r   rT   rq   rr   r`   r'   r%   rc   rc     rs   r'   rc   c                  ó   — e Zd Zdd„Zy)r*   c                óF   — || _         t        |j                  «      | _        y rj   )rk   r   rZ   rm   s     r%   ro   z(EmbeddingsWithStreamingResponse.__init__  s   € Ø%ˆÔä2Ø×Ñó
ˆ�r'   Nrp   rr   r`   r'   r%   r*   r*     rs   r'   r*   c                  ó   — e Zd Zdd„Zy)re   c                óF   — || _         t        |j                  «      | _        y rj   )rk   r   rZ   rm   s     r%   ro   z-AsyncEmbeddingsWithStreamingResponse.__init__  s   € Ø%ˆÔä8Ø×Ñó
ˆ�r'   Nrw   rr   r`   r'   r%   re   re     rs   r'   re   )1Ú
__future__r   r9   Útypingr   r   r   r   Útyping_extensionsr   ÚhttpxÚ r
   Útypesr   Ú_typesr   r   r   r   r   Ú_utilsr   r   Ú_compatr   Ú_extrasr   rD   r   Ú	_resourcer   r   Ú	_responser   r   Ú_base_clientr   Útypes.embedding_modelr   Útypes.create_embedding_responser   Ú__all__r   r   r"   rc   r*   re   r`   r'   r%   ú<module>rŒ      s�   ðõ #ã ß .Ó .Ý %ã å Ý +ß >Õ >ß .Ý %ß ,ß 9ß XÝ /Ý 2Ý EàÐ*Ð
+€ôm
�ô m
ô`m
Ð&ô m
÷`
ñ 
÷
ñ 
÷
ñ 
÷
ò 
r'   