seed

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultModels

func DefaultModels() []*proxydb.Model

DefaultModels returns standard model definitions across major providers.

func DefaultRules

func DefaultRules(models []*proxydb.Model, activeVendors []string) []*proxydb.Rule

DefaultRules creates catch-all rules prioritized based on provided vendor keys.

Types

type Config

type Config struct {
	Enabled      bool
	ClientKey    string
	ClientName   string
	OpenAIKey    string
	GeminiKey    string
	AnthropicKey string
}

Config configures the auto-seeding routine.

type Result

type Result struct {
	Seeded    bool
	ClientKey string
	KeyName   string
	Models    []string
	Vendors   []string
}

Result describes the outcome of a seeding attempt.

func Run

func Run(ctx context.Context, pool *pgxpool.Pool, keyring *crypto.Keyring, cfg Config) (*Result, error)

Run idempotently seeds initial API keys, vendor credentials, default models, and catch-all routing rules if the database is unpopulated.

Jump to

Keyboard shortcuts

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