providercatalog

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownProvider = errors.New("unknown provider")

Functions

func IDs

func IDs() []string

func NormalizeID

func NormalizeID(id string) string

func RuntimeSupported

func RuntimeSupported(descriptor Descriptor) bool

func RuntimeUnsupportedReason

func RuntimeUnsupportedReason(descriptor Descriptor) string

func ValidAPIFormat

func ValidAPIFormat(format APIFormat) bool

func ValidTransport

func ValidTransport(transport Transport) bool

Types

type APIFormat

type APIFormat string
const (
	APIFormatOpenAIResponses       APIFormat = "responses"
	APIFormatOpenAIChatCompletions APIFormat = "chat-completions"
	APIFormatAnthropicMessages     APIFormat = "messages"
	APIFormatGoogleGenerateContent APIFormat = "generate-content"
	APIFormatBedrockConverse       APIFormat = "bedrock-converse"
	APIFormatVertexGenerateContent APIFormat = "vertex-generate-content"
)

type Descriptor

type Descriptor struct {
	ID                  string
	Name                string
	Transport           Transport
	DefaultBaseURL      string
	DefaultModel        string
	AuthEnvVars         []string
	RequiresAuth        bool
	UsesAmbientAuth     bool
	Public              bool
	Local               bool
	SupportedAPIFormats []APIFormat
	Aliases             []string

	// OAuth reports that this provider offers an in-app OAuth login that yields a
	// credential usable for model calls (browser PKCE and/or device code). Only
	// set for providers where this actually works (not subscription-via-proxy).
	OAuth bool
	// OAuthMintsKey reports that the OAuth flow returns/mints a normal API key
	// (e.g. OpenRouter) rather than a bearer token used directly.
	OAuthMintsKey bool
	// OAuthDeviceFlow reports that RFC 8628 device-code login is supported (for
	// headless / SSH use) in addition to the browser flow.
	OAuthDeviceFlow bool

	// Recommended marks the provider that should be surfaced first and badged
	// (★ … (recommended)) in every catalog-ordered list and picker. At most one
	// descriptor should set this.
	Recommended bool
}

func All

func All() []Descriptor

func Get

func Get(id string) (Descriptor, bool)

func ListByTransport

func ListByTransport(transport Transport) []Descriptor

func OAuthProviders

func OAuthProviders() []Descriptor

OAuthProviders returns the catalog descriptors that support an in-app OAuth login, in catalog order. It is the single source of truth for the wizard's dedicated "Sign in with OAuth" provider list.

func Require

func Require(id string) (Descriptor, error)

type Transport

type Transport string
const (
	TransportOpenAI              Transport = "openai"
	TransportAnthropic           Transport = "anthropic"
	TransportGoogle              Transport = "google"
	TransportBedrock             Transport = "bedrock"
	TransportVertex              Transport = "vertex"
	TransportOpenAICompatible    Transport = "openai-compatible"
	TransportOpenAICompat        Transport = TransportOpenAICompatible
	TransportAnthropicCompatible Transport = "anthropic-compatible"
	TransportAnthropicCompat     Transport = TransportAnthropicCompatible
)

Jump to

Keyboard shortcuts

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