routing

package
v0.2.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidModelRef  = fmt.Errorf("routing: invalid model reference: %w", commonerrors.ErrValidation)
	ErrUnknownPoolAlias = fmt.Errorf("routing: unknown pool alias: %w", commonerrors.ErrValidation)
	ErrAmbiguousModel   = fmt.Errorf("routing: ambiguous model: %w", commonerrors.ErrValidation)
	ErrModelDenied      = errors.New("routing: model denied")
)

Functions

This section is empty.

Types

type Candidate

type Candidate struct {
	Registry *registrydomain.Registry
	Allowed  []string
	Default  string
	Model    string
	Sources  []string
}

func (Candidate) AllowsModel

func (c Candidate) AllowsModel(model string) bool

type CandidateSet

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

func NewCandidateSet

func NewCandidateSet() *CandidateSet

func (*CandidateSet) Add

func (s *CandidateSet) Add(c Candidate)

func (*CandidateSet) Candidates

func (s *CandidateSet) Candidates() []Candidate

func (*CandidateSet) ForRegistry

func (s *CandidateSet) ForRegistry(id ids.RegistryID) (Candidate, bool)

func (*CandidateSet) HasRegistry

func (s *CandidateSet) HasRegistry(id ids.RegistryID) bool

func (*CandidateSet) Len

func (s *CandidateSet) Len() int

func (*CandidateSet) Registries

func (s *CandidateSet) Registries() []*registrydomain.Registry

func (*CandidateSet) ResolveIntent

func (s *CandidateSet) ResolveIntent(intent Intent) (*CandidateSet, error)

type Intent

type Intent struct {
	Provider  string
	Model     string
	PoolAlias string
}

func ParseModelRef

func ParseModelRef(ref string) (Intent, error)

func (Intent) IsPool

func (i Intent) IsPool() bool

func (Intent) IsQualified

func (i Intent) IsQualified() bool

func (Intent) IsShortModel

func (i Intent) IsShortModel() bool

func (Intent) IsZero

func (i Intent) IsZero() bool

Jump to

Keyboard shortcuts

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