Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ProviderOpenAI is the OpenAI provider. ProviderOpenAI = "openai" // ProviderOllama is the Ollama provider. ProviderOllama = "ollama" // ProviderCohere is the Cohere provider. ProviderCohere = "cohere" )
Variables ¶
This section is empty.
Functions ¶
func ProvideEmbedder ¶
func ProvideEmbedder(ctx context.Context, c *Config, logger logging.Logger, tracer tracing.Tracer) (embeddings.Embedder, error)
ProvideEmbedder provides an Embedder from config.
func RegisterEmbedder ¶
RegisterEmbedder registers an embeddings.Embedder with the injector.
Types ¶
type Config ¶
type Config struct {
OpenAI *openai.Config `env:"init" envPrefix:"OPENAI_" json:"openai"`
Ollama *ollama.Config `env:"init" envPrefix:"OLLAMA_" json:"ollama"`
Cohere *cohere.Config `env:"init" envPrefix:"COHERE_" json:"cohere"`
Provider string `env:"PROVIDER" json:"provider"`
}
Config is the configuration for the embeddings provider.
Click to show internal directories.
Click to hide internal directories.