JinaEmbeddings#

class langchain_community.embeddings.jina.JinaEmbeddings[source]#

Bases: BaseModel, Embeddings

Jina embedding models.

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 jina_api_key: SecretStr | None = None#
param model_name: str = 'jina-embeddings-v2-base-en'#
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]#

Call out to Jina’s embedding endpoint. :param texts: The list of texts to embed.

Returns:

List of embeddings, one for each text.

Parameters:

texts (List[str])

Return type:

List[List[float]]

embed_images(uris: List[str]) β†’ List[List[float]][source]#

Call out to Jina’s image embedding endpoint. :param uris: The list of uris to embed.

Returns:

List of embeddings, one for each text.

Parameters:

uris (List[str])

Return type:

List[List[float]]

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

Call out to Jina’s embedding endpoint. :param text: The text to embed.

Returns:

Embeddings for the text.

Parameters:

text (str)

Return type:

List[float]

Examples using JinaEmbeddings