service

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChromaService

type ChromaService struct {
	// contains filtered or unexported fields
}

ChromaService handles business logic for ChromaDB operations.

func NewChromaService

NewChromaService creates a new service with the given client and embedder. If the client is a concrete *client.ChromaClient, the embedder is injected into it.

func (*ChromaService) AddDocuments

func (s *ChromaService) AddDocuments(collectionName string, docs []string, ids []string) error

AddDocuments adds documents to a collection with embeddings.

func (*ChromaService) Close

func (s *ChromaService) Close()

Close releases resources used by the service.

func (*ChromaService) GetTenant

func (s *ChromaService) GetTenant() (bool, error)

GetTenant checks if the tenant exists.

func (*ChromaService) IngestRecords

func (s *ChromaService) IngestRecords(collectionName, filePath string, cfg *ingest.Config) error

IngestRecords ingests records from a JSONL file into the collection. It parses the file, extracts content and metadata, generates embeddings, and uploads in batches. collectionName can be a name or UUID. If cfg is nil, sensible defaults are used.

func (*ChromaService) ListCollections

func (s *ChromaService) ListCollections() ([]client.Collection, error)

ListCollections lists all collections in the database.

func (*ChromaService) ListDatabases

func (s *ChromaService) ListDatabases() ([]client.Database, error)

ListDatabases lists all databases for the tenant.

func (*ChromaService) QueryDocuments

func (s *ChromaService) QueryDocuments(collectionName string, queries []string, nResults int) (*client.QueryResponse, error)

QueryDocuments queries documents in a collection.

func (*ChromaService) TestConnection

func (s *ChromaService) TestConnection() error

TestConnection tests the connection to ChromaDB.

func (*ChromaService) UpsertDocuments

func (s *ChromaService) UpsertDocuments(collectionName string, docs []string, ids []string) error

UpsertDocuments upserts documents to a collection with embeddings (insert or update).

Jump to

Keyboard shortcuts

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