routing

package
v0.105.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CatalogModels

func CatalogModels(infos []ai.ModelInfo) []config.ModelInfoLite

func ClientForProvider

func ClientForProvider(prov config.Provider, name string, maxRetries int) (ai.Client, error)

func ClientForProviderContext added in v0.103.0

func ClientForProviderContext(ctx context.Context, prov config.Provider, name string, maxRetries int) (ai.Client, error)

func ClientForProviderOptional

func ClientForProviderOptional(prov config.Provider, name string, maxRetries int) (ai.Client, error)

func ClientForProviderOptionalContext added in v0.103.0

func ClientForProviderOptionalContext(ctx context.Context, prov config.Provider, name string, maxRetries int) (ai.Client, error)

func DefaultEffortFor

func DefaultEffortFor(catalogs map[string]config.Catalog, provName, modelID, pinned string) string

func RefreshCatalogs

func RefreshCatalogs(cfg *config.Config, force bool) map[string]config.Catalog

func RefreshCatalogsContext added in v0.103.0

func RefreshCatalogsContext(parent context.Context, cfg *config.Config, force bool) map[string]config.Catalog

func ResolveWithRefresh

func ResolveWithRefresh(cfg *config.Config, modelName, provName string) (config.Provider, config.Model, string, error)

func ResolveWithRefreshContext added in v0.103.0

func ResolveWithRefreshContext(ctx context.Context, cfg *config.Config, modelName, provName string) (config.Provider, config.Model, string, error)

func ResolvedProvider

func ResolvedProvider(cfg *config.Config, model, prov string) string

func SelectionNames

func SelectionNames(cfg *config.Config, mdl config.Model, modelName, provName string) (string, string)

func SubModelFor

func SubModelFor(cfg *config.Config, model, provider string) (agent.SubModel, error)

func SubModelForContext added in v0.103.0

func SubModelForContext(ctx context.Context, cfg *config.Config, model, provider string) (agent.SubModel, error)

func SupportsVision added in v0.103.0

func SupportsVision(cfg *config.Config, modelName, modelID string, catalogs map[string]config.Catalog, provider string) bool

func TaskDefaultFor

func TaskDefaultFor(cfg *config.Config) (agent.SubModel, error)

func TaskDefaultForContext added in v0.103.0

func TaskDefaultForContext(ctx context.Context, cfg *config.Config) (agent.SubModel, error)

func TokenLimits

func TokenLimits(mdl config.Model, cat config.Catalog, apiID string) (contextLimit, maxOut int)

Types

type Route

type Route struct {
	ModelName    string
	ProviderName string
	Provider     config.Provider
	Model        config.Model
	APIModel     string
	Client       ai.Client
	ContextLimit int
	MaxOutput    int
	Vision       bool
}

func ResolveRoute

func ResolveRoute(cfg *config.Config, modelName, providerName string, optional bool) (Route, error)

func ResolveRouteContext added in v0.103.0

func ResolveRouteContext(ctx context.Context, cfg *config.Config, modelName, providerName string, optional bool) (Route, error)

func (Route) AgentModel added in v0.103.0

func (r Route) AgentModel() agent.ModelConfig

func (Route) Configured

func (r Route) Configured() bool

Jump to

Keyboard shortcuts

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