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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f4e4d28540789ce944d1fa730a7d39ff8c1e7436f7104296a26f205f8569428 |
|
MD5 | e11c3acf4d7420d26181f2377e343e6a |
|
BLAKE2b-256 | 62afbccfa19bdb94f3cffc4b7d4fd03cf27ff5d6c3e70a370adf92045c91f776 |
Close
Hashes for pinecone_plugin_inference-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c4784c9783bbc103c06983d4e9351307766521696dd438a12b43c421ba674eb |
|
MD5 | bd57472ae91f780f77ad04e31e8e43ec |
|
BLAKE2b-256 | e918311848e67f42cfa8c6ccb7ea778071f74e0e206b5413bcdb1791bef6e52c |