AwaEmbeddings#

class langchain_community.embeddings.awa.AwaEmbeddings[source]#

Bases: BaseModel, Embeddings

Embedding documents and queries with Awa DB.

client#

The AwaEmbedding client.

model#

The name of the model used for embedding. Default is β€œall-mpnet-base-v2”.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

param model: str = 'all-mpnet-base-v2'#
async aembed_documents(texts: list[str]) β†’ list[list[float]]#

Asynchronous Embed search docs.

Parameters:

texts (list[str]) – List of text to embed.

Returns:

List of embeddings.

Return type:

list[list[float]]

async aembed_query(text: str) β†’ list[float]#

Asynchronous Embed query text.

Parameters:

text (str) – Text to embed.

Returns:

Embedding.

Return type:

list[float]

embed_documents(texts: List[str]) β†’ List[List[float]][source]#

Embed a list of documents using AwaEmbedding.

Parameters:

texts (List[str]) – The list of texts need to be embedded

Returns:

List of embeddings, one for each text.

Return type:

List[List[float]]

embed_query(text: str) β†’ List[float][source]#

Compute query embeddings using AwaEmbedding.

Parameters:

text (str) – The text to embed.

Returns:

Embeddings for the text.

Return type:

List[float]

set_model(model_name: str) β†’ None[source]#

Set the model used for embedding. The default model used is all-mpnet-base-v2

Parameters:

model_name (str) – A string which represents the name of model.

Return type:

None

Examples using AwaEmbeddings