pinecone: Add embedding Inference Support (#24515)

**Description**

Add support for Pinecone hosted embedding models as
`PineconeEmbeddings`. Replacement for #22890

**Dependencies**
Add `aiohttp` to support async embeddings call against REST directly

- [x] **Add tests and docs**: If you're adding a new integration, please
include

Added `docs/docs/integrations/text_embedding/pinecone.ipynb`


- [x] **Lint and test**: Run `make format`, `make lint` and `make test`
from the root of the package(s) you've modified. See contribution
guidelines for more: https://python.langchain.com/docs/contributing/

Twitter: `gdjdg17`

---------

Co-authored-by: Erick Friis <erick@langchain.dev>
This commit is contained in:
Gareth
2024-07-23 18:50:28 -04:00
committed by GitHub
parent aaf788b7cb
commit ac41c97d21
9 changed files with 947 additions and 71 deletions

View File

@@ -40,13 +40,12 @@ class PineconeVectorStore(VectorStore):
Example:
.. code-block:: python
from langchain_pinecone import PineconeVectorStore
from langchain_openai import OpenAIEmbeddings
from langchain_pinecone import PineconeVectorStore, PineconeEmbeddings
embeddings = OpenAIEmbeddings()
embeddings = PineconeEmbeddings(model="multilingual-e5-large")
index_name = "my-index"
namespace = "my-namespace"
vectorstore = Pinecone(
vectorstore = PineconeVectorStore(
index_name=index_name,
embedding=embedding,
namespace=namespace,
@@ -439,10 +438,10 @@ class PineconeVectorStore(VectorStore):
Example:
.. code-block:: python
from langchain_pinecone import PineconeVectorStore
from langchain_openai import OpenAIEmbeddings
from langchain_pinecone import PineconeVectorStore, PineconeEmbeddings
embeddings = PineconeEmbeddings(model="multilingual-e5-large")
embeddings = OpenAIEmbeddings()
index_name = "my-index"
vectorstore = PineconeVectorStore.from_texts(
texts,