Documentation
¶
Index ¶
- func APIEmbeddingToEmbedding(embedding openapiclient.EmbeddingsInner) *types.Embedding
- func APIEmbeddingsToEmbeddings(embeddings []openapiclient.EmbeddingsInner) []*types.Embedding
- func GetStringTypeOfEmbeddingFunction(ef types.EmbeddingFunction) string
- type Client
- func (c *Client) CountCollections(ctx context.Context) (int32, error)
- func (c *Client) CreateCollection(ctx context.Context, collectionName string, metadata map[string]interface{}, ...) (*Collection, error)
- func (c *Client) CreateDatabase(ctx context.Context, databaseName string, tenantName *string) (*openapiclient.Database, error)
- func (c *Client) CreateTenant(ctx context.Context, tenantName string) (*openapiclient.Tenant, error)
- func (c *Client) DeleteCollection(ctx context.Context, collectionName string) (*Collection, error)
- func (c *Client) GetCollection(ctx context.Context, collectionName string, ...) (*Collection, error)
- func (c *Client) GetDatabase(ctx context.Context, databaseName string, tenantName *string) (*openapiclient.Database, error)
- func (c *Client) GetTenant(ctx context.Context, tenantName string) (*openapiclient.Tenant, error)
- func (c *Client) Heartbeat(ctx context.Context) (map[string]float32, error)
- func (c *Client) ListCollections(ctx context.Context) ([]*Collection, error)
- func (c *Client) NewCollection(ctx context.Context, options ...collection.Option) (*Collection, error)
- func (c *Client) PreflightChecks(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) Reset(ctx context.Context) (bool, error)
- func (c *Client) SetDatabase(database string)
- func (c *Client) SetTenant(tenant string)
- func (c *Client) Version(ctx context.Context) (string, error)
- type ClientConfiguration
- type ClientOption
- type Collection
- func (c *Collection) Add(ctx context.Context, embeddings []*types.Embedding, ...) (*Collection, error)
- func (c *Collection) AddRecords(ctx context.Context, recordSet *types.RecordSet) (*Collection, error)
- func (c *Collection) Count(ctx context.Context) (int32, error)
- func (c *Collection) Delete(ctx context.Context, ids []string, where map[string]interface{}, ...) ([]string, error)
- func (c *Collection) Get(ctx context.Context, where map[string]interface{}, ...) (*GetResults, error)
- func (c *Collection) GetWithOptions(ctx context.Context, options ...types.CollectionQueryOption) (*GetResults, error)
- func (c *Collection) Modify(ctx context.Context, embeddings []*types.Embedding, ...) (*Collection, error)
- func (c *Collection) Query(ctx context.Context, queryTexts []string, nResults int32, ...) (*QueryResults, error)
- func (c *Collection) QueryWithOptions(ctx context.Context, queryOptions ...types.CollectionQueryOption) (*QueryResults, error)
- func (c *Collection) String() string
- func (c *Collection) Update(ctx context.Context, newName string, newMetadata *map[string]interface{}) (*Collection, error)
- func (c *Collection) Upsert(ctx context.Context, embeddings []*types.Embedding, ...) (*Collection, error)
- type GetResults
- type QueryResults
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func APIEmbeddingToEmbedding ¶ added in v0.1.0
func APIEmbeddingToEmbedding(embedding openapiclient.EmbeddingsInner) *types.Embedding
func APIEmbeddingsToEmbeddings ¶ added in v0.1.0
func APIEmbeddingsToEmbeddings(embeddings []openapiclient.EmbeddingsInner) []*types.Embedding
func GetStringTypeOfEmbeddingFunction ¶
func GetStringTypeOfEmbeddingFunction(ef types.EmbeddingFunction) string
Types ¶
type Client ¶
type Client struct { ApiClient *openapiclient.APIClient //nolint Tenant string Database string APIVersion semver.Version // contains filtered or unexported fields }
Client represents the ChromaDB Client
func (*Client) CountCollections ¶ added in v0.1.0
func (*Client) CreateCollection ¶
func (c *Client) CreateCollection(ctx context.Context, collectionName string, metadata map[string]interface{}, createOrGet bool, embeddingFunction types.EmbeddingFunction, distanceFunction types.DistanceFunction) (*Collection, error)
func (*Client) CreateDatabase ¶ added in v0.1.0
func (*Client) CreateTenant ¶ added in v0.1.0
func (*Client) DeleteCollection ¶
func (*Client) GetCollection ¶
func (c *Client) GetCollection(ctx context.Context, collectionName string, embeddingFunction types.EmbeddingFunction) (*Collection, error)
func (*Client) GetDatabase ¶ added in v0.1.0
func (*Client) ListCollections ¶
func (c *Client) ListCollections(ctx context.Context) ([]*Collection, error)
func (*Client) NewCollection ¶ added in v0.1.0
func (c *Client) NewCollection(ctx context.Context, options ...collection.Option) (*Collection, error)
func (*Client) PreflightChecks ¶ added in v0.1.0
func (*Client) SetDatabase ¶ added in v0.1.0
type ClientConfiguration ¶
type ClientConfiguration struct { BasePath string `json:"basePath,omitempty"` DefaultHeaders map[string]string `json:"defaultHeader,omitempty"` EmbeddingFunction types.EmbeddingFunction `json:"embeddingFunction,omitempty"` }
type ClientOption ¶ added in v0.1.0
func WithAuth ¶ added in v0.1.1
func WithAuth(provider types.CredentialsProvider) ClientOption
func WithDatabase ¶ added in v0.1.0
func WithDatabase(database string) ClientOption
func WithDebug ¶ added in v0.1.0
func WithDebug(debug bool) ClientOption
func WithDefaultHeaders ¶ added in v0.1.0
func WithDefaultHeaders(headers map[string]string) ClientOption
func WithTenant ¶ added in v0.1.0
func WithTenant(tenant string) ClientOption
type Collection ¶
type Collection struct { Name string EmbeddingFunction types.EmbeddingFunction ApiClient *openapiclient.APIClient //nolint Metadata map[string]interface{} ID string Tenant string Database string }
func NewCollection ¶
func NewCollection(apiClient *openapiclient.APIClient, id string, name string, metadata *map[string]interface{}, embeddingFunction types.EmbeddingFunction, tenant string, database string) *Collection
func (*Collection) Add ¶
func (c *Collection) Add(ctx context.Context, embeddings []*types.Embedding, metadatas []map[string]interface{}, documents []string, ids []string) (*Collection, error)
func (*Collection) AddRecords ¶ added in v0.1.0
func (c *Collection) AddRecords(ctx context.Context, recordSet *types.RecordSet) (*Collection, error)
func (*Collection) Get ¶
func (c *Collection) Get(ctx context.Context, where map[string]interface{}, whereDocuments map[string]interface{}, ids []string, include []types.QueryEnum) (*GetResults, error)
func (*Collection) GetWithOptions ¶ added in v0.1.0
func (c *Collection) GetWithOptions(ctx context.Context, options ...types.CollectionQueryOption) (*GetResults, error)
func (*Collection) Modify ¶
func (c *Collection) Modify(ctx context.Context, embeddings []*types.Embedding, metadatas []map[string]interface{}, documents []string, ids []string) (*Collection, error)
func (*Collection) QueryWithOptions ¶ added in v0.1.0
func (c *Collection) QueryWithOptions(ctx context.Context, queryOptions ...types.CollectionQueryOption) (*QueryResults, error)
func (*Collection) String ¶ added in v0.1.0
func (c *Collection) String() string
func (*Collection) Update ¶
func (c *Collection) Update(ctx context.Context, newName string, newMetadata *map[string]interface{}) (*Collection, error)
type GetResults ¶ added in v0.1.0
Click to show internal directories.
Click to hide internal directories.