Versions in this module Expand all Collapse all v0 v0.4.3 Nov 9, 2026 v0.4.2 Nov 4, 2026 v0.4.1 Nov 4, 2026 v0.4.0 Nov 4, 2026 Changes in this version + const RankActive + var ErrExhausted = errors.New("LLM 轮询:所有配置均不可用") + type Member struct + Active bool + Format string + ID int64 + Model string + Name string + Priority int + Prov llm.Provider + Rank int + WindowTokens int + type Pool struct + func New(members []*Member, health *Registry) *Pool + func (p *Pool) Complete(ctx context.Context, req llm.CompletionRequest) (llm.Message, string, llm.Usage, error) + func (p *Pool) Head() *Member + func (p *Pool) Members() []*Member + func (p *Pool) Stream(ctx context.Context, req llm.CompletionRequest) iter.Seq2[llm.StreamEvent, error] + type Registry struct + func NewRegistry(persist func(id int64, st State), forget func(id int64)) *Registry + func (r *Registry) Get(id int64) State + func (r *Registry) IsOpen(id int64) bool + func (r *Registry) Pass(id int64) + func (r *Registry) Reset(id int64) + func (r *Registry) Restore(id int64, st State) + func (r *Registry) SetPolicy(softTrip int, cooldown time.Duration) + func (r *Registry) Snapshot() map[int64]State + func (r *Registry) Trip(id int64, errMsg string, hard bool) (tripped bool) + type State struct + Fails int + LastAt time.Time + LastError string + OpenUntil time.Time + Trips int + func (s State) Open() bool