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:
@@ -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"}
|
||||
Reference in New Issue
Block a user