Documentation
¶
Index ¶
- Variables
- func IDs() []string
- func NormalizeID(id string) string
- func RuntimeSupported(descriptor Descriptor) bool
- func RuntimeUnsupportedReason(descriptor Descriptor) string
- func ValidAPIFormat(format APIFormat) bool
- func ValidTransport(transport Transport) bool
- type APIFormat
- type Descriptor
- type Transport
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnknownProvider = errors.New("unknown provider")
Functions ¶
func NormalizeID ¶
func RuntimeSupported ¶
func RuntimeSupported(descriptor Descriptor) bool
func RuntimeUnsupportedReason ¶
func RuntimeUnsupportedReason(descriptor Descriptor) string
func ValidAPIFormat ¶
func ValidTransport ¶
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
// Custom marks the "bring your own endpoint" catalog entries
// (custom-openai-compatible, custom-anthropic-compatible). Unlike every other
// descriptor, RequiresAuth here is just a template default for the credential
// wizard step, not a fact about the user's actual endpoint — a custom target may
// or may not need auth, so callers deciding whether a *saved profile* is missing
// a credential must not treat RequiresAuth as authoritative for these entries.
Custom bool
// 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 )
Click to show internal directories.
Click to hide internal directories.