pinecone

package
v0.6.0-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(logger *zap.Logger) base.IConnector

Types

type Client

type Client struct {
	APIKey     string
	HTTPClient HTTPClient
}

func NewClient

func NewClient(apiKey string) Client

NewClient initializes a new Stability AI client

type Connector

type Connector struct {
	base.Connector
}

func (*Connector) CreateExecution

func (c *Connector) CreateExecution(defUID uuid.UUID, task string, config *structpb.Struct, logger *zap.Logger) (base.IExecution, error)

func (*Connector) Test

func (c *Connector) Test(defUid uuid.UUID, config *structpb.Struct, logger *zap.Logger) (connectorPB.ConnectorResource_State, error)

type Execution

type Execution struct {
	base.Execution
}

func (*Execution) Execute

func (e *Execution) Execute(inputs []*structpb.Struct) ([]*structpb.Struct, error)

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type Match

type Match struct {
	ID       string      `json:"id"`
	Score    float64     `json:"score"`
	Values   []float64   `json:"values"`
	Metadata interface{} `json:"metadata"`
}

type QueryInput

type QueryInput struct {
	Namespace       string    `json:"namespace"`
	TopK            int64     `json:"top_k"`
	Vector          []float64 `json:"vector"`
	IncludeValues   bool      `json:"include_values"`
	IncludeMetadata bool      `json:"include_metadata"`
	ID              string    `json:"id"`
}

type QueryReq

type QueryReq struct {
	Namespace       string    `json:"namespace"`
	TopK            int64     `json:"topK"`
	Vector          []float64 `json:"vector"`
	IncludeValues   bool      `json:"includeValues"`
	IncludeMetadata bool      `json:"includeMetadata"`
	ID              string    `json:"id"`
}

type QueryResp

type QueryResp struct {
	Namespace string  `json:"namespace"`
	Matches   []Match `json:"matches"`
}

type UpsertOutput

type UpsertOutput struct {
	RecordsUpserted int64 `json:"upserted_count"`
}

type UpsertReq

type UpsertReq struct {
	Vectors []Vector `json:"vectors"`
}

type UpsertResp

type UpsertResp struct {
	RecordsUpserted int64 `json:"upsertedCount"`
}

type Vector

type Vector struct {
	ID     string    `json:"id"`
	Values []float64 `json:"values"`
}

Jump to

Keyboard shortcuts

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