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
Close
Hashes for pinecone_plugin_inference-1.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dda62d9ff44dbbf191b11e6e884235f329cf0ec22edc616fe7efcb1e479e6a9a |
|
MD5 | 7ece13efe3fd58830418271bc17996d4 |
|
BLAKE2b-256 | 6f8d9c95add02d78eadbc5517d18a661e9ccb9bdcbc905760d9ecf6c67e8a74c |
Close
Hashes for pinecone_plugin_inference-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef94e7f51554e780408cf1507888b120bb0d185b8485a903cbeb9d0176ee03f1 |
|
MD5 | 90d583141f34611aea7200e382147847 |
|
BLAKE2b-256 | 4db5a2b33c654e673a697e740b97fe6dc89f7432d23beb34b191adefa2cb8520 |