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 if the input data cannot be parsed to form a valid model.

param jina_api_key: SecretStr | None = None#
Constraints:
  • type = string

  • writeOnly = True

  • format = password

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