Embeddings plugin for Pinecone SDK
Project description
Inference API plugin for python SDK
Installation
The plugin is distributed separately from the core python sdk.
# Install the base python SDK, version 4.1.1 or higher
pip install pinecone-client
# And also the plugin functionality
pip install pinecone-plugin-inference
Usage
Interact with Pinecone's Inference APIs, e.g. create embeddings (currently in preview).
Models currently supported:
Generate embeddings
The following example highlights how to use an embedding model to generate embeddings for a list of documents and a user query, with the ultimate goal of retrieving similar documents from a Pinecone index.
from pinecone import Pinecone
pc = Pinecone(api_key="<<PINECONE_API_KEY>>")
model = "multilingual-e5-large"
# Embed documents
text = [
"Turkey is a classic meat to eat at American Thanksgiving.",
"Many people enjoy the beautiful mosques in Turkey.",
]
text_embeddings = pc.inference.embed(
model=model,
inputs=text,
parameters={"input_type": "passage", "truncate": "END"},
)
# <<Upsert documents into Pinecone index>>
# Embed query
query = ["How should I prepare my turkey?"]
query_embeddings = pc.inference.embed(
model=model,
inputs=query,
parameters={"input_type": "query", "truncate": "END"},
)
# <<Send query to Pinecone index to retrieve similar documents>>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pinecone_plugin_inference-2.0.1.tar.gz
.
File metadata
- Download URL: pinecone_plugin_inference-2.0.1.tar.gz
- Upload date:
- Size: 48.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5de1319f07b5c26f7506b200c62ca1ea71db2a862d93a5feed10159face667b5 |
|
MD5 | f5e414188ff93dd27ce7fc0e494e6e93 |
|
BLAKE2b-256 | 4c6785231e92790cd3402bf09237bd6e7427e475968943b8d6e0a39e8a8b9ff4 |
File details
Details for the file pinecone_plugin_inference-2.0.1-py3-none-any.whl
.
File metadata
- Download URL: pinecone_plugin_inference-2.0.1-py3-none-any.whl
- Upload date:
- Size: 84.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa9bedc11bf2d6223bc9fb00be6fe73388a83cc3a1e9d1502fd9ac4556feb078 |
|
MD5 | 6eccd05798c8b8bb0c62212e070a67ee |
|
BLAKE2b-256 | 5356cb693e7d9f7caee2ce20a8e6aa0e729057bc1f99a432fd6803db9b087ec0 |