summaryrefslogtreecommitdiff
path: root/internal/image/openai.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-03 08:03:27 +0300
committerPaul Buetow <paul@buetow.org>2026-04-03 08:03:27 +0300
commitf4bc35c0a24766c8e9a155cbad5ffdaf088ec458 (patch)
treea9f1bb488bc7473549cb6e3552c531154841f0ef /internal/image/openai.go
parent63bd86d8046949e80e5b1122a1fcf717f51915c6 (diff)
task 00o: split ImageSearcher into ImageSearcher + AttributionProvider (ISP)
Introduce AttributionProvider interface with GetAttribution() separate from ImageSearcher so callers only needing search/download don't carry attribution. ImageClient composes both. Downloader.searcher and NewDownloader now take ImageClient since attribution is needed when saving downloaded files. Compile-time assertions updated to ImageClient. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/image/openai.go')
-rw-r--r--internal/image/openai.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/image/openai.go b/internal/image/openai.go
index 8623fcd..c277406 100644
--- a/internal/image/openai.go
+++ b/internal/image/openai.go
@@ -13,8 +13,9 @@ import (
"github.com/sashabaranov/go-openai"
)
-// Compile-time check that OpenAIClient implements the ImageSearcher interface.
-var _ ImageSearcher = (*OpenAIClient)(nil)
+// Compile-time check that OpenAIClient implements the full ImageClient interface
+// (ImageSearcher + AttributionProvider).
+var _ ImageClient = (*OpenAIClient)(nil)
// imageHTTPClient is a shared HTTP client with a generous timeout for image
// downloads. http.DefaultClient has no timeout, which can block goroutines