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
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.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a5413446ba2c289f204b97c7bb4fa99f632541755aa4ea18c34ac6e00b4ee83 |
|
MD5 | 570a005ffb3b6b51664feae2130a6551 |
|
BLAKE2b-256 | b458a73dea8af2e7f9484a6f910d8828da77e959494f31f7b21f6e115000d841 |
Close
Hashes for pinecone_plugin_inference-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03fce32c3fb1a43b030efaed135f833125fecb467c6bbc862168708a313a2e0e |
|
MD5 | 74fce45b173fb3ca95769cbc5358135f |
|
BLAKE2b-256 | edcd5cf3ada17933442cb2098e4c33a4724b90e723f1802619259ed87c80abfa |