Add image-gen module: Spring AI ImageModel options on the wire, a moderation gate, and safe storage of generated images in MinIO (sniffed content type, byte and pixel caps, server-chosen keys, capped URL fetcher); per-provider cost table dated 2026-10-28. ImageModel and ModerationModel are hand-written fakes; MinIO is real via Testcontainers; no image provider called.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b7rnC7jppGGdHGESvy
This commit is contained in:
2026-10-28 18:36:40 +00:00
co-authored by Claude Sonnet 5.5
parent 108fc44542
commit aa8b1604ed
48 changed files with 2112 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
# What OpenAiImageModel sends (mock server; bodies recorded as received)
1. ImagePrompt("a red bicycle"), model default only
POST /v1/images/generations
{"prompt":"a red bicycle","model":"gpt-image-test"}
2. OpenAiImageOptions size=1536x1024 quality=high n=2
{"prompt":"a red bicycle","model":"gpt-image-1-mini","n":2,"quality":"high","size":"1536x1024"}
3. portable ImageOptionsBuilder width=1024 height=1536
{"prompt":"a red bicycle","model":"gpt-image-test","size":"1024x1536"}
4. OpenAiImageOptions user=user-8f2c
{"prompt":"a red bicycle","model":"gpt-image-1-mini","user":"user-8f2c"}
5. OpenAiImageOptions responseFormat=b64_json
{"prompt":"a red bicycle","model":"gpt-image-1-mini","response_format":"b64_json"}
6a. ImagePrompt(List<ImageMessage>) with no options: IllegalArgumentException: image options cannot be null
6b. same two messages (weights 1.0 and -1.0) with empty OpenAiImageOptions
{"prompt":"a red bicycle","model":"gpt-image-1-mini"}