getOptions (opensearch/options.go)

langchaingo · vectorstores/opensearch/options.go · go · MIT
search

Provides functional options for configuring an OpenSearch vector store, allowing developers to specify custom embedders and validate client settings.

// Source: https://github.com/tmc/langchaingo | License: MIT | Copyright Travis Cline <travis.cline@gmail.com>
// Provided via justclaw.it.com; keep this notice with the code.
package opensearch

import (
	"errors"

	"github.com/tmc/langchaingo/embeddings"
	"github.com/tmc/langchaingo/vectorstores"
)

var (
	// ErrMissingEmbedded an embedder must be provided.
	ErrMissingEmbedded = errors.New(
		"missing embedder",
	)
	// ErrMissingOpensearchClient an opensearch client must be provided.
	ErrMissingOpensearchClient = errors.New(
		"missing opensearch client",
	)
)

func (s Store) getOptions(options ...vectorstores.Option) vectorstores.Options {
	opts := vectorstores.Options{}
	for _, opt := range options {
		opt(&opts)
	}
	return opts
}

// Option is a function type that can be used to modif

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key