summaryrefslogtreecommitdiff
path: root/internal/models
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-08 09:59:23 +0300
committerPaul Buetow <paul@buetow.org>2026-04-08 09:59:23 +0300
commit35a3c860f63403d14c83668dcdd017b6ef517fbf (patch)
tree1b348348fc951747d689cc62bd7bbbc42c94fa11 /internal/models
parentef1eefce9a1515a17490d6624ef88f2ef41330e1 (diff)
refactor(dip): inject archive, models, story, and gui at composition roots
Define Archiver, ModelLister, and StoryRunner interfaces in their packages. gui.New returns App; Application carries an injectable Archiver from Config. cmd/totalrecall wires default implementations via runDeps for tests and DI. Made-with: Cursor
Diffstat (limited to 'internal/models')
-rw-r--r--internal/models/lister.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/models/lister.go b/internal/models/lister.go
index 2f05988..08f4f0d 100644
--- a/internal/models/lister.go
+++ b/internal/models/lister.go
@@ -14,6 +14,12 @@ import (
"codeberg.org/snonux/totalrecall/internal/httpctx"
)
+// ModelLister lists available OpenAI and Gemini models to the configured
+// writer. *Lister satisfies this interface.
+type ModelLister interface {
+ ListAvailableModels() error
+}
+
type openAIModelLister interface {
ListModels(context.Context) (openai.ModelsList, error)
}
@@ -32,6 +38,8 @@ type Lister struct {
out io.Writer
}
+var _ ModelLister = (*Lister)(nil)
+
// NewLister creates a new model lister.
func NewLister(openAIKey, geminiKey string, out io.Writer) *Lister {
lister := &Lister{