providers

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuiltInProviders = map[string]ProviderDefinition{
	"anthropic": {
		Name:           "Native Anthropic",
		BaseURL:        "",
		Model:          "",
		RequiresAPIKey: false,
	},
	"zai": {
		Name:           "Z.AI",
		BaseURL:        "https://api.z.ai/api/anthropic",
		Model:          "glm-4.7",
		RequiresAPIKey: true,
		EnvVars:        []string{"ANTHROPIC_DEFAULT_HAIKU_MODEL=glm-4.5-air"},
	},
	"minimax": {
		Name:           "MiniMax",
		BaseURL:        "https://api.minimax.io/anthropic",
		Model:          "Minimax-M2.1",
		RequiresAPIKey: true,
		EnvVars: []string{
			"ANTHROPIC_SMALL_FAST_MODEL_TIMEOUT=120",
			"ANTHROPIC_SMALL_FAST_MAX_TOKENS=24576",
		},
	},
	"kimi": {
		Name:           "Moonshot AI",
		BaseURL:        "https://api.kimi.com/coding/",
		Model:          "kimi-for-coding",
		RequiresAPIKey: true,
		EnvVars: []string{
			"ANTHROPIC_SMALL_FAST_MODEL_TIMEOUT=240",
			"ANTHROPIC_SMALL_FAST_MAX_TOKENS=200000",
		},
	},
	"deepseek": {
		Name:           "DeepSeek AI",
		BaseURL:        "https://api.deepseek.com/anthropic",
		Model:          "deepseek-chat",
		RequiresAPIKey: true,
		EnvVars: []string{
			"API_TIMEOUT_MS=600000",
			"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1",
		},
	},
	"custom": {
		Name:           "Custom Provider",
		BaseURL:        "",
		Model:          "",
		RequiresAPIKey: true,
	},
}

BuiltInProviders contains the definitions of all supported built-in providers.

Functions

func GetProviderList

func GetProviderList() []string

GetProviderList returns a list of all built-in provider names.

func IsBuiltInProvider

func IsBuiltInProvider(name string) bool

IsBuiltInProvider returns true if the given name is a built-in provider.

func RequiresAPIKey

func RequiresAPIKey(name string) bool

RequiresAPIKey returns true if the provider requires an API key to configure.

Types

type ProviderDefinition

type ProviderDefinition struct {
	Name           string
	BaseURL        string
	Model          string
	EnvVars        []string
	RequiresAPIKey bool
}

ProviderDefinition contains the configuration for a provider.

func GetBuiltInProvider

func GetBuiltInProvider(name string) (ProviderDefinition, bool)

GetBuiltInProvider returns the provider definition and whether it exists.

Jump to

Keyboard shortcuts

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