Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

zhcn
Copy link
Contributor

@zhcn zhcn commented Sep 2, 2025

…form.
When setting up task in browseruse, add a parameter for annotating images, enabling browseruse to recognize some interactive components on web pages.


Summary by cubic

Add optional sample_images to Agent and message flow to include annotated example images in the vision prompt, helping the agent recognize interactive UI components. When provided, these images are inserted before screenshots; behavior is unchanged if omitted.

  • New Features
    • Agent and MessageManager accept sample_images.
    • Prompts inject sample_images into the user message ahead of screenshots.
    • Defaults to None for backward compatibility.

@CLAassistant
Copy link

CLAassistant commented Sep 2, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 3 files


Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@zhcn zhcn force-pushed the feature/sample_images branch from fdb468a to f68c086 Compare September 2, 2025 04:34
@MagMueller
Copy link
Collaborator

Awesome - can you add an example with a dummy image into
https://github.com/browser-use/browser-use/blob/main/examples/features/

@MagMueller MagMueller merged commit 2d84ff6 into browser-use:main Sep 3, 2025
48 checks passed

# Add sample images
content_parts.extend(self.sample_images)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Vision Mode Fails to Use Sample Images

sample_images are not included in the prompt when vision is enabled but no current screenshots exist. The logic for adding sample_images is incorrectly gated by the presence of self.screenshots, preventing them from serving as intended training examples.

Fix in Cursor Fix in Web

@zhcn
Copy link
Contributor Author

zhcn commented Sep 4, 2025

Awesome - can you add an example with a dummy image into https://github.com/browser-use/browser-use/blob/main/examples/features/

The example supplementation has been completed, and the corresponding pull request is: #2949. Please kindly review and provide any suggestions for further optimization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants