summaryrefslogtreecommitdiff
path: root/internal/image
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-08 09:55:02 +0300
committerPaul Buetow <paul@buetow.org>2026-04-08 09:55:02 +0300
commitf486e9c677c72a409df8696104661847354286df (patch)
tree8f1b9aef0a74d33a65f1f47f2bdf3c9705fc8474 /internal/image
parentcd4265b8f87811db758c89bab5e62daa6c39337a (diff)
refactor: registry pattern for audio and image provider factories
Add internal/registry generic Registry[K,T] for keyed factory registration. Wire audio.NewProvider via registered per-provider constructors; GUI and processor newImageSearcher use registries of *Orchestrator/*Processor methods. Export image.ImageProviderOpenAI and ImageProviderNanoBanana from search.go and use them across gui to avoid duplicate string constants. Made-with: Cursor
Diffstat (limited to 'internal/image')
-rw-r--r--internal/image/search.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/image/search.go b/internal/image/search.go
index 61176cd..73a620a 100644
--- a/internal/image/search.go
+++ b/internal/image/search.go
@@ -77,6 +77,14 @@ type ImageClient interface {
AttributionProvider
}
+// Image-generation provider names (AI backends). Use these keys when
+// registering GUI/processor image client factories so string literals are not
+// scattered across packages.
+const (
+ ImageProviderOpenAI = "openai"
+ ImageProviderNanoBanana = "nanobanana"
+)
+
// PromptAwareClient extends ImageClient with a callback for receiving the
// generated image prompt before the actual image download begins. Both
// OpenAIClient and NanoBananaClient implement this interface. It is the