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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6519ba730123713a181c010f0db9d6449d11de451b8e79bec4efd662b096f41 |
|
MD5 | 058c38dea58fd4325de6a8c85d1f84eb |
|
BLAKE2b-256 | fe407b2a88e68ede294dc293c6196a71f3d6583d403320a2008153b095cd3e39 |
Close
Hashes for pinecone_plugin_inference-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbdfe5dba99a87374d9e3315b62b8e1bbca52d5fe069a64cd6b212efbc8b9afd |
|
MD5 | f6aaf8e9600ae05c16818cfe1efdba9a |
|
BLAKE2b-256 | 0db70d57cad06545ac8fbb7a362dddaff01b0ecfe6e47c135345e94b3d8ab2ca |