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 IsDefinedRetriever ¶ added in v0.1.0
IsDefinedRetriever reports whether the named Retriever is defined by this plugin.
Types ¶
type DocStore ¶ added in v0.6.0
type DocStore struct { Filename string Embedder ai.Embedder EmbedderOptions any Data map[string]DbValue }
DocStore implements a local vector database. This is based on js/plugins/dev-local-vectorstore/src/index.ts.
func DefineRetriever ¶ added in v0.6.0
func DefineRetriever(g *genkit.Genkit, name string, cfg Config, opts *ai.RetrieverOptions) (*DocStore, ai.Retriever, error)
DefineRetriever defines a Retriever and docStore which is also used by the retriever. The name uniquely identifies the Retriever in the registry.
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.