pinecone

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 16 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(in NewClientParams) (*Client, error)

func (*Client) CreateCollection

func (c *Client) CreateCollection(ctx context.Context, in *CreateCollectionRequest) (*Collection, error)

func (*Client) CreatePodIndex

func (c *Client) CreatePodIndex(ctx context.Context, in *CreatePodIndexRequest) (*Index, error)

func (*Client) CreateServerlessIndex

func (c *Client) CreateServerlessIndex(ctx context.Context, in *CreateServerlessIndexRequest) (*Index, error)

func (*Client) DeleteCollection

func (c *Client) DeleteCollection(ctx context.Context, collectionName string) error

func (*Client) DeleteIndex

func (c *Client) DeleteIndex(ctx context.Context, idxName string) error

func (*Client) DescribeCollection

func (c *Client) DescribeCollection(ctx context.Context, collectionName string) (*Collection, error)

func (*Client) DescribeIndex

func (c *Client) DescribeIndex(ctx context.Context, idxName string) (*Index, error)

func (*Client) Index

func (c *Client) Index(host string) (*IndexConnection, error)

func (*Client) IndexWithNamespace

func (c *Client) IndexWithNamespace(host string, namespace string) (*IndexConnection, error)

func (*Client) ListCollections

func (c *Client) ListCollections(ctx context.Context) ([]*Collection, error)

func (*Client) ListIndexes

func (c *Client) ListIndexes(ctx context.Context) ([]*Index, error)

type Cloud

type Cloud string
const (
	Aws   Cloud = "aws"
	Azure Cloud = "azure"
	Gcp   Cloud = "gcp"
)

type Collection

type Collection struct {
	Name        string
	Size        *int64
	Status      CollectionStatus
	Dimension   *int32
	VectorCount *int32
	Environment string
}

type CollectionStatus

type CollectionStatus string
const (
	CollectionStatusInitializing CollectionStatus = "Initializing"
	CollectionStatusReady        CollectionStatus = "Ready"
	CollectionStatusTerminating  CollectionStatus = "Terminating"
)

type CreateCollectionRequest

type CreateCollectionRequest struct {
	Name   string
	Source string
}

type CreatePodIndexRequest

type CreatePodIndexRequest struct {
	Name             string
	Dimension        int32
	Metric           IndexMetric
	Environment      string
	PodType          string
	Shards           int32
	Replicas         int32
	SourceCollection *string
	MetadataConfig   *PodSpecMetadataConfig
}

func (CreatePodIndexRequest) ReplicaCount

func (req CreatePodIndexRequest) ReplicaCount() *int32

func (CreatePodIndexRequest) ShardCount

func (req CreatePodIndexRequest) ShardCount() *int32

func (CreatePodIndexRequest) TotalCount

func (req CreatePodIndexRequest) TotalCount() *int

type CreateServerlessIndexRequest

type CreateServerlessIndexRequest struct {
	Name      string
	Dimension int32
	Metric    IndexMetric
	Cloud     Cloud
	Region    string
}

type DescribeIndexStatsResponse

type DescribeIndexStatsResponse struct {
	Dimension        uint32
	IndexFullness    float32
	TotalVectorCount uint32
	Namespaces       map[string]*NamespaceSummary
}

type FetchVectorsResponse

type FetchVectorsResponse struct {
	Vectors map[string]*Vector
	Usage   *Usage
}

type Filter

type Filter = structpb.Struct

type Index

type Index struct {
	Name      string
	Dimension int32
	Host      string
	Metric    IndexMetric
	Spec      *IndexSpec
	Status    *IndexStatus
}

type IndexConnection

type IndexConnection struct {
	Namespace string
	// contains filtered or unexported fields
}

func (*IndexConnection) Close

func (idx *IndexConnection) Close() error

func (*IndexConnection) DeleteAllVectorsInNamespace

func (idx *IndexConnection) DeleteAllVectorsInNamespace(ctx *context.Context) error

func (*IndexConnection) DeleteVectorsByFilter

func (idx *IndexConnection) DeleteVectorsByFilter(ctx *context.Context, filter *Filter) error

func (*IndexConnection) DeleteVectorsById

func (idx *IndexConnection) DeleteVectorsById(ctx *context.Context, ids []string) error

func (*IndexConnection) DescribeIndexStats

