providers

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package providers contains SDK provider wiring for common model backends.

Index

Constants

View Source
const (
	DefaultProviderOpenAI    = "openai"
	DefaultProviderAnthropic = "anthropic"
)
View Source
const DefaultCodexBackendBaseURL = "https://chatgpt.com/backend-api/codex"

Variables

This section is empty.

Functions

func NewDefaultMultiProvider

func NewDefaultMultiProvider() *agentsdk.MultiProvider

NewDefaultMultiProvider creates a MultiProvider with OpenAI and Anthropic registered and OpenAI as the default provider.

func NewProviderFromConfig

func NewProviderFromConfig(spec ProviderSpec) (agentsdk.ModelProvider, error)

func NewRunner

func NewRunner(model string) (*agentsdk.Runner, error)

NewRunner creates a Runner backed by the default provider set.

func NewRunnerFromConfig

func NewRunnerFromConfig(spec ProviderSpec) (*agentsdk.Runner, error)

Types

type ProviderSpec

type ProviderSpec struct {
	Provider                 string
	DefaultProvider          string
	Model                    string
	BaseURL                  string
	APIKey                   string
	AuthMode                 string
	APIMode                  string
	OpenAIOAuthPath          string
	OpenAIOAuthAccountID     string
	OpenAIOAuthAccountIDPath string
	OpenAIAuthSession        *sdkopenai.AuthSession
	ProviderAPIKeys          map[string]string
	ProviderBaseURLs         map[string]string
	ProviderAPIModes         map[string]string
	// ModelFallbacks is an ordered list of fallback model identifiers sent as
	// the OpenRouter "models" array so the provider retries the next model when
	// one is unavailable. Applies to OpenAI-compatible providers (openrouter,
	// gemini, groq, local, openai-api). Empty disables fallback routing.
	ModelFallbacks []string
}

Directories

Path Synopsis
Package anthropic exposes the Anthropic provider and client helpers as part of the public agent SDK surface.
Package anthropic exposes the Anthropic provider and client helpers as part of the public agent SDK surface.
Package openai exposes the OpenAI-compatible provider, client, and auth helpers as part of the public agent SDK surface.
Package openai exposes the OpenAI-compatible provider, client, and auth helpers as part of the public agent SDK surface.

Jump to

Keyboard shortcuts

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