pinecone-io / pinecone-python-client

The Pinecone Python client
https://www.pinecone.io/docs
Apache License 2.0
284 stars 78 forks source link

Add inference plugin and tests #370

Closed jhamon closed 1 month ago

jhamon commented 1 month ago

Problem

We want to ship inference as part of the core SDK

Solution

Add a dependency on v1.0.2 of the inference plugin, which includes a recent fix to plugin installation for use with the GRPC client.

Usage

The plugin should automatically be installed and available for usage.

from pinecone import Pinecone

pc = Pinecone(api_key='key')

embedding_model = "multilingual-e5-large"
embeddings = pc.inference.embed(
    model=embedding_model,
    inputs=["The quick brown fox jumps over the lazy dog.", "lorem ipsum"],
    parameters={"input_type": "query", "truncate": "END"},
)

Type of Change

Test Plan

See tests passing.