providercatalog

package
v0.16.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package providercatalog is the curated UX layer for provider onboarding — friendly descriptions, signup URLs, API-key help text, recommended-model justifications. ONE combined providers.json, shipped embedded and refreshable from raw.githubusercontent.com/.../pkg/providercatalog/providers.json.

Lifecycle:

  • Embedded at compile time (//go:embed providers.json).
  • Refreshed weekly by .github/workflows/provider-catalog-refresh.yml, which runs cmd/refresh_provider_catalog to query provider APIs and update the checked-in JSON via a PR.

IMPORTANT — distinguish from pkg/providerregistry, the sister system with adjacent but DIFFERENT concerns:

  • pkg/providercatalog (this package): UX/copy. Used by onboarding menus, the model picker description blurbs, signup/help text.
  • pkg/providerregistry: per-provider TECHNICAL CONFIG (endpoint, auth, streaming, retry, cost) that the API client uses.

They share an id/name and a model list shape but otherwise serve different consumers and have separate publish workflows. Don't merge them without a roadmap entry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CatalogURL

func CatalogURL() string

func RefreshFromRemote

func RefreshFromRemote(ctx context.Context, url string) error

func RefreshFromRemoteAsync

func RefreshFromRemoteAsync(url string)

func SetCatalog

func SetCatalog(catalog Catalog)

Types

type Catalog

type Catalog struct {
	UpdatedAt string     `json:"updated_at"`
	Source    string     `json:"source"`
	Providers []Provider `json:"providers"`
}

func Current

func Current() Catalog

type Model

type Model struct {
	ID            string   `json:"id"`
	Name          string   `json:"name,omitempty"`
	Description   string   `json:"description,omitempty"`
	ContextLength int      `json:"context_length,omitempty"`
	Tags          []string `json:"tags,omitempty"`
	InputCost     float64  `json:"input_cost,omitempty"`
	OutputCost    float64  `json:"output_cost,omitempty"`
}

type Provider

type Provider struct {
	ID                  string  `json:"id"`
	Name                string  `json:"name"`
	Description         string  `json:"description,omitempty"`
	SetupHint           string  `json:"setup_hint,omitempty"`
	DocsURL             string  `json:"docs_url,omitempty"`
	SignupURL           string  `json:"signup_url,omitempty"`
	APIKeyLabel         string  `json:"api_key_label,omitempty"`
	APIKeyHelp          string  `json:"api_key_help,omitempty"`
	Recommended         bool    `json:"recommended,omitempty"`
	DefaultModel        string  `json:"default_model,omitempty"`
	RecommendedModel    string  `json:"recommended_model,omitempty"`
	RecommendedModelWhy string  `json:"recommended_model_why,omitempty"`
	Models              []Model `json:"models,omitempty"`
}

func FindProvider

func FindProvider(id string) (Provider, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL