Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up state #825

Merged
merged 23 commits into from
Feb 23, 2025
Merged

Clean up state #825

merged 23 commits into from
Feb 23, 2025

Conversation

MagMueller
Copy link
Collaborator

This pull request includes several changes to the browser_use package, focusing on refactoring the MessageManager class and updating the SystemPrompt class to load prompt templates from a markdown file. Additionally, there are updates to the test cases to align with the refactored code.

Refactoring and improvements:

  • browser_use/agent/message_manager/service.py: Removed unnecessary page summary from the current_state dictionary in _init_messages and added error handling for trailing newlines and extracting only the last line of the error in add_state_message. [1] [2]

  • browser_use/agent/prompts.py: Refactored SystemPrompt to load prompt templates from a markdown file using importlib.resources and removed hardcoded rules and input format methods. [1] [2]

Updates to test cases:

New markdown file for prompt templates:

@MagMueller MagMueller merged commit fbecf32 into main Feb 23, 2025
3 checks passed
AryamanParida pushed a commit to AryamanParida/browser-use that referenced this pull request Mar 7, 2025
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.

1 participant