- Changed the image placeholder format from a numbered format (e.g., '[Image #1]') to a single generic placeholder ('[Image]') for consistency and simplicity in the result text processing.
- Updated the extraction of `query`, `extract_links`, and `start_from_char` parameters to handle cases where `params` can be either a dictionary or an object, improving flexibility and robustness in the Tools class.
- Updated the logging messages for dropdown options to be more concise and clear.
- Adjusted error messages in the Tools class to reflect the action of typing text instead of inputting it, enhancing clarity in debugging logs.
- Updated the `write_file` action to include detailed documentation on supported file formats (.txt, .md, .json, .jsonl, .csv, .pdf) and conversion process for PDF files.
- Refined the `text` field description in `DoneAction` to clarify the expected format for user summaries.
- Improved the `success` field description in `StructuredOutputAction` to specify its meaning more clearly.
These changes aim to enhance clarity and usability for developers interacting with the API.
The action_wrapper now delegates to act() instead of calling registry.execute_action() directly.
This ensures:
- Consistent error handling (returns ActionResult with error, not raw exceptions)
- Consistent result normalization (always returns ActionResult)
- Full observability (Laminar spans, logging)
- Proper handling of BrowserError and TimeoutError
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Enable simpler, more ergonomic action calls in tests and direct usage:
- Old API: tools.act(NavigateActionModel(navigate=GoToUrlAction(...)), browser_session)
- New API: tools.navigate(url=..., browser_session=browser_session)
Implementation:
- Added __getattr__ method to Tools class that dynamically creates action wrappers
- Delegates to existing registry.execute_action() to avoid code duplication
- Works with all Tools subclasses (Tools, CodeAgentTools, custom subclasses)
- Works with custom registered actions
- Maintains full backward compatibility with existing act() API
Benefits:
- Significantly reduces boilerplate in tests
- More intuitive and Pythonic API
- All existing code continues to work unchanged
- No code duplication (delegates to registry)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>