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
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
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
Close
Hashes for pinecone_plugin_inference-0.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71bf8dfc926223241c16f7c860e803c741cfa5097ee379e225f8eada1a4e8f59 |
|
MD5 | a1b7218faa8df7ab876e69ac2df84570 |
|
BLAKE2b-256 | f8c08bbcf362b44c8be3f165296092af4272e3180203f7aa67f5bc731c850fb0 |
Close
Hashes for pinecone_plugin_inference-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 391db5edb077e99ac149a0609f7fdd5c0b03ed206612ed2f29ee5ca5fafd0590 |
|
MD5 | 71e5399143ee1cd92ece274afa668595 |
|
BLAKE2b-256 | 48211d6a2c228300d9f5b707e9caed8034e245b625f79a70e46ad1dee631a783 |