fix: pass images as multimodal content instead of file-based Read tool#54
Open
buuzzy wants to merge 1 commit intoworkany-ai:devfrom
Open
fix: pass images as multimodal content instead of file-based Read tool#54buuzzy wants to merge 1 commit intoworkany-ai:devfrom
buuzzy wants to merge 1 commit intoworkany-ai:devfrom
Conversation
Images were saved to disk and the agent was instructed to use the Read tool to view them. But the SDK's Read tool returns only a placeholder string for image files, so the model never sees the actual image. Now images are passed directly as multimodal content blocks in the prompt, which the LLM provider converts to the appropriate API format.
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.
Problem: Images saved to disk → agent told to Read them → SDK Read tool returns
[Image file: path (size bytes)]placeholder → model never sees the image.Fix: Pass images directly as
{ type: 'image', source: { type: 'base64', ... } }content blocks. The LLM provider converts these to the appropriate API format (OpenAIimage_url/ Anthropic native).Depends on open-agent-sdk#14 for OpenAI-compatible endpoints.