func (idx *IndexConnection) DescribeIndexStats(ctx *context.Context) (*DescribeIndexStatsResponse, error)

func (*IndexConnection) DescribeIndexStatsFiltered

func (idx *IndexConnection) DescribeIndexStatsFiltered(ctx *context.Context, filter *Filter) (*DescribeIndexStatsResponse, error)

func (*IndexConnection) FetchVectors

func (idx *IndexConnection) FetchVectors(ctx *context.Context, ids []string) (*FetchVectorsResponse, error)

func (*IndexConnection) ListVectors

func (*IndexConnection) QueryByVectorId

func (*IndexConnection) QueryByVectorValues

func (idx *IndexConnection) QueryByVectorValues(ctx *context.Context, in *QueryByVectorValuesRequest) (*QueryVectorsResponse, error)

func (*IndexConnection) UpdateVector

func (idx *IndexConnection) UpdateVector(ctx *context.Context, in *UpdateVectorRequest) error

func (*IndexConnection) UpsertVectors

func (idx *IndexConnection) UpsertVectors(ctx *context.Context, in []*Vector) (uint32, error)

type IndexMetric

type IndexMetric string
const (
	Cosine     IndexMetric = "cosine"
	Dotproduct IndexMetric = "dotproduct"
	Euclidean  IndexMetric = "euclidean"
)

type IndexSpec

type IndexSpec struct {
	Pod        *PodSpec
	Serverless *ServerlessSpec
}

type IndexStatus

type IndexStatus struct {
	Ready bool
	State IndexStatusState
}

type IndexStatusState

type IndexStatusState string
const (
	InitializationFailed IndexStatusState = "InitializationFailed"
	Initializing         IndexStatusState = "Initializing"
	Ready                IndexStatusState = "Ready"
	ScalingDown          IndexStatusState = "ScalingDown"
	ScalingDownPodSize   IndexStatusState = "ScalingDownPodSize"
	ScalingUp            IndexStatusState = "ScalingUp"
	ScalingUpPodSize     IndexStatusState = "ScalingUpPodSize"
	Terminating          IndexStatusState = "Terminating"
)

type ListVectorsRequest

type ListVectorsRequest struct {
	Prefix          *string
	Limit           *uint32
	PaginationToken *string
}

type ListVectorsResponse

type ListVectorsResponse struct {
	VectorIds           []*string
	Usage               *Usage
	NextPaginationToken *string
}

type Metadata

type Metadata = structpb.Struct

type NamespaceSummary

type NamespaceSummary struct {
	VectorCount uint32
}

type NewClientParams

type NewClientParams struct {
	ApiKey    string
	SourceTag string // optional
}

type PodSpec

type PodSpec struct {
	Environment      string
	PodType          string
	PodCount         int32
	Replicas         int32
	ShardCount       int32
	SourceCollection *string
	MetadataConfig   *PodSpecMetadataConfig
}

type PodSpecMetadataConfig

type PodSpecMetadataConfig struct {
	Indexed *[]string
}

type QueryByVectorIdRequest

type QueryByVectorIdRequest struct {
	VectorId        string
	TopK            uint32
	Filter          *Filter
	IncludeValues   bool
	IncludeMetadata bool
	SparseValues    *SparseValues
}

type QueryByVectorValuesRequest

type QueryByVectorValuesRequest struct {
	Vector          []float32
	TopK            uint32
	Filter          *Filter
	IncludeValues   bool
	IncludeMetadata bool
	SparseValues    *SparseValues
}

type QueryVectorsResponse

type QueryVectorsResponse struct {
	Matches []*ScoredVector
	Usage   *Usage
}

type ScoredVector

type ScoredVector struct {
	Vector *Vector
	Score  float32
}

type ServerlessSpec

type ServerlessSpec struct {
	Cloud  Cloud
	Region string
}

type SparseValues

type SparseValues struct {
	Indices []uint32
	Values  []float32
}

type UpdateVectorRequest

type UpdateVectorRequest struct {
	Id           string
	Values       []float32
	SparseValues *SparseValues
	Metadata     *Metadata
}

type Usage

type Usage struct {
	ReadUnits *uint32
}

type Vector

type Vector struct {
	Id           string
	Values       []float32
	SparseValues *SparseValues
	Metadata     *Metadata
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL