
    D_ie	                     :    S r SSKJrJr  SSKJr   " S S\5      rg)z**Embeddings** interface.    )ABCabstractmethod)run_in_executorc                       \ rS rSrSr\S\\   S\\\      4S j5       r	\S\S\\   4S j5       r
S\\   S\\\      4S jrS\S\\   4S	 jrS
rg)
Embeddings   at  Interface for embedding models.

This is an interface meant for implementing text embedding models.

Text embedding models are used to map text to a vector (a point in n-dimensional
space).

Texts that are similar will usually be mapped to points that are close to each
other in this space. The exact details of what's considered "similar" and how
"distance" is measured in this space are dependent on the specific embedding model.

This abstraction contains a method for embedding a list of documents and a method
for embedding a query text. The embedding of a query text is expected to be a single
vector, while the embedding of a list of documents is expected to be a list of
vectors.

Usually the query embedding is identical to the document embedding, but the
abstraction allows treating them independently.

In addition to the synchronous methods, this interface also provides asynchronous
versions of the methods.

By default, the asynchronous methods are implemented using the synchronous methods;
however, implementations may choose to override the asynchronous methods with
an async native implementation for performance reasons.
textsreturnc                     g)z^Embed search docs.

Args:
    texts: List of text to embed.

Returns:
    List of embeddings.
N selfr	   s     ^/home/james-whalen/.local/lib/python3.13/site-packages/langchain_core/embeddings/embeddings.pyembed_documentsEmbeddings.embed_documents$           textc                     g)zKEmbed query text.

Args:
    text: Text to embed.

Returns:
    Embedding.
Nr   r   r   s     r   embed_queryEmbeddings.embed_query/   r   r   c                 L   #    [        SU R                  U5      I Sh  vN $  N7f)zkAsynchronous Embed search docs.

Args:
    texts: List of text to embed.

Returns:
    List of embeddings.
N)r   r   r   s     r   aembed_documentsEmbeddings.aembed_documents:   s"      %T4+?+?GGGG   $"$c                 L   #    [        SU R                  U5      I Sh  vN $  N7f)zXAsynchronous Embed query text.

Args:
    text: Text to embed.

Returns:
    Embedding.
N)r   r   r   s     r   aembed_queryEmbeddings.aembed_queryE   s"      %T4+;+;TBBBBr   r   N)__name__
__module____qualname____firstlineno____doc__r   liststrfloatr   r   r   r   __static_attributes__r   r   r   r   r      s    6 T#Y 4U3D    U  	HDI 	H$tE{:K 	H	Cs 	CtE{ 	Cr   r   N)r$   abcr   r   langchain_core.runnables.configr   r   r   r   r   <module>r+      s     # ;FC FCr   