Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProviderTemplateDefinitions ¶
func ProviderTemplateDefinitions(definitions []ProviderDefinition) []providertemplates.Definition
func Sync ¶
func Sync(ctx context.Context, logger *slog.Logger, queries dbstore.Queries, defs []ProviderDefinition) error
Sync upserts the given provider definitions into the database. New providers are created with enable=false. Existing registry providers are matched by source file, then name, then legacy model fingerprints, so changing a YAML display name updates the existing provider instead of creating a duplicate. Existing enable state, credentials, and custom config values are preserved. Models are upserted by (provider_id, model_id), overwriting name/type/config.
Types ¶
type ModelDefinition ¶
type ModelDefinition struct {
ModelID string `yaml:"model_id"`
Name string `yaml:"name"`
Type string `yaml:"type"`
Config map[string]any `yaml:"config"`
}
ModelDefinition describes a model within a provider definition.
type ProviderDefinition ¶
type ProviderDefinition struct {
ID string `yaml:"id,omitempty"`
Name string `yaml:"name"`
ClientType string `yaml:"client_type"`
Icon string `yaml:"icon,omitempty"`
BaseURL string `yaml:"base_url,omitempty"`
Config map[string]any `yaml:"config,omitempty"`
Models []ModelDefinition `yaml:"models"`
Source string `yaml:"-"`
}
ProviderDefinition describes a built-in provider loaded from a YAML file.
Click to show internal directories.
Click to hide internal directories.