PineconeVectorService

io.cequence.pineconescala.service.PineconeVectorService

Central service to access all Pinecone vector operations/endpoints as defined at the API ref. page

The following services are supported:

  • describeIndexStats
  • query - by vector or by id (queryById)
  • delete - by filter or ids, or delete all
  • fetch
  • update
  • upsert

Attributes

Since:

Apr 2023

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Type members

Inherited classlikes

Attributes

Inherited from:
PineconeServiceConsts
Graph
Supertypes
class Object
trait Matchable
class Any

Value members

Abstract methods

def delete(ids: Seq[String], namespace: String): Future[Unit]

The Delete operation deletes vectors, by id, from a single namespace.

The Delete operation deletes vectors, by id, from a single namespace.

Attributes

ids

Vectors to delete.

namespace

The namespace to delete vectors from, if applicable.

Returns:

N/A

See also:
def delete(filter: Map[String, String], namespace: String): Future[Unit]

The Delete operation deletes vectors, by the metadata filter, from a single namespace.

The Delete operation deletes vectors, by the metadata filter, from a single namespace.

Attributes

filter

The metadata filter here will be used to select the vectors to delete. See https://www.pinecone.io/docs/metadata-filtering/.

See also:
def deleteAll(namespace: String): Future[Unit]

The Delete operation deletes ALL the vectors from a single namespace.

The Delete operation deletes ALL the vectors from a single namespace.

Attributes

See also:

The DescribeIndexStats operation returns statistics about the index's contents, including the vector count per namespace and the number of dimensions.

The DescribeIndexStats operation returns statistics about the index's contents, including the vector count per namespace and the number of dimensions.

Attributes

Returns:

IndexStats

See also:
def fetch(ids: Seq[String], namespace: String): Future[FetchResponse]

The Fetch operation looks up and returns vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata.

The Fetch operation looks up and returns vectors, by ID, from a single namespace. The returned vectors include the vector data and/or metadata.

Attributes

id

The vector IDs to fetch. Does not accept values containing spaces.

See also:
def query(vector: Seq[Double], namespace: String, settings: QuerySettings): Future[QueryResponse]

The Query operation searches a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores.

The Query operation searches a namespace, using a query vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores.

Attributes

namespace

The namespace to query.

vector

The query vector. This should be the same length as the dimension of the index being queried.

Returns:

model or None if not found

See also:
def queryById(id: String, namespace: String, settings: QuerySettings): Future[QueryResponse]

The Query operation searches a namespace, using an unique id of the vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores.

The Query operation searches a namespace, using an unique id of the vector. It retrieves the ids of the most similar items in a namespace, along with their similarity scores.

Attributes

id

The unique ID of the vector to be used as a query vector.

Returns:

QueryResult

See also:
def update(id: String, namespace: String, values: Seq[Double], sparseValues: Option[SparseVector], setMetaData: Map[String, String]): Future[Unit]

The Update operation updates vector in a namespace. If a value is included, it will overwrite the previous value. If a set_metadata is included, the values of the fields specified in it will be added or overwrite the previous value.

The Update operation updates vector in a namespace. If a value is included, it will overwrite the previous value. If a set_metadata is included, the values of the fields specified in it will be added or overwrite the previous value.

Attributes

id

Vector's unique id.

namespace

The namespace containing the vector to update.

setMetaData

Metadata to set for the vector.

sparseValues

Vector sparse data. Represented as a list of indices and a list of corresponded values, which must be the same length.

values

Vector data.

Returns:

N/A

See also:
def upsert(vectors: Seq[PVector], namespace: String): Future[Int]

The Upsert operation writes vectors into a namespace. If a new value is upserted for an existing vector id, it will overwrite the previous value.

The Upsert operation writes vectors into a namespace. If a new value is upserted for an existing vector id, it will overwrite the previous value.

Attributes

namespace

This is the namespace name where you upsert vectors.

vectors

An array containing the vectors to upsert. Recommended batch limit is 100 vectors.

Returns:

The number of vectors upserted.

See also:

Inherited fields

protected val configFileName: String

Attributes

Inherited from:
PineconeServiceConsts
protected val configPrefix: String

Attributes

Inherited from:
PineconeServiceConsts
protected val defaultReadoutTimeout: Int

Attributes

Inherited from:
PineconeServiceConsts
protected val defaultRequestTimeout: Int

Attributes

Inherited from:
PineconeServiceConsts