vector256

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package vector256 represents a 256-dimensional float32 vector for pgvector part of aerth/mostly project

Index

Constants

This section is empty.

Variables

View Source
var BitSize = 32 // should match F
View Source
var VarLen = 256

VarLen used to work with non-256 dimensions

Functions

This section is empty.

Types

type F added in v0.3.1

type F = float32 // F is for use instead of float32(x) or float64(x)

Vector256 represents a 256-dimensional float32 vector for pgvector and may be zero-length or a slice of 256 float32

type SearchEmbeddings

type SearchEmbeddings struct {
	Embeddings Vector256 `gorm:"type:vector(256);default:null" json:"-"`
}

SearchEmbeddings helper embedded type (for 256 specific)

type Vector256

type Vector256 []F

Vector256 represents a 256-dimensional float32 vector for pgvector and may be zero-length or a slice of 256 float32

func (*Vector256) Scan

func (v *Vector256) Scan(value any) error

Scan converts the Postgres database value back into a Go float32 slice

func (Vector256) Value

func (v Vector256) Value() (driver.Value, error)

Value converts the Go float32 slice into the '[0.1,0.2,...]' string format Postgres expects

Jump to

Keyboard shortcuts

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