Skip to main content

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

pinecone_plugin_inference-2.0.0.tar.gz (48.4 kB view details)

Uploaded Source

Built Distribution

pinecone_plugin_inference-2.0.0-py3-none-any.whl (84.5 kB view details)

Uploaded Python 3

File details

Details for the file pinecone_plugin_inference-2.0.0.tar.gz.

File metadata

  • Download URL: pinecone_plugin_inference-2.0.0.tar.gz
  • Upload date:
  • Size: 48.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.7 Linux/6.5.0-1025-azure

File hashes

Hashes for pinecone_plugin_inference-2.0.0.tar.gz
Algorithm Hash digest
SHA256 b29709cd5d82829f8d0361a3f5b51dab622da59533578097be04e73eeecf3ee5
MD5 64f1c4b4dad2f3fa0a289a3603030d03
BLAKE2b-256 5bbe61d0cc40608d0bc1d42e1cddbcbbde61216f2a8a4c24d337c87451a9dc96

See more details on using hashes here.

File details

Details for the file pinecone_plugin_inference-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pinecone_plugin_inference-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 260368b5584b12196d9031322c115c2329fb6c948a43952e3534061382f0d522
MD5 d80707e8342dc43b8868ff54725c205d
BLAKE2b-256 053c02c74b130aeaa121d58f9f6366226e373f9ebe3dc52ad3af3142ef128e92

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page