create_index#

langchain_community.retrievers.pinecone_hybrid_search.create_index(
contexts: List[str],
index: Any,
embeddings: Embeddings,
sparse_encoder: Any,
ids: List[str] | None = None,
metadatas: List[dict] | None = None,
namespace: str | None = None,
text_key: str = 'context',
) None[source]#

Create an index from a list of contexts.

It modifies the index argument in-place!

Parameters:
  • contexts (List[str]) – List of contexts to embed.

  • index (Any) – Index to use.

  • embeddings (Embeddings) – Embeddings model to use.

  • sparse_encoder (Any) – Sparse encoder to use.

  • ids (List[str] | None) – List of ids to use for the documents.

  • metadatas (List[dict] | None) – List of metadata to use for the documents.

  • namespace (str | None) – Namespace value for index partition.

  • text_key (str)

Return type:

None