llmcfg

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProviderOpenAI is the OpenAI provider.
	ProviderOpenAI = "openai"
	// ProviderAnthropic is the Anthropic provider.
	ProviderAnthropic = "anthropic"
)

Variables

This section is empty.

Functions

func ProvideLLMProvider

func ProvideLLMProvider(c *Config, logger logging.Logger, tracerProvider tracing.TracerProvider, metricsProvider metrics.Provider) (llm.Provider, error)

ProvideLLMProvider provides an LLM provider from config.

func RegisterLLMProvider

func RegisterLLMProvider(i do.Injector)

RegisterLLMProvider registers an llm.Provider with the injector.

Types

type Config

type Config struct {
	OpenAI    *openai.Config    `env:"init"     envPrefix:"OPENAI_"    json:"openai"`
	Anthropic *anthropic.Config `env:"init"     envPrefix:"ANTHROPIC_" json:"anthropic"`
	Provider  string            `env:"PROVIDER" json:"provider"`
}

Config is the configuration for the LLM provider.

func (*Config) ProvideLLMProvider

func (c *Config) ProvideLLMProvider(ctx context.Context, logger logging.Logger, tracerProvider tracing.TracerProvider, metricsProvider metrics.Provider) (llm.Provider, error)

ProvideLLMProvider provides an LLM provider based on config.

func (*Config) ValidateWithContext

func (c *Config) ValidateWithContext(ctx context.Context) error

ValidateWithContext validates the config.

Jump to

Keyboard shortcuts

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