Versions in this module Expand all Collapse all v0 v0.1.3 Mar 27, 2024 v0.1.2 Mar 14, 2024 v0.1.1 Mar 14, 2024 Changes in this version + type BasicAuthCredentialsProvider struct + Password string + Username string + func NewBasicAuthCredentialsProvider(username, password string) *BasicAuthCredentialsProvider + func (b *BasicAuthCredentialsProvider) Authenticate(config *openapi.Configuration) error + type CredentialsProvider interface + Authenticate func(apiClient *openapi.Configuration) error + type TokenAuthCredentialsProvider struct + Header TokenTransportHeader + Token string + func NewTokenAuthCredentialsProvider(token string, header TokenTransportHeader) *TokenAuthCredentialsProvider + func (t *TokenAuthCredentialsProvider) Authenticate(config *openapi.Configuration) error + type TokenTransportHeader string + const AuthorizationTokenHeader + const XChromaTokenHeader v0.1.0 Mar 13, 2024 Changes in this version + const COSINE + const DefaultDatabase + const DefaultTenant + const DefaultTimeout + const HNSWBatchSize + const HNSWConstructionEF + const HNSWM + const HNSWNumThreads + const HNSWResizeFactor + const HNSWSearchEF + const HNSWSpace + const HNSWSyncThreshold + const IDistances + const IDocuments + const IEmbeddings + const IMetadatas + const IP + const L2 + func EmbedRecordsDefaultImpl(e EmbeddingFunction, ctx context.Context, records []*Record, force bool) error + func ToAPIEmbeddings(embeddings []*Embedding) []openapi.EmbeddingsInner + type CollectionQueryBuilder struct + Ids []string + Include []QueryEnum + Limit int32 + NResults int32 + Offset int32 + QueryEmbeddings []*Embedding + QueryTexts []string + Where map[string]interface{} + WhereDocument map[string]interface{} + type CollectionQueryOption func(*CollectionQueryBuilder) error + func WithIds(ids []string) CollectionQueryOption + func WithInclude(include ...QueryEnum) CollectionQueryOption + func WithLimit(limit int32) CollectionQueryOption + func WithNResults(nResults int32) CollectionQueryOption + func WithOffset(offset int32) CollectionQueryOption + func WithQueryEmbedding(queryEmbedding *Embedding) CollectionQueryOption + func WithQueryEmbeddings(queryEmbeddings []*Embedding) CollectionQueryOption + func WithQueryText(queryText string) CollectionQueryOption + func WithQueryTexts(queryTexts []string) CollectionQueryOption + func WithWhere(operation where.WhereOperation) CollectionQueryOption + func WithWhereDocument(operation wheredoc.WhereDocumentOperation) CollectionQueryOption + func WithWhereDocumentMap(where map[string]interface{}) CollectionQueryOption + func WithWhereMap(where map[string]interface{}) CollectionQueryOption + type ConsistentHashEmbeddingFunction struct + func (e *ConsistentHashEmbeddingFunction) EmbedDocuments(ctx context.Context, documents []string) ([]*Embedding, error) + func (e *ConsistentHashEmbeddingFunction) EmbedQuery(_ context.Context, document string) (*Embedding, error) + func (e *ConsistentHashEmbeddingFunction) EmbedRecords(ctx context.Context, records []*Record, force bool) error + type DistanceFunction string + func ToDistanceFunction(str any) (DistanceFunction, error) + type Embedding struct + ArrayOfFloat32 *[]float32 + ArrayOfInt32 *[]int32 + func NewEmbeddingFromAPI(apiEmbedding openapi.EmbeddingsInner) *Embedding + func NewEmbeddingFromFloat32(embedding []float32) *Embedding + func NewEmbeddingFromInt32(embedding []int32) *Embedding + func NewEmbeddings(embeddings []interface{}) (*Embedding, error) + func NewEmbeddingsFromFloat32(embeddings [][]float32) []*Embedding + func (e *Embedding) GetFloat32() *[]float32 + func (e *Embedding) GetInt32() *[]int32 + func (e *Embedding) IsDefined() bool + func (e *Embedding) String() string + func (e *Embedding) ToAPI() openapi.EmbeddingsInner + type EmbeddingFunction interface + EmbedDocuments func(ctx context.Context, texts []string) ([]*Embedding, error) + EmbedQuery func(ctx context.Context, text string) (*Embedding, error) + EmbedRecords func(ctx context.Context, records []*Record, force bool) error + func NewConsistentHashEmbeddingFunction() EmbeddingFunction + type IDGenerator interface + Generate func(document string) string + type InvalidEmbeddingValueError struct + Value interface{} + func (e *InvalidEmbeddingValueError) Error() string + type InvalidMetadataValueError struct + Key string + Value interface{} + func (e *InvalidMetadataValueError) Error() string + type Option func(*Record) error + func WithDocument(document string) Option + func WithEmbedding(embedding Embedding) Option + func WithID(id string) Option + func WithMetadata(key string, value interface{}) Option + func WithMetadatas(metadata map[string]interface{}) Option + func WithURI(uri string) Option + type QueryEnum string + type Record struct + Document string + Embedding Embedding + ID string + Metadata map[string]interface{} + URI string + func (r *Record) Validate() error + type RecordSet struct + EmbeddingFunction EmbeddingFunction + IDGenerator IDGenerator + Records []*Record + func NewRecordSet(opts ...RecordSetOption) (*RecordSet, error) + func (rs *RecordSet) BuildAndValidate(ctx context.Context) ([]*Record, error) + func (rs *RecordSet) GetDocuments() []string + func (rs *RecordSet) GetEmbeddings() []*Embedding + func (rs *RecordSet) GetIDs() []string + func (rs *RecordSet) GetMetadatas() []map[string]interface{} + func (rs *RecordSet) GetURIs() []string + func (rs *RecordSet) Validate() error + func (rs *RecordSet) WithRecord(recordOpts ...Option) *RecordSet + func (rs *RecordSet) WithRecords(records []*Record) *RecordSet + type RecordSetOption func(*RecordSet) error + func WithEmbeddingFunction(embeddingFunction EmbeddingFunction) RecordSetOption + func WithIDGenerator(idGenerator IDGenerator) RecordSetOption + type SHA256Generator struct + func NewSHA256Generator() *SHA256Generator + func (s *SHA256Generator) Generate(document string) string + type ULIDGenerator struct + func NewULIDGenerator() *ULIDGenerator + func (u *ULIDGenerator) Generate(_ string) string + type UUIDGenerator struct + func NewUUIDGenerator() *UUIDGenerator + func (u *UUIDGenerator) Generate(_ string) string