common

package
v1.25.18 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DistanceCosine    = "cosine"
	DistanceDot       = "dot"
	DistanceL2Squared = "l2-squared"
	DistanceManhattan = "manhattan"
	DistanceHamming   = "hamming"

	// Set these defaults if the user leaves them blank
	DefaultVectorCacheMaxObjects = 1e12
	DefaultDistanceMetric        = DistanceCosine
)

Variables

This section is empty.

Functions

func OptionalBoolFromMap

func OptionalBoolFromMap(in map[string]interface{}, name string,
	setFn func(v bool),
) error

func OptionalIntFromMap

func OptionalIntFromMap(in map[string]interface{}, name string,
	setFn func(v int),
) error

Tries to parse the int value from the map, if it overflows math.MaxInt64, it uses math.MaxInt64 instead. This is to protect from rounding errors from json marshalling where the type may be assumed as float64

func OptionalStringFromMap

func OptionalStringFromMap(in map[string]interface{}, name string,
	setFn func(v string),
) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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