Documentation
¶
Index ¶
- type CreateVectorStoreResponse
- type File
- type GetVectorStoreFilesResponse
- type VectorStoreClient
- type VectorStores
- func (v VectorStores) AddVectorStoreFile(storeID, fileID string) error
- func (v VectorStores) CreateVectorStore(storeName string) (string, error)
- func (v VectorStores) DeleteVectorStore(storeID string) error
- func (v VectorStores) DeleteVectorStoreFile(storeID, fileID string) error
- func (v VectorStores) GetVectorStoreFiles(storeID string) (GetVectorStoreFilesResponse, error)
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