Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiscoverModels ¶
DiscoverModels fetches available models from the provider's /models endpoint. It uses the provided context for cancellation and timeout; callers should set a deadline (e.g. context.WithTimeout) to avoid blocking indefinitely. Models whose IDs already appear in cfg.ExistingModels are skipped — user-specified models take precedence.
func IsKnownCustomProvider ¶
IsKnownCustomProvider reports whether the given provider type has a registered enricher. This signals that the provider type is recognized and speaks OpenAI-compat protocol, without exposing the enricher itself to callers that only need the compatibility check.
func RegisterEnricher ¶
RegisterEnricher registers an Enricher for the given provider type. Called from init() in each enricher implementation file.
func RegisteredProviderTypes ¶
func RegisteredProviderTypes() []string
RegisteredProviderTypes returns the provider type strings that have a registered enricher, sorted for stable output. These are the custom, locally-discovered providers (e.g. ollama, omlx) that Atlas-Agent accepts as a `type` value even though they are not catwalk provider types. The schema generator uses this so the published enum stays in sync with the registry instead of drifting from a hand-maintained list.
Types ¶
type Config ¶
type Config struct {
ID string
BaseURL string
APIKey string
ExtraHeaders map[string]string
// Existing models from config — IDs present in this list are skipped
// during discovery (user-specified models win).
ExistingModels []catwalk.Model
}
Config holds the provider configuration needed for model discovery.
type Enricher ¶
type Enricher interface {
// EnrichModels takes a slice of bare discovered models and returns
// them with metadata populated. Implementations should preserve
// existing non-zero fields (user overrides take precedence).
EnrichModels(ctx context.Context, cfg Config, resolver Resolver, models []catwalk.Model) ([]catwalk.Model, error)
}
Enricher fills in model metadata (context window, max tokens, pricing, etc.) for discovered models. Providers that expose richer endpoints beyond /v1/models can register an Enricher to populate fields that the standard listing endpoint omits.
func GetEnricher ¶
GetEnricher returns the Enricher for the given provider type, or nil if no enricher is registered.