provider

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSupportedType

func IsSupportedType(name string) bool

IsSupportedType defers to litellm rather than keeping its own list. Type "gateway" reaches a litellm gateway that holds the keys and makes the calls, so codebot can run where keys must not live, such as a sandbox.

func NewModelFactory

func NewModelFactory(models *Models, clientOpts ...litellm.ClientOption) func(ModelSpec) (agentcore.Model, error)

NewModelFactory names each provider as configured, so replay state goes back only to the endpoint that issued it.

func Thinking

func Thinking(effort string) *litellm.Thinking

func ThinkingLevels

func ThinkingLevels(client *litellm.Client, reasoning *bool) []string

ThinkingLevels returns the efforts a user may pick. reasoning comes from the model list and is nil when unknown. "" is always offered; the others only if the model may reason and the provider can send that setting. Which efforts a reasoning model accepts is left to the vendor.

func ValidEffort

func ValidEffort(effort string) bool

func WithCacheKey

func WithCacheKey(model agentcore.Model, key string) agentcore.Model

WithCacheKey sets prompt_cache_key only on providers that accept it; others reject options they do not know.

Types

type ModelSpec

type ModelSpec struct {
	// Type is the litellm provider that Provider speaks; they differ for
	// custom providers.
	Provider string
	Type     string
	Model    string
	Conn     llmprovider.Config
}

type Models

type Models struct {
	// contains filtered or unexported fields
}

Models serves the built-in snapshot until Refresh loads a current list.

func NewModels

func NewModels() *Models

func (*Models) Lookup

func (m *Models) Lookup(spec ModelSpec) (catalog.Model, bool)

Lookup uses provider.CatalogName for built-in types. Compat providers reach vendors litellm does not know, so it then tries the provider name as the vendor prefix (e.g. "moonshot/<model>"), then the bare model name.

func (*Models) Refresh

func (m *Models) Refresh(cacheDir string)

Refresh runs in the background and reuses the copy in cacheDir while it is under a day old.

Jump to

Keyboard shortcuts

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