PineconeSparseEmbeddings#

class langchain_pinecone.embeddings.PineconeSparseEmbeddings[source]#

Bases: PineconeEmbeddings

PineconeSparseEmbeddings embedding model.

Example

from langchain_pinecone import PineconeSparseEmbeddings

model = PineconeSparseEmbeddings(model="pinecone-sparse-english-v0")

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 batch_size: int | None = None#

Batch size for embedding documents.

param dimension: int | None = None#
param document_params: Dict [Optional]#

Parameters for embedding document

param model: str [Required]#

Model to use for example ‘multilingual-e5-large’.

param pinecone_api_key: SecretStr [Optional] (alias 'api_key')#

Pinecone API key.

If not provided, will look for the PINECONE_API_KEY environment variable.

param query_params: Dict [Optional]#

Parameters for embedding query.

param show_progress_bar: bool = False#
async aembed_documents(texts: List[str]) List[SparseValues][source]#

Asynchronously embed search docs with sparse embeddings.

Parameters:

texts (List[str])

Return type:

List[SparseValues]

async aembed_query(text: str) SparseValues[source]#

Asynchronously embed query text with sparse embeddings.

Parameters:

text (str)

Return type:

SparseValues

embed_documents(texts: List[str]) List[SparseValues][source]#

Embed search docs with sparse embeddings.

Parameters:

texts (List[str])

Return type:

List[SparseValues]

embed_query(text: str) SparseValues[source]#

Embed query text with sparse embeddings.

Parameters:

text (str)

Return type:

SparseValues

property async_client: PineconeAsyncio#

Lazily initialize the async client.