diff --git a/src/jarvis/tools/builtin/bot_browser.py b/src/jarvis/tools/builtin/bot_browser.py index c4ea82d..305be4e 100644 --- a/src/jarvis/tools/builtin/bot_browser.py +++ b/src/jarvis/tools/builtin/bot_browser.py @@ -479,8 +479,8 @@ class BotBrowserTool(Tool): elif action == "back": call = lambda s: s.back() elif action == "volume": - m = re.search(r"\d+(?:\.\d+)?", str(args.get("level") if args.get("level") is not None else "")) - if not m: + m = re.search(r"-?\d+(?:\.\d+)?", str(args.get("level") if args.get("level") is not None else "")) + if not m or float(m.group()) < 0: return _fail("volume needs a level from 0 to 100") level = min(100, round(float(m.group()))) call = lambda s: s.volume(level) diff --git a/src/jarvis/tools/builtin/bot_browser.spec.md b/src/jarvis/tools/builtin/bot_browser.spec.md index 6aba78c..b5aebf5 100644 --- a/src/jarvis/tools/builtin/bot_browser.spec.md +++ b/src/jarvis/tools/builtin/bot_browser.spec.md @@ -51,7 +51,7 @@ One tool, `action` picks the operation (read as its first known word, so `open_p | `click` | `target` | clicks the link or button whose label is `target` (an exact label first, else the one containing it; `[n]` from the last list also works) | | `type` | `text` or `query` (`field`, `submit`) | types into the field whose label, placeholder or name contains `field` (else the focused field, else the first search or text box); `submit` presses Enter | | `back` | | goes back one page | -| `volume` | `level` | sets the sound of the page to `level` (0 to 100, the first number in it, above 100 is 100): every `