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.1.0rc0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4aa36ba1e2283d548f7a6c2f48e5333d4cd3fc2768c88eaa0222c5c1ed77165 |
|
MD5 | 13eaef652a48ccf507bf50a32dcdd7ff |
|
BLAKE2b-256 | 3d84954adaeabc7fff2bb084891e75e5f4d54dc0c42405dc6c33d00b5ee653d1 |
Close
Hashes for pinecone_plugin_inference-1.1.0rc0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a129a6abbb7839312af0505cbd3e7430d6a0bf0607d109a3d05b6ebcb8f7ca30 |
|
MD5 | 9c77256f64830995b01ee5c5c83786b2 |
|
BLAKE2b-256 | a1414fc6fe1a1f332a08cedab7a9749cc789d6cc74077fb97d520b30c7cc7d5b |