vecstores

package
v0.0.0-...-e795c6b Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateVectorStoreResponse

type CreateVectorStoreResponse struct {
	ID string `json:"id"`
}

CreateVectorStoreResponse is used to unmarshal OpenAI API response in Create function

type File

type File struct {
	FileID string `json:"id"`
}

File is used to unmarshal OpenAI API response in GetFiles function

type GetVectorStoreFilesResponse

type GetVectorStoreFilesResponse struct {
	Files []File `json:"data"`
}

GetVectorStoreFilesResponse is used to unmarshal OpenAI API response in GetFiles function

type VectorStoreClient

type VectorStoreClient interface {
	CreateVectorStore(storeName string) (string, error)
	DeleteVectorStore(storeID string) error
	AddVectorStoreFile(storeID, fileID string) error
	GetVectorStoreFiles(storeID string) (GetVectorStoreFilesResponse, error)
	DeleteVectorStoreFile(storeID, fileID string) error
}

type VectorStores

type VectorStores struct {
	APIKey string
}

VectorStores represents OpenAI API vector store domain

func (VectorStores) AddVectorStoreFile

func (v VectorStores) AddVectorStoreFile(storeID, fileID string) error

AddVectorStoreFile adds a file with `fileID` to the Vector Store object specified by `storeID` from OpenAI platform.

func (VectorStores) CreateVectorStore

func (v VectorStores) CreateVectorStore(storeName string) (string, error)

CreateVectorStore creates a vector store for files that later can be attached to an assistant. It is a new feature of assistants v2 API so I sincerely recommend to jump through this docs: https://platform.openai.com/docs/api-reference/vector-stores/object

func (VectorStores) DeleteVectorStore

func (v VectorStores) DeleteVectorStore(storeID string) error

DeleteVectorStore deletes the Vector Store object specified by `storeID` from OpenAI platform.

func (VectorStores) DeleteVectorStoreFile

func (v VectorStores) DeleteVectorStoreFile(storeID, fileID string) error

DeleteVectorStoreFile is used to delete a file from a Vector Store object specified by `storeID`

func (VectorStores) GetVectorStoreFiles

func (v VectorStores) GetVectorStoreFiles(storeID string) (GetVectorStoreFilesResponse, error)

GetVectorStoreFiles returns a list of Files stored in the Vector Store object specified by `storeID` as a struct GetVectorStoreFilesResponse

Jump to

Keyboard shortcuts

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