ollie/backend/base.go

17 lines
550 B
Go

package backend
// baseBackend provides the shared fields and trivial accessors common to all
// backend implementations.
type baseBackend struct {
name string
model string
ctxLen int // cached context length
ctxModel string // model the cached value was fetched for
}
func (b *baseBackend) Name() string { return b.name }
func (b *baseBackend) Model() string { return b.model }
// SetModel changes the active model and invalidates the cached context length.
func (b *baseBackend) SetModel(m string) { b.model = m; b.ctxLen = 0 }