MCPcopy Create free account
hub / github.com/astercloud/aster / float32SliceToPgVector

Function float32SliceToPgVector

pkg/vector/pgvector/store.go:198–200  ·  view source on GitHub ↗

float32SliceToPgVector 将 []float32 转为 pgvector 兼容的 []float32。 这里直接复用原 slice, pgx 会将其编码为 pgvector 类型。

(v []float32)

Source from the content-addressed store, hash-verified

196// float32SliceToPgVector 将 []float32 转为 pgvector 兼容的 []float32。
197// 这里直接复用原 slice, pgx 会将其编码为 pgvector 类型。
198func float32SliceToPgVector(v []float32) []float32 {
199 return v
200}
201
202func distanceToScore(distance float64, metric string) float64 {
203 switch metric {

Callers 2

UpsertMethod · 0.85
QueryMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected