Skip to main content

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>>

Metadata

Release files for pinecone-plugin-inference 3.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pinecone-plugin-inference 3.1.0
File Size Uploaded
pinecone_plugin_inference-3.1.0.tar.gz 49.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pinecone-plugin-inference 3.1.0
File Interpreter ABI Platform
pinecone_plugin_inference-3.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 136.8 kB

Release files / pinecone_plugin_inference-3.1.0.tar.gz

Download URL pinecone_plugin_inference-3.1.0.tar.gz
Size 49.3 kB
Tags Source
SHA-256 checksum
How to use checksums
eff826178e1fe448577be2ff3d8dbb072befbbdc2d888e214624523a1c37cd8d
BLAKE2b-256 checksum
How to use checksums
3a8209f6fb3c9d3b005c5b110d323a98f848f57babb1394ebea9f72e26f68242
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.12.7 Linux/6.8.0-1017-azure

Release files / pinecone_plugin_inference-3.1.0-py3-none-any.whl

Download URL pinecone_plugin_inference-3.1.0-py3-none-any.whl
Size 87.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96e861527bd41e90d58b7e76abd4e713d9af28f63e76a51864dfb9cf7180e3df
BLAKE2b-256 checksum
How to use checksums
89454ae4e38439919584c2d34b6bef5d0ef8d068030871dd4da911d174840ee6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.5 CPython/3.12.7 Linux/6.8.0-1017-azure
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page