Documentation
¶
Overview ¶
Package query provides shared catalog list/detail query behavior.
Index ¶
- func Authors(authors []catalogs.Author, opts AuthorOptions) []catalogs.Author
- func CatalogModels(catalog catalogs.Reader, provider string) ([]catalogs.Model, error)
- func Models(models []catalogs.Model, opts ModelOptions) []catalogs.Model
- func Providers(providers []catalogs.Provider, opts ProviderOptions) []catalogs.Provider
- type AuthorOptions
- type ModelFilter
- type ModelOptions
- type PageResult
- type ProviderOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Authors ¶
func Authors(authors []catalogs.Author, opts AuthorOptions) []catalogs.Author
Authors filters, sorts, and limits author results.
func CatalogModels ¶
CatalogModels returns either all legacy flattened models or the exact provider-specific offerings from the catalog's provider index.
Types ¶
type AuthorOptions ¶
AuthorOptions controls author list filtering.
type ModelFilter ¶
type ModelFilter struct {
// Basic filters
ID string
Name string
NameContains string
Provider string
Status string
// Modality filters
ModalityInput []string
ModalityOutput []string
// Feature filters
Features map[string]bool
// Metadata filters
Tags []string
OpenWeights *bool
// Numeric range filters
MinContext int64
MaxContext int64
MinInput int64
MaxInput int64
MinOutput int64
MaxOutput int64
// Date filters
ReleasedAfter *time.Time
ReleasedBefore *time.Time
// Pagination
Sort string
Order string
Limit int
Offset int
MaxResults int
}
ModelFilter contains all possible filter criteria for models.
func (ModelFilter) Apply ¶
func (f ModelFilter) Apply(models []catalogs.Model) []catalogs.Model
Apply applies the filter to a list of models and returns filtered results.
func (ModelFilter) Validate ¶
func (f ModelFilter) Validate() error
Validate rejects unsupported or ambiguous filter, sort, range, and page values before query execution.
type ModelOptions ¶
type ModelOptions struct {
Author string
Capability string
MinContext int64
MaxPrice float64
Search string
Limit int
}
ModelOptions controls model list filtering.
type PageResult ¶
PageResult contains paginated query results and metadata.
type ProviderOptions ¶
ProviderOptions controls provider list filtering.