Documentation
¶
Index ¶
Constants ¶
View Source
const BatchChannelSize = 100
Variables ¶
This section is empty.
Functions ¶
func VectorizeBatch ¶
func VectorizeBatch[T []float32](ctx context.Context, objs []*models.Object, skipObject []bool, cfg moduletools.ClassConfig, logger logrus.FieldLogger, objectVectorizer objectVectorizer) ([]T, []models.AdditionalProperties, map[int]error)
Types ¶
type Batch ¶
func NewBatchVectorizer ¶
func NewBatchVectorizer[T dto.Embedding](client BatchClient[T], maxBatchTime time.Duration, settings Settings, logger logrus.FieldLogger, label string) *Batch[T]
func (*Batch[T]) SubmitBatchAndWait ¶
func (b *Batch[T]) SubmitBatchAndWait(ctx context.Context, cfg moduletools.ClassConfig, skipObject []bool, tokenCounts []int, texts []string) ([]T, map[int]error)
type BatchClient ¶
type BatchClient[T dto.Embedding] interface { Vectorize(ctx context.Context, input []string, config moduletools.ClassConfig) (*modulecomponents.VectorizationResult[T], *modulecomponents.RateLimits, int, error) GetVectorizerRateLimit(ctx context.Context, config moduletools.ClassConfig) *modulecomponents.RateLimits GetApiKeyHash(ctx context.Context, config moduletools.ClassConfig) [32]byte }
type Settings ¶ added in v1.25.25
type Settings struct { TokenMultiplier float32 MaxTimePerBatch float64 MaxObjectsPerBatch int MaxTokensPerBatch func(cfg moduletools.ClassConfig) int HasTokenLimit bool ReturnsRateLimit bool }
type TokenizerFuncType ¶ added in v1.25.25
type TokenizerFuncType func(ctx context.Context, objects []*models.Object, skipObject []bool, cfg moduletools.ClassConfig, objectVectorizer *objectsvectorizer.ObjectVectorizer) ([]string, []int, bool, error)
func ReturnBatchTokenizer ¶ added in v1.25.25
func ReturnBatchTokenizer(multiplier float32, moduleName string, lowerCaseInput bool) TokenizerFuncType
Click to show internal directories.
Click to hide internal directories.