Documentation
¶
Overview ¶
Package table provides common table formatting utilities for CLI commands.
Index ¶
- func BuildAuthorsString(authors []catalogs.Author) string
- func BuildFeaturesString(model *catalogs.Model) string
- func FormatNumber(n int64) string
- func FormatOutput(limits *catalogs.ModelLimits) string
- func FormatPrice(pricing *catalogs.ModelPricing, input bool) string
- func FormatTokens(limits *catalogs.ModelLimits) string
- func MatchField(field string, patterns []string) bool
- type Align
- type Data
- func AuthorsToTableData(authors []*catalogs.Author) Data
- func ModelsToTableData(models []*catalogs.Model, showDetails bool) Data
- func ProvenanceToTableData(fieldProvenance map[string][]provenance.Provenance) Data
- func ProvidersToTableData(providers []*catalogs.Provider, checker *auth.Checker, ...) Data
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildAuthorsString ¶
BuildAuthorsString creates a comma-separated list of author names.
func BuildFeaturesString ¶
BuildFeaturesString creates a comma-separated list of model features.
func FormatNumber ¶
FormatNumber formats large numbers with comma separators.
func FormatOutput ¶
func FormatOutput(limits *catalogs.ModelLimits) string
FormatOutput formats output token limit information.
func FormatPrice ¶
func FormatPrice(pricing *catalogs.ModelPricing, input bool) string
FormatPrice formats pricing information.
func FormatTokens ¶
func FormatTokens(limits *catalogs.ModelLimits) string
FormatTokens formats context window information.
func MatchField ¶ added in v0.0.23
MatchField checks if a field matches any of the provided patterns. Supports wildcard matching (e.g., "pricing.*" matches "Pricing.Tokens.Input"). Matching is case-insensitive for better user experience.
Types ¶
type Data ¶
type Data struct {
Headers []string
Rows [][]string
ColumnAlignment []Align // Optional: column alignment
}
Data represents table formatting data to avoid import cycles.
func AuthorsToTableData ¶
AuthorsToTableData converts authors to table format.
func ModelsToTableData ¶
ModelsToTableData converts models to table format.
func ProvenanceToTableData ¶ added in v0.0.23
func ProvenanceToTableData(fieldProvenance map[string][]provenance.Provenance) Data
ProvenanceToTableData converts provenance history to table format. Shows all fields and their history in a single unified table.