From f4bc35c0a24766c8e9a155cbad5ffdaf088ec458 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 3 Apr 2026 08:03:27 +0300 Subject: 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 --- internal/image/openai.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'internal/image/openai.go') 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 -- cgit v1.2.3