pinecone

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Config
	Resty *resty.Client
}

func NewClient added in v0.0.3

func NewClient(config Config) *Client

func (*Client) BaseURL

func (c *Client) BaseURL() string

func (*Client) Delete

func (c *Client) Delete(request *DeleteRequest) (*DeleteResponse, error)

func (*Client) DescribeIndexStats

func (c *Client) DescribeIndexStats(request *DescribeIndexStatsRequest) (*DescribeIndexStatsResponse, error)

func (*Client) Fetch

func (c *Client) Fetch(request *FetchRequest) (*FetchResponse, error)

func (*Client) GetHeaders

func (c *Client) GetHeaders() map[string]string

func (*Client) Query

func (c *Client) Query(request *QueryRequest) (*QueryResponse, error)

func (*Client) Update

func (c *Client) Update(request *UpdateRequest) (*UpdateResponse, error)

func (*Client) Upsert

func (c *Client) Upsert(request *UpsertRequest) (*UpsertResponse, error)

type Config added in v0.0.7

type Config struct {
	Index       string `json:"index,omitempty"`
	Environment string `json:"environment,omitempty"`
	APIKey      string `json:"apiKey,omitempty"`
	Debug       bool   `json:"debug,omitempty"`
}

type DeleteRequest

type DeleteRequest struct {
	IDs       []string                `json:"ids,omitempty"`
	Namespace *string                 `json:"namespace,omitempty"`
	DeleteAll *bool                   `json:"deleteAll,omitempty"`
	Filter    *map[string]interface{} `json:"filter,omitempty"`
}

type DeleteResponse

type DeleteResponse struct {
	Result map[string]interface{}
}

type DescribeIndexStatsRequest

type DescribeIndexStatsRequest struct {
	Filter *map[string]interface{} `json:"filter,omitempty"`
}

type DescribeIndexStatsResponse

type DescribeIndexStatsResponse struct {
	Namespace        *map[string]string `json:"namespace,omitempty"`
	Dimension        *int64             `json:"dimension,omitempty"`
	IndexFullness    *float32           `json:"indexFullness,omitempty"`
	TotalVectorCount *int64             `json:"totalVectorCount,omitempty"`
}

type Detail added in v0.0.3

type Detail struct {
	TypeUrl string `json:"typeUrl,omitempty"`
	Value   string `json:"value,omitempty"`
}

type ErrorResponse added in v0.0.3

type ErrorResponse struct {
	Code    int32    `json:"code,omitempty"`
	Message string   `json:"message,omitempty"`
	Details []Detail `json:"details,omitempty"`
}

type FetchRequest

type FetchRequest struct {
	IDs       []string `json:"ids,omitempty"`
	Namespace *string  `json:"namespace,omitempty"`
}

type FetchResponse

type FetchResponse struct {
	Vectors   map[string]Vector `json:"vectors,omitempty"`
	Namespace *string           `json:"namespace,omitempty"`
}

type QueryRequest

type QueryRequest struct {
	Namespace       *string                 `json:"namespace,omitempty"`
	Filter          *map[string]interface{} `json:"filter,omitempty"`
	TopK            int64                   `json:"topK,omitempty"`
	IncludeValues   *bool                   `json:"includeValues,omitempty"`
	IncludeMetadata *bool                   `json:"includeMetadata,omitempty"`
	Vector          *[]float32              `json:"vector,omitempty"`
	SparseVector    *[]SparseVector         `json:"sparseVector,omitempty"`
	ID              *string                 `json:"id,omitempty"`
}

type QueryResponse

type QueryResponse struct {
	Matches   []Vector `json:"matches,omitempty"`
	Namespace *string  `json:"namespace,omitempty"`
}

type SparseVector

type SparseVector struct {
	Indices []int64   `json:"indices,omitempty"`
	Values  []float32 `json:"values,omitempty"`
}

type UpdateRequest

type UpdateRequest struct {
	ID           string                  `json:"id,omitempty"`
	Score        *float32                `json:"score,omitempty"`
	Values       *[]float32              `json:"values,omitempty"`
	SparseValues *[]SparseVector         `json:"sparseValues,omitempty"`
	SetMetadata  *map[string]interface{} `json:"setMetadata,omitempty"`
	Namespace    *string                 `json:"namespace,omitempty"`
}

type UpdateResponse

type UpdateResponse struct {
	Result *map[string]interface{}
}

type UpsertRequest

type UpsertRequest struct {
	Namespace *string  `json:"namespace,omitempty"`
	Vectors   []Vector `json:"vectors,omitempty"`
}

type UpsertResponse

type UpsertResponse struct {
	UpsertedCount int64 `json:"upsertedCount,omitempty"`
}

type Vector

type Vector struct {
	ID           string                  `json:"id,omitempty"`
	Score        *float32                `json:"score,omitempty"`
	Values       *[]float32              `json:"values,omitempty"`
	SparseValues *[]SparseVector         `json:"sparseValues,omitempty"`
	Metadata     *map[string]interface{} `json:"metadata,omitempty"`
}

Jump to

Keyboard shortcuts

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