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-3.1.0.tar.gz (49.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pinecone_plugin_inference-3.1.0-py3-none-any.whl (87.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pinecone_plugin_inference-3.1.0.tar.gz
  • Upload date:
  • Size: 49.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.12.7 Linux/6.8.0-1017-azure

File hashes

Hashes for pinecone_plugin_inference-3.1.0.tar.gz
Algorithm Hash digest
SHA256 eff826178e1fe448577be2ff3d8dbb072befbbdc2d888e214624523a1c37cd8d
MD5 df917a8edd8bf5858898d4b0604dcac8
BLAKE2b-256 3a8209f6fb3c9d3b005c5b110d323a98f848f57babb1394ebea9f72e26f68242

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pinecone_plugin_inference-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96e861527bd41e90d58b7e76abd4e713d9af28f63e76a51864dfb9cf7180e3df
MD5 3bb61b5a006b0f8d9b6c78c82655c5f7
BLAKE2b-256 89454ae4e38439919584c2d34b6bef5d0ef8d068030871dd4da911d174840ee6

See more details on using hashes here.

Supported by

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