localvec

package
v0.0.0-...-1d0f068 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package localvec is a local vector database for development and testing. The database is stored in a file in the local file system. Production code should use a real vector database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, dir, name string, embedder ai.Embedder, embedderOptions any) (ai.DocumentStore, error)

New returns a new local vector database. This will register a new retriever with genkit, and also return it. This retriever may only be used by a single goroutine at a time. This is based on js/plugins/dev-local-vectorstore/src/index.ts.

Types

type RetrieverOptions

type RetrieverOptions struct {
	K int `json:"k,omitempty"` // number of entries to return
}

RetrieverOptions may be passed in the Options field of ai.RetrieverRequest to pass options to the retriever. The Options field should be either nil or a value of type *RetrieverOptions.

Jump to

Keyboard shortcuts

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