Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefineIndexerAndRetriever ¶
func DefineIndexerAndRetriever(ctx context.Context, g *genkit.Genkit, cfg ClassConfig) (ai.Indexer, ai.Retriever, error)
DefineIndexerAndRetriever defines an ai.Indexer and ai.Retriever that use the same class. The name uniquely identifies the Indexer and Retriever in the registry.
Types ¶
type ClassConfig ¶
type ClassConfig struct { // The weaviate class name. May not be the empty string. Class string // The Embedder and options to use to embed documents. // Embedder may not be nil. Embedder ai.Embedder EmbedderOptions any }
ClassConfig holds configuration options for an indexer/retriever pair. Weaviate stores data in collections, and each collection has a class name. Use a separate genkit Indexer/Retriever for each different class.
type RetrieverOptions ¶
type RetrieverOptions struct { // Maximum number of values to retrieve. Count int `json:"count,omitempty"` // Keys to retrieve from document metadata. // There doesn't seem to be a way to ask for all of the metadata. MetadataKeys []string }
RetrieverOptions may be passed in the Options field ai.RetrieverRequest to pass options to Weaviate. The options field should be either nil or a value of type *RetrieverOptions.
type Weaviate ¶ added in v0.3.0
type Weaviate struct { // The hostname:port to use to contact the Weaviate database. // If not set, the default is read from the WEAVIATE_URL environment variable. Addr string // The scheme to use to contact the Weaviate database. // Typically http or https. // If not set, the default is https. Scheme string // The API key to use with the Weaviate database. // If not set, the default is read from the WEAVIATE_API_KEY environment variable. APIKey string // contains filtered or unexported fields }
Weaviate passes configuration options to the plugin.
Click to show internal directories.
Click to hide internal directories.