Ë
    µŒjV  ã                   óL   — d dl mZmZmZ d dlmZ d dlmZmZ  G d„ dee«      Z	y)é    )ÚAnyÚDictÚList)Ú
Embeddings)Ú	BaseModelÚmodel_validatorc                   ó¤   — e Zd ZU dZeed<   dZeed<    ed¬«      e	de
defd	„«       «       Zd
eddfd„Zdee   deee      fd„Zdedee   fd„Zy)ÚAwaEmbeddingszÍEmbedding documents and queries with Awa DB.

    Attributes:
        client: The AwaEmbedding client.
        model: The name of the model used for embedding.
         Default is "all-mpnet-base-v2".
    Úclientzall-mpnet-base-v2ÚmodelÚbefore)ÚmodeÚvaluesÚreturnc                 ób   — 	 ddl m}  |«       |d<   |S # t        $ r}t        d«      |‚d}~ww xY w)z)Validate that awadb library is installed.r   )ÚAwaEmbeddingzJCould not import awadb library. Please install it with `pip install awadb`Nr   )Úawadbr   ÚImportError)Úclsr   r   Úexcs       úl/var/www/html/Fitness-lenito-AI-main/venv/lib/python3.12/site-packages/langchain_community/embeddings/awa.pyÚvalidate_environmentz"AwaEmbeddings.validate_environment   sF   € ð
	Ý*ñ (›>ˆˆxÑØˆøô ò 	Üð=óð ðûð	ús   ‚ ”	.�)©.Ú
model_nameNc                 ó4   — || _         || j                  _        y)z²Set the model used for embedding.
        The default model used is all-mpnet-base-v2

        Args:
            model_name: A string which represents the name of model.
        N)r   r   r   )Úselfr   s     r   Ú	set_modelzAwaEmbeddings.set_model"   s   € ð  ˆŒ
Ø!+ˆ�‰Õó    Útextsc                 ó8   — | j                   j                  |«      S )zÃEmbed a list of documents using AwaEmbedding.

        Args:
            texts: The list of texts need to be embedded

        Returns:
            List of embeddings, one for each text.
        )r   ÚEmbeddingBatch)r   r   s     r   Úembed_documentszAwaEmbeddings.embed_documents,   s   € ð �{‰{×)Ñ)¨%Ó0Ð0r   Útextc                 ó8   — | j                   j                  |«      S )z Compute query embeddings using AwaEmbedding.

        Args:
            text: The text to embed.

        Returns:
            Embeddings for the text.
        )r   Ú	Embedding)r   r"   s     r   Úembed_queryzAwaEmbeddings.embed_query7   s   € ð �{‰{×$Ñ$ TÓ*Ð*r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__r   Ústrr   Úclassmethodr   r   r   r   Úfloatr!   r%   © r   r   r
   r
      s�   … ñð ƒKØ$€Eˆ3Ó$á˜(Ô#Øð¨$ð °3ò ó ó $ðð, Cð ,¨Dó ,ð	1 T¨#¡Yð 	1°4¸¸U¹Ñ3Dó 	1ð	+ ð 	+¨¨U©ô 	+r   r
   N)
Útypingr   r   r   Úlangchain_core.embeddingsr   Úpydanticr   r   r
   r.   r   r   Ú<module>r2      s   ðß "Ñ "å 0ß /ô9+�I˜zõ 9+r   