Documentation
¶
Overview ¶
Package catalog owns the read-only provider/model catalog and the per-provider capability matrix the Settings UI renders.
Every method gates through authz against TenantCatalogView (currently auth.RoleUser — any authenticated user). The catalog data itself doesn't vary per caller, but routing through authz keeps the gating story uniform across services and lets the policy bump to a tighter role (manager+) without touching this code.
Index ¶
- func ModelMeetsCapability(m Model, capability string) (ok bool, reason string)
- type ListModelsOptions
- type Model
- type Provider
- type ProviderCapability
- type Service
- func (s *Service) ListCapabilities(ctx context.Context, p authz.Principal) ([]ProviderCapability, error)
- func (s *Service) ListModels(ctx context.Context, p authz.Principal, opts ListModelsOptions) ([]Model, error)
- func (s *Service) ListProviders(ctx context.Context, p authz.Principal) ([]Provider, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ModelMeetsCapability ¶
ModelMeetsCapability reports whether m can serve the given capability and, if not, a human-readable reason. capability uses the agentsdk vocabulary (text / vision / embedding / image / speech / transcription) plus "search" (a tool-driven web-search model). It's the single source of truth for the capability gate behind both the system-default and per-agent model pickers; the predicates mirror the frontend (useModelCapabilities). An unknown capability imposes no requirement.
Types ¶
type ListModelsOptions ¶
ListModelsOptions narrows ListModels' result set. ProviderFilter keeps only models from one provider id; ConfiguredOnly restricts to models from providers the operator has enabled in the DB.
type Model ¶
type Model struct {
ID string
Name string
ProviderID string
ProviderConfigID string
Kind string
ToolCall bool
Reasoning bool
Caps []string
CostInput float64
CostOutput float64
ContextLimit int32
OutputLimit int32
StructuredOutputs bool
}
Model is one model from the active catalog. Picker dropdowns and the capability matrix consume the same model list.
type ProviderCapability ¶
type ProviderCapability struct {
ProviderID string
DisplayName string
Capabilities []string
Configured bool
CatalogOnly bool
}
ProviderCapability is one row in the capability matrix Settings renders. Configured = the user has an enabled providers row for it; CatalogOnly = the provider is a Sol-owned search-only entry, so it isn't a candidate for normal "add provider" flows.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) ListCapabilities ¶
func (s *Service) ListCapabilities(ctx context.Context, p authz.Principal) ([]ProviderCapability, error)
ListCapabilities returns one ProviderCapability per known provider (merged catalog), with the per-row Configured + CatalogOnly flags the Settings matrix uses. Sort order: configured providers first, then alphabetical by display name — so "what you have" lands on top.
func (*Service) ListModels ¶
func (s *Service) ListModels(ctx context.Context, p authz.Principal, opts ListModelsOptions) ([]Model, error)
ListModels returns the enriched catalog sorted by (provider, model). Use ConfiguredOnly to mask out catalog entries the operator hasn't enabled — the only filter that touches the DB.