pinecone

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientAPI

type ClientAPI struct {
	RequestBuilder requestbuilder.Builder
	Config         ClientConfig
	LLMClient      openai.OpenAI
	Encoder        encoder.Encode
}

func NewVectorStoreClient

func NewVectorStoreClient(builder requestbuilder.Builder,
	indexURL, pineconeAPIKey, openAIAPIKey string) *ClientAPI

func (*ClientAPI) ConvertToVectorStoreItem

func (p *ClientAPI) ConvertToVectorStoreItem(r model.
	CostAndUsageOutputType) []*model.
	VectorStoreItem

func (*ClientAPI) Upsert

func (p *ClientAPI) Upsert(ctx context.Context,
	data []PineconeStruct) (resp model.UpsertResponse, err error)

type ClientConfig

type ClientConfig struct {
	BaseURL    string
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig(indexUrl, apiKey string) ClientConfig

type Metadata

type Metadata struct {
	PageContent string `json:"page_content"`
	Source      string `json:"source"`
	Dimensions  string `json:"service"`
	Year        string `json:"year"`
}

type PineconeDB

type PineconeDB interface {
	ConvertToVectorStoreItem(r model.CostAndUsageOutputType) []*model.
		VectorStoreItem
	Upsert(ctx context.Context, data []PineconeStruct) error
}

type PineconeStruct

type PineconeStruct struct {
	ID       string    `json:"id"`
	Values   []float32 `json:"values"`
	Metadata Metadata  `json:"metadata"`
}

type UpsertVectorsRequest

type UpsertVectorsRequest struct {
	Message []PineconeStruct `json:"vectors"`
}

Jump to

Keyboard shortcuts

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