feat(aionrs): inline image attachments for Aion CLI#589
Draft
s-yanev wants to merge 1 commit into
Draft
Conversation
Convert attached image file paths to base64 data URIs before passing the user message to the aionrs engine. This enables the Aion CLI backend to send images to the LLM provider using the new image content block support in aionrs. Requires aionrs with image content block support. - crates/aionui-ai-agent/src/manager/aionrs/agent.rs - crates/aionui-ai-agent/src/manager/aionrs/history_sanitize.rs Co-Authored-By: Claude <noreply@anthropic.com>
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.
Summary
This PR enables image attachments to work with the Aion CLI backend by converting attached image file paths to base64 data URIs before passing the message to the aionrs engine.
Depends on
This change requires aionrs to support image content blocks first:
Once that PR is merged and a new aionrs tag is released, this PR should be updated to point
Cargo.tomlto the new aionrs version.How it works
When a user attaches an image to an Aion CLI conversation:
user text\n\n[[AION_FILES]]\n/path/to/image.pngplus afilesarrayenrich_content_with_files()reads the image, base64-encodes it, and replaces the path withdata:image/png;base64,...Files changed
crates/aionui-ai-agent/src/manager/aionrs/agent.rsenrich_content_with_files()to inline image file paths as data URIscrates/aionui-ai-agent/src/manager/aionrs/history_sanitize.rsContentBlock::Imagein history sanitizationTesting