[PoC] feat(tools): images through tool results + MCP bridge - #38
Open
ayman3000 wants to merge 1 commit into
Open
[PoC] feat(tools): images through tool results + MCP bridge#38ayman3000 wants to merge 1 commit into
ayman3000 wants to merge 1 commit into
Conversation
Lets a tool return images (e.g. a browser screenshot) that reach a vision model on the next turn, instead of being dropped. - AgentToolResult gains `images: [LLMImage]` (default []), Codable/Equatable; `.success(…, images:)` convenience. - MCPToolBridge.execute now captures `.image` content items (base64 → LLMImage) instead of dropping everything but text — the ingestion point for a chrome-devtools screenshot. - AgentMessage.toLLMMessages() forwards tool-result images onto the `.tool` LLMMessage (uses the full LLMMessage initializer, so it builds against the released LLMProviderKit). Tests: images survive Codable; toLLMMessages forwards them; text-only carries none. Encoding to a provider's wire format is proven in LLMProviderKit. PoC: pairs with LLMProviderKit feat/tool-result-images. Runtime image encoding needs that published; provider generalization + Naseem integration follow. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
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.
Proof-of-concept — the framework plumbing so a tool (native or MCP) can return an image that reaches a vision model on the next turn. Pairs with LLMProviderKit
feat/tool-result-images.Changes
AgentToolResultgainsimages: [LLMImage](default[], Codable/Equatable) +.success(…, images:).MCPToolBridge.executecaptures.imagecontent (base64 →LLMImage) instead of dropping all non-text — the ingestion point for a chrome-devtools screenshot.AgentMessage.toLLMMessages()forwards tool-result images onto the.toolLLMMessage(via the full initializer, so it builds against released LLMProviderKit).Status / scope
toLLMMessagesforwards them, text-only carries none.VisionRouting.canSee, since models can't swap mid-run). Provider generalization beyond Anthropic tracked in the LLMProviderKit PR.🤖 Generated with Claude Code