Help us shape the future of Go! Take the 2026 Go Developer Survey

embedding

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Model        string
	BaseUrl      string
	ApiKey       string
	ApiKeyHeader string
	Timeout      time.Duration
}

type Response

type Response struct {
	Data []struct {
		Embedding []float64 `json:"embedding"`
	} `json:"data"`
}

type Source

type Source struct {
	// contains filtered or unexported fields
}

func New

func New(ds types.DataSource, attached bool) (*Source, error)

func (*Source) Attach

func (s *Source) Attach(ctx context.Context, db *db.Pool) (err error)

func (*Source) CreateEmbedding

func (s *Source) CreateEmbedding(ctx context.Context, input string) (types.Vector, error)

func (*Source) CreateEmbeddings

func (s *Source) CreateEmbeddings(ctx context.Context, input []string) ([]types.Vector, error)

func (*Source) Definition

func (s *Source) Definition() types.DataSource

func (*Source) Detach

func (s *Source) Detach(ctx context.Context, db *db.Pool) error

func (*Source) Engine

func (s *Source) Engine() engines.Engine

func (*Source) IsAttached

func (s *Source) IsAttached() bool

func (*Source) Name

func (s *Source) Name() string

func (*Source) ReadOnly

func (s *Source) ReadOnly() bool

Jump to

Keyboard shortcuts

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