Versions in this module Expand all Collapse all v0 v0.0.1 Mar 27, 2024 Changes in this version + const DefaultBaseURL + const Scheme + const SecureScheme + var ErrDBClosed = errors.New("ErrDBClosed") + var ErrInvalidDSN = errors.New("ErrInvalidDSN") + var ErrInvalidVectorDistance = errors.New("ErrInvalidVectorDistance") + var ErrInvalidVectorSize = errors.New("ErrInvalidVectorSize") + var ErrMissingDSN = errors.New("ErrMissingDSN") + var ErrMissingVectorSize = errors.New("ErrMissingVectorSize") + func Do(client *http.Client, req *http.Request) (*http.Response, error) + func NewRequest(ctx context.Context, method, url string, body io.Reader, opts ...ReqOption) (*http.Request, error) + type APIError struct + Result struct{ ... } + Status struct{ ... } + Time float64 + func (e APIError) Error() string + type Action map[string]map[string]string + type Alias struct + Collection string + Name string + type AliasActionReq struct + Actions []Action + type AliasesResp struct + Result struct{ ... } + Status string + Time float64 + type DB struct + DSN string + func NewDB(dsn string) (*DB, error) + func (db *DB) Close() error + func (db *DB) Open() (err error) + type HTTPClient struct + func NewHTTPClient(opts ...Option) *HTTPClient + func (c *HTTPClient) AliasList(ctx context.Context, collName string) (*AliasesResp, error) + func (c *HTTPClient) UpdateAliases(ctx context.Context, actions []Action) error + type Option func(*Options) + func WithAPIKey(apiKey string) Option + func WithBaseURL(baseURL string) Option + func WithHTTPClient(httpClient *http.Client) Option + type Options struct + APIKey string + BaseURL string + HTTPClient *http.Client + type ProvidersService struct + func NewProvidersService(db *DB) (*ProvidersService, error) + func (p *ProvidersService) AddProvider(ctx context.Context, name string, md map[string]any) (*v1.Provider, error) + func (p *ProvidersService) ComputeProviderProjections(ctx context.Context, uid string, proj v1.Projection) error + func (p *ProvidersService) DropProviderEmbeddings(ctx context.Context, uid string) error + func (p *ProvidersService) GetProviderByUID(ctx context.Context, uid string) (*v1.Provider, error) + func (p *ProvidersService) GetProviderEmbeddings(ctx context.Context, uid string, filter v1.ProviderFilter) ([]v1.Embedding, v1.Page, error) + func (p *ProvidersService) GetProviderProjections(ctx context.Context, uid string, filter v1.ProviderFilter) (map[v1.Dim][]v1.Embedding, v1.Page, error) + func (p *ProvidersService) GetProviders(ctx context.Context, filter v1.ProviderFilter) ([]*v1.Provider, v1.Page, error) + func (p *ProvidersService) UpdateProviderEmbeddings(ctx context.Context, uid string, embeds []v1.Embedding, proj v1.Projection) ([]v1.Embedding, error) + type ReqOption func(*http.Request) + func WithBearer(token string) ReqOption