providers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(profile config.ProviderProfile, options Options) (zeroruntime.Provider, error)

New creates a runtime provider for a resolved provider profile.

Types

type Options

type Options struct {
	UserAgent     string
	HTTPClient    *http.Client
	ModelRegistry *modelregistry.Registry
	// OAuthResolver, when set, lets the provider authenticate model calls with an
	// OAuth bearer token (preferred over the API key). nil => API-key auth only.
	// Applied to the OpenAI and Anthropic providers.
	OAuthResolver providerio.TokenResolver
	// OAuthLoginKey is the credential-store key OAuthResolver bound to (empty when
	// there is no OAuth login). It is the SAME selection the bearer resolver made,
	// resolved ONCE by the caller so the Codex chatgpt-account-id header reads its
	// account from the exact login that issued the bearer token — never a second,
	// independent lookup that could pick a different login (a backend-rejected
	// mismatch).
	OAuthLoginKey string
}

Options configures provider construction.

type RuntimeMetadata

type RuntimeMetadata struct {
	ProviderKind config.ProviderKind
	APIModel     string
}

RuntimeMetadata describes the provider identity and concrete API model used after Zero model aliases and provider-kind defaults are resolved.

func ResolveRuntimeMetadata

func ResolveRuntimeMetadata(profile config.ProviderProfile, options Options) (RuntimeMetadata, error)

ResolveRuntimeMetadata returns the provider kind and API model that New would use for a profile, without constructing a network client.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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