Repository navigation
feat: image inputs for OpenAI Decisions and Cloudflare Clef - #9
Merged
Merged
Conversation
New images: option, a list of base64 data URLs (SystemOneClient.image_data_url/2
builds one from bytes). Both providers see the images before the state:
- openai: input becomes one user message with input_image parts followed by the
state as input_text
- cloudflare: the top-level images array, Clef's extension to System One
SystemOneClient.Images validates before any request: data URLs only (no remote
URLs), Clef's 4-image / PNG-JPEG-WebP / 4 MiB each / 8 MiB total limits, and
{:unsupported_option, :images, provider} for providers without image support.
Telemetry adds image_count. Version 0.3.0.
Closes #3.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GCRzC1xV9gCW4bf7LzBGcB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3.
Adds an
images:option: a list of base64 data URLs, withSystemOneClient.image_data_url/2to build one from bytes. It works with the two providers whose APIs accept images, and both see the images before the state.:openaiinputbecomes one user message:input_imageparts, then the state asinput_text:cloudflareimagesarray next tostate(schema):typesafe,:openrouter,:compatible{:error, {:unsupported_option, :images, provider}}, no request sentSystemOneClient.Imagesvalidates before any request: data URLs only, since neither API accepts remote URLs. For Clef it also enforces the documented limits of 4 PNG, JPEG or WebP images, 4 MiB each and 8 MiB in total once decoded. Telemetry metadata gainsimage_count, never image data.Testing
Req.Test, local rejection, and telemetry.credo --strict, Dialyzer (0 errors),docs --warnings-as-errors, format, warnings-as-errors.red(0.97) and a blue PNGblue(1.0); two images in one request came backred_then_blue(0.96), so order is preserved. Each image costs about 300 input tokens. A remote URL was rejected locally.Version 0.3.0, README section, CHANGELOG (unreleased).
🤖 Generated with Claude Code
https://claude.ai/code/session_01GCRzC1xV9gCW4bf7LzBGcB