Skip to main content

internal/infra/pg/embeddingtypes.go

internal/infra/pg · 101 lines · 12 declarations · source

Declarations

const MaxStoredEmbeddingDimensions

const MaxStoredEmbeddingDimensions = 4000

source

const MaxRetainedEmbeddingGenerations

const MaxRetainedEmbeddingGenerations = 2

source

const MaxEmbeddingPage

const MaxEmbeddingPage = 64

source

const MaxEmbeddingPageBytes

const MaxEmbeddingPageBytes = 1 << 20

source

var ErrInvalidEmbedding, ErrEmbeddingConflict, ErrEmbeddingNotFound and 3 more

var (
ErrInvalidEmbedding = errors.New("invalid embedding request or model contract")
ErrEmbeddingConflict = errors.New("embedding generation, source or model contract conflicts")
ErrEmbeddingNotFound = errors.New("embedding generation not found")
ErrEmbeddingBusy = errors.New("embedding generation is already being built")
ErrEmbeddingIncomplete = errors.New("embedding generation is incomplete or stale")
ErrEmbeddingCapacity = errors.New("prune a non-active embedding generation before starting another")
)

source

type EmbeddingModel

type EmbeddingModel struct {
Name string `json:"name"`
Revision string `json:"revision"`
EndpointHash string `json:"endpoint_hash"`
Dimensions int `json:"dimensions"`
}

EndpointHash identifies the configured embedding endpoint without publishing its URL or key. Revision is operator-declared: an OpenAI-compatible endpoint cannot attest unchanged model weights.

source

method EmbeddingModel.Validate

func (m EmbeddingModel) Validate() error

source

method EmbeddingModel.Identity

func (m EmbeddingModel) Identity() string

source

type EmbeddingGeneration

type EmbeddingGeneration struct {
ID string `json:"id"`
Project string `json:"project"`
Key string `json:"operation_key"`
Model EmbeddingModel `json:"model"`
ThroughOffset int64 `json:"through_offset"`
InitialThroughOffset int64 `json:"initial_through_offset"`
CoveredThroughOffset int64 `json:"covered_through_offset"`
After ChunkRecoveryCursor `json:"after"`
State string `json:"state"`
Active bool `json:"active"`
Examined int64 `json:"examined"`
Stored int64 `json:"stored"`
CreatedAt time.Time `json:"created_at"`
}

source

type MessageEmbeddingStore

type MessageEmbeddingStore struct {
pool *pgxpool.Pool
schema Schema
}

source

func NewMessageEmbeddingStore

func NewMessageEmbeddingStore(pool *pgxpool.Pool, schema Schema) *MessageEmbeddingStore

source

func validEmbeddingIDs

func validEmbeddingIDs(scope string, ids ...string) error

source