feat: Add save parameter to image_search for downloading images to workspace#99
feat: Add save parameter to image_search for downloading images to workspace#99devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…to workspace Add an optional `save` boolean parameter to the image_search tool. When save: true, downloads each image (full-size original URL, falling back to thumbnail) and persists it to the iCloud Drive workspace under downloads/images/ with filenames derived from the query. - Tool schema updated with the new `save` parameter - System prompt updated to instruct the model when to use save: true - Downloads run concurrently via DispatchGroup, failures are skipped gracefully (logged, never crash the search) - Saved file paths included in the tool result for model reference - Gallery rendering unchanged when save is false (default) Co-Authored-By: bot_apk <apk@cognition.ai>
Original prompt from API User
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary
Adds an optional
save: Boolparameter toimage_search(defaultfalse). Whentrue, after fetching SerpAPI results and rendering the gallery as usual, the skill downloads each image's full-size original URL and persists it to the iCloud Drive workspace underdownloads/images/<sanitized_query>_<index>.jpg.Key design points:
save: false(default) is identical to the old behavior. Gallery rendering is always intact.DispatchGroup— each image downloads in parallel with a 15s timeout. Failures (network errors, non-2xx, invalid URLs) are logged and skipped; the search never crashes.Workspace.shared.resolve+coordinatedWrite+coordinatedCreateDirectoryso files land correctly on both iCloud and local-fallback backends.Saved N image(s) to workspace:section with workspace-relative paths (e.g.downloads/images/golden_retriever_1.jpg) so the model can reference them or callshare_file._/-, capped at 60 chars. Extension derived from the source URL, defaulting to.jpg.save: truewhen users ask to save/download/keep images.Link to Devin session: https://app.devin.ai/sessions/254ea52d907048e19130d26ef462e47e