openai

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEmbedder

func NewEmbedder(ctx context.Context, cfg *Config, logger logging.Logger, tracer tracing.Tracer) (embeddings.Embedder, error)

NewEmbedder creates a new OpenAI-backed embeddings provider.

Types

type Config

type Config struct {
	APIKey       string        `env:"API_KEY"       json:"apiKey,omitempty"`
	BaseURL      string        `env:"BASE_URL"      json:"baseURL,omitempty"`
	DefaultModel string        `env:"DEFAULT_MODEL" json:"defaultModel,omitempty"`
	Timeout      time.Duration `env:"TIMEOUT"       json:"timeout"`
}

Config configures the OpenAI embeddings provider.

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