Skip to content

Commit 7838485

Browse files
Relax screenshot tool schema required fields
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent 360aa74 commit 7838485

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

hyperbrowser/tools/schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def get_scrape_options(formats: Optional[List[scrape_types]] = None):
5959
},
6060
"scrape_options": get_scrape_options(["screenshot"]),
6161
},
62-
"required": ["url", "scrape_options"],
62+
"required": ["url"],
6363
"additionalProperties": False,
6464
}
6565

tests/test_tool_schema.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
from typing import get_args
22

33
from hyperbrowser.models.consts import BrowserUseLlm
4-
from hyperbrowser.tools.schema import BROWSER_USE_LLM_SCHEMA, BROWSER_USE_SCHEMA, EXTRACT_SCHEMA
4+
from hyperbrowser.tools.schema import (
5+
BROWSER_USE_LLM_SCHEMA,
6+
BROWSER_USE_SCHEMA,
7+
CRAWL_SCHEMA,
8+
EXTRACT_SCHEMA,
9+
SCRAPE_SCHEMA,
10+
SCREENSHOT_SCHEMA,
11+
)
512

613

714
def test_browser_use_llm_schema_matches_sdk_literals():
@@ -14,3 +21,9 @@ def test_extract_schema_requires_only_urls():
1421

1522
def test_browser_use_schema_requires_only_task():
1623
assert BROWSER_USE_SCHEMA["required"] == ["task"]
24+
25+
26+
def test_scrape_related_tool_schemas_require_only_url():
27+
assert SCRAPE_SCHEMA["required"] == ["url"]
28+
assert SCREENSHOT_SCHEMA["required"] == ["url"]
29+
assert CRAWL_SCHEMA["required"] == ["url"]

0 commit comments

Comments
 (0)