Documentation
¶
Index ¶
- type AddRecordsRequest
- type ChromaClient
- func (c *ChromaClient) AddBatch(collectionID string, docs []string, ids []string) error
- func (c *ChromaClient) AddBatchGeneric(collectionID string, documents []string, ids []string, ...) error
- func (c *ChromaClient) AddDocument(collectionID, id, text string, vector []float32) error
- func (c *ChromaClient) CreateCollection(name string) (string, error)
- func (c *ChromaClient) CreateDatabase(name string) error
- func (c *ChromaClient) DeleteCollection(name string) error
- func (c *ChromaClient) DeleteRecords(collectionID string, ids []string) error
- func (c *ChromaClient) GenerateLocalEmbedding(text string) ([]float32, error)
- func (c *ChromaClient) GetIDByName(name string) (string, error)
- func (c *ChromaClient) GetTenant() (bool, error)
- func (c *ChromaClient) ListCollections() ([]Collection, error)
- func (c *ChromaClient) ListDatabases() ([]Database, error)
- func (c *ChromaClient) ListDocuments(collectionID string) (*GetRecordsResponse, error)
- func (c *ChromaClient) QueryBatch(collectionId string, queryTexts []string, nResults int) (*QueryResponse, error)
- func (c *ChromaClient) ResolveCollectionID(input string) (string, error)
- func (c *ChromaClient) TestConnection() error
- func (c *ChromaClient) UpsertBatchGeneric(collectionID string, documents []string, ids []string, ...) error
- type ChromaClientInterface
- type Collection
- type CreateCollectionRequest
- type Database
- type GetRecordsRequest
- type GetRecordsResponse
- type IngestRecord
- type QueryResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddRecordsRequest ¶
type ChromaClient ¶
type ChromaClient struct {
URL, Tenant, Database string
Embedder onnx.EmbedderInterface
// contains filtered or unexported fields
}
func NewChromaDBClient ¶
func NewChromaDBClient(url, tenant, database string) *ChromaClient
func (*ChromaClient) AddBatch ¶
func (c *ChromaClient) AddBatch(collectionID string, docs []string, ids []string) error
func (*ChromaClient) AddBatchGeneric ¶
func (c *ChromaClient) AddBatchGeneric(collectionID string, documents []string, ids []string, metadatas []map[string]any) error
AddBatchGeneric handles documents, IDs, and dynamic metadata maps.
func (*ChromaClient) AddDocument ¶
func (c *ChromaClient) AddDocument(collectionID, id, text string, vector []float32) error
AddDocument - Corrected Metadata tag handling
func (*ChromaClient) CreateCollection ¶
func (c *ChromaClient) CreateCollection(name string) (string, error)
func (*ChromaClient) CreateDatabase ¶
func (c *ChromaClient) CreateDatabase(name string) error
CreateDatabase creates a new database in the current tenant.
func (*ChromaClient) DeleteCollection ¶
func (c *ChromaClient) DeleteCollection(name string) error
func (*ChromaClient) DeleteRecords ¶
func (c *ChromaClient) DeleteRecords(collectionID string, ids []string) error
DeleteRecords removes specific documents from a collection by their IDs.
func (*ChromaClient) GenerateLocalEmbedding ¶
func (c *ChromaClient) GenerateLocalEmbedding(text string) ([]float32, error)
Simplified logic for what your Go function will do:
func (*ChromaClient) GetIDByName ¶
func (c *ChromaClient) GetIDByName(name string) (string, error)
func (*ChromaClient) GetTenant ¶
func (c *ChromaClient) GetTenant() (bool, error)
func (*ChromaClient) ListCollections ¶
func (c *ChromaClient) ListCollections() ([]Collection, error)
func (*ChromaClient) ListDatabases ¶
func (c *ChromaClient) ListDatabases() ([]Database, error)
func (*ChromaClient) ListDocuments ¶
func (c *ChromaClient) ListDocuments(collectionID string) (*GetRecordsResponse, error)
ListDocuments - List Documents in collection
func (*ChromaClient) QueryBatch ¶
func (c *ChromaClient) QueryBatch(collectionId string, queryTexts []string, nResults int) (*QueryResponse, error)
func (*ChromaClient) ResolveCollectionID ¶
func (c *ChromaClient) ResolveCollectionID(input string) (string, error)
func (*ChromaClient) TestConnection ¶
func (c *ChromaClient) TestConnection() error
func (*ChromaClient) UpsertBatchGeneric ¶
func (c *ChromaClient) UpsertBatchGeneric(collectionID string, documents []string, ids []string, metadatas []map[string]any) error
UpsertBatchGeneric handles documents, IDs, and dynamic metadata maps for upserting (insert or update).
type ChromaClientInterface ¶
type ChromaClientInterface interface {
TestConnection() error
GetTenant() (bool, error)
ListDatabases() ([]Database, error)
CreateDatabase(name string) error
ListCollections() ([]Collection, error)
AddBatch(collectionID string, docs []string, ids []string) error
AddBatchGeneric(collectionID string, documents []string, ids []string, metadatas []map[string]any) error
UpsertBatchGeneric(collectionID string, documents []string, ids []string, metadatas []map[string]any) error
QueryBatch(collectionId string, queryTexts []string, nResults int) (*QueryResponse, error)
GetIDByName(name string) (string, error)
ResolveCollectionID(input string) (string, error)
DeleteCollection(name string) error
DeleteRecords(collectionID string, ids []string) error
}
type Collection ¶
type Collection struct {
ID string `json:"id"`
Name string `json:"name"`
Tenant string `json:"tenant"`
Database string `json:"database"`
Metadata map[string]any `json:"metadata"`
Dimension *int `json:"dimension"` // Pointer because it can be null
Config map[string]any `json:"configuration_json"`
}
Collection represents the detailed response from ChromaDB
type CreateCollectionRequest ¶
type GetRecordsRequest ¶
type GetRecordsResponse ¶
type IngestRecord ¶
Click to show internal directories.
Click to hide internal directories.