hyperbrowser 0.34.0__tar.gz → 0.36.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of hyperbrowser might be problematic. Click here for more details.
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/PKG-INFO +1 -1
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/tools/__init__.py +20 -3
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/tools/anthropic.py +7 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/tools/openai.py +11 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/tools/schema.py +51 -22
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/pyproject.toml +1 -1
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/LICENSE +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/README.md +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/__init__.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/async_client.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/base.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/async_manager/agents/__init__.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/async_manager/agents/browser_use.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/async_manager/crawl.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/async_manager/extension.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/async_manager/extract.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/async_manager/profile.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/async_manager/scrape.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/async_manager/session.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/sync_manager/agents/__init__.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/sync_manager/agents/browser_use.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/sync_manager/crawl.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/sync_manager/extension.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/sync_manager/extract.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/sync_manager/profile.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/sync_manager/scrape.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/sync_manager/session.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/sync.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/config.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/exceptions.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/models/__init__.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/models/agents/browser_use.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/models/consts.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/models/crawl.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/models/extension.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/models/extract.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/models/profile.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/models/scrape.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/models/session.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/transport/async_transport.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/transport/base.py +0 -0
- {hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/transport/sync.py +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from hyperbrowser.models.
|
|
2
|
+
from hyperbrowser.models.agents.browser_use import StartBrowserUseTaskParams
|
|
3
3
|
from hyperbrowser.models.crawl import StartCrawlJobParams
|
|
4
4
|
from hyperbrowser.models.extract import StartExtractJobParams
|
|
5
5
|
from hyperbrowser.models.scrape import StartScrapeJobParams
|
|
@@ -9,12 +9,14 @@ from .openai import (
|
|
|
9
9
|
BROWSER_USE_TOOL_OPENAI,
|
|
10
10
|
EXTRACT_TOOL_OPENAI,
|
|
11
11
|
SCRAPE_TOOL_OPENAI,
|
|
12
|
+
SCREENSHOT_TOOL_OPENAI,
|
|
12
13
|
CRAWL_TOOL_OPENAI,
|
|
13
14
|
)
|
|
14
15
|
from .anthropic import (
|
|
15
16
|
BROWSER_USE_TOOL_ANTHROPIC,
|
|
16
17
|
EXTRACT_TOOL_ANTHROPIC,
|
|
17
18
|
SCRAPE_TOOL_ANTHROPIC,
|
|
19
|
+
SCREENSHOT_TOOL_ANTHROPIC,
|
|
18
20
|
CRAWL_TOOL_ANTHROPIC,
|
|
19
21
|
)
|
|
20
22
|
|
|
@@ -34,6 +36,21 @@ class WebsiteScrapeTool:
|
|
|
34
36
|
return resp.data.markdown if resp.data and resp.data.markdown else ""
|
|
35
37
|
|
|
36
38
|
|
|
39
|
+
class WebsiteScreenshotTool:
|
|
40
|
+
openai_tool_definition = SCREENSHOT_TOOL_OPENAI
|
|
41
|
+
anthropic_tool_definition = SCREENSHOT_TOOL_ANTHROPIC
|
|
42
|
+
|
|
43
|
+
@staticmethod
|
|
44
|
+
def runnable(hb: Hyperbrowser, params: dict) -> str:
|
|
45
|
+
resp = hb.scrape.start_and_wait(params=StartScrapeJobParams(**params))
|
|
46
|
+
return resp.data.screenshot if resp.data and resp.data.screenshot else ""
|
|
47
|
+
|
|
48
|
+
@staticmethod
|
|
49
|
+
async def async_runnable(hb: AsyncHyperbrowser, params: dict) -> str:
|
|
50
|
+
resp = await hb.scrape.start_and_wait(params=StartScrapeJobParams(**params))
|
|
51
|
+
return resp.data.screenshot if resp.data and resp.data.screenshot else ""
|
|
52
|
+
|
|
53
|
+
|
|
37
54
|
class WebsiteCrawlTool:
|
|
38
55
|
openai_tool_definition = CRAWL_TOOL_OPENAI
|
|
39
56
|
anthropic_tool_definition = CRAWL_TOOL_ANTHROPIC
|
|
@@ -88,14 +105,14 @@ class BrowserUseTool:
|
|
|
88
105
|
|
|
89
106
|
@staticmethod
|
|
90
107
|
def runnable(hb: Hyperbrowser, params: dict) -> str:
|
|
91
|
-
resp = hb.
|
|
108
|
+
resp = hb.agents.browser_use.start_and_wait(
|
|
92
109
|
params=StartBrowserUseTaskParams(**params)
|
|
93
110
|
)
|
|
94
111
|
return resp.data.final_result if resp.data and resp.data.final_result else ""
|
|
95
112
|
|
|
96
113
|
@staticmethod
|
|
97
114
|
async def async_runnable(hb: AsyncHyperbrowser, params: dict) -> str:
|
|
98
|
-
resp = await hb.
|
|
115
|
+
resp = await hb.agents.browser_use.start_and_wait(
|
|
99
116
|
params=StartBrowserUseTaskParams(**params)
|
|
100
117
|
)
|
|
101
118
|
return resp.data.final_result if resp.data and resp.data.final_result else ""
|
|
@@ -6,6 +6,7 @@ from hyperbrowser.tools.schema import (
|
|
|
6
6
|
CRAWL_SCHEMA,
|
|
7
7
|
EXTRACT_SCHEMA,
|
|
8
8
|
SCRAPE_SCHEMA,
|
|
9
|
+
SCREENSHOT_SCHEMA,
|
|
9
10
|
)
|
|
10
11
|
|
|
11
12
|
|
|
@@ -54,6 +55,12 @@ SCRAPE_TOOL_ANTHROPIC: ToolParam = {
|
|
|
54
55
|
"description": "Scrape content from a webpage and return the content in markdown format",
|
|
55
56
|
}
|
|
56
57
|
|
|
58
|
+
SCREENSHOT_TOOL_ANTHROPIC: ToolParam = {
|
|
59
|
+
"input_schema": SCREENSHOT_SCHEMA,
|
|
60
|
+
"name": "screenshot_webpage",
|
|
61
|
+
"description": "Scrape content from a webpage and return the content in screenshot format",
|
|
62
|
+
}
|
|
63
|
+
|
|
57
64
|
CRAWL_TOOL_ANTHROPIC: ToolParam = {
|
|
58
65
|
"input_schema": CRAWL_SCHEMA,
|
|
59
66
|
"name": "crawl_website",
|
|
@@ -6,6 +6,7 @@ from hyperbrowser.tools.schema import (
|
|
|
6
6
|
CRAWL_SCHEMA,
|
|
7
7
|
EXTRACT_SCHEMA,
|
|
8
8
|
SCRAPE_SCHEMA,
|
|
9
|
+
SCREENSHOT_SCHEMA,
|
|
9
10
|
)
|
|
10
11
|
|
|
11
12
|
FunctionParameters: TypeAlias = Dict[str, object]
|
|
@@ -63,6 +64,16 @@ SCRAPE_TOOL_OPENAI: ChatCompletionToolParam = {
|
|
|
63
64
|
},
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
SCREENSHOT_TOOL_OPENAI: ChatCompletionToolParam = {
|
|
68
|
+
"type": "function",
|
|
69
|
+
"function": {
|
|
70
|
+
"name": "screenshot_webpage",
|
|
71
|
+
"description": "Scrape content from a webpage and return the content in screenshot format",
|
|
72
|
+
"parameters": SCREENSHOT_SCHEMA,
|
|
73
|
+
"strict": True,
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
|
|
66
77
|
CRAWL_TOOL_OPENAI: ChatCompletionToolParam = {
|
|
67
78
|
"type": "function",
|
|
68
79
|
"function": {
|
|
@@ -1,38 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
from typing import Literal, List
|
|
2
|
+
|
|
3
|
+
scrape_types = Literal["markdown", "screenshot"]
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def get_scrape_options(formats: List[scrape_types] = ["markdown"]):
|
|
7
|
+
return {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"description": "The options for the scrape",
|
|
10
|
+
"properties": {
|
|
11
|
+
"formats": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"description": "The format of the content to scrape",
|
|
14
|
+
"items": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"enum": formats,
|
|
17
|
+
},
|
|
9
18
|
},
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
"include_tags": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"items": {"type": "string"},
|
|
22
|
+
"description": "An array of HTML tags, classes, or IDs to include in the scraped content. Only elements matching these selectors will be returned.",
|
|
23
|
+
},
|
|
24
|
+
"exclude_tags": {
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": {"type": "string"},
|
|
27
|
+
"description": "An array of HTML tags, classes, or IDs to exclude from the scraped content. Elements matching these selectors will be omitted from the response.",
|
|
28
|
+
},
|
|
29
|
+
"only_main_content": {
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
"description": "Whether to only return the main content of the page. If true, only the main content of the page will be returned, excluding any headers, navigation menus,footers, or other non-main content.",
|
|
16
32
|
},
|
|
17
|
-
"description": "An array of HTML tags, classes, or IDs to exclude from the scraped content. Elements matching these selectors will be omitted from the response.",
|
|
18
33
|
},
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
34
|
+
"required": [
|
|
35
|
+
"include_tags",
|
|
36
|
+
"exclude_tags",
|
|
37
|
+
"only_main_content",
|
|
38
|
+
"formats",
|
|
39
|
+
],
|
|
40
|
+
"additionalProperties": False,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
SCRAPE_SCHEMA = {
|
|
45
|
+
"type": "object",
|
|
46
|
+
"properties": {
|
|
47
|
+
"url": {
|
|
48
|
+
"type": "string",
|
|
49
|
+
"description": "The URL of the website to scrape",
|
|
22
50
|
},
|
|
51
|
+
"scrape_options": get_scrape_options(),
|
|
23
52
|
},
|
|
24
|
-
"required": ["
|
|
53
|
+
"required": ["url", "scrape_options"],
|
|
25
54
|
"additionalProperties": False,
|
|
26
55
|
}
|
|
27
56
|
|
|
28
|
-
|
|
57
|
+
SCREENSHOT_SCHEMA = {
|
|
29
58
|
"type": "object",
|
|
30
59
|
"properties": {
|
|
31
60
|
"url": {
|
|
32
61
|
"type": "string",
|
|
33
62
|
"description": "The URL of the website to scrape",
|
|
34
63
|
},
|
|
35
|
-
"scrape_options":
|
|
64
|
+
"scrape_options": get_scrape_options(["screenshot"]),
|
|
36
65
|
},
|
|
37
66
|
"required": ["url", "scrape_options"],
|
|
38
67
|
"additionalProperties": False,
|
|
@@ -71,7 +100,7 @@ CRAWL_SCHEMA = {
|
|
|
71
100
|
},
|
|
72
101
|
"description": "An array of regular expressions or wildcard patterns specifying which URLs should be included in the crawl. Only pages whose URLs' path match one of these path patterns will be visited. Example: ['/admin', '/careers/*']",
|
|
73
102
|
},
|
|
74
|
-
"scrape_options":
|
|
103
|
+
"scrape_options": get_scrape_options(),
|
|
75
104
|
},
|
|
76
105
|
"required": [
|
|
77
106
|
"url",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/async_manager/crawl.py
RENAMED
|
File without changes
|
{hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/async_manager/extension.py
RENAMED
|
File without changes
|
{hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/async_manager/extract.py
RENAMED
|
File without changes
|
{hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/async_manager/profile.py
RENAMED
|
File without changes
|
{hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/async_manager/scrape.py
RENAMED
|
File without changes
|
{hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/async_manager/session.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/sync_manager/crawl.py
RENAMED
|
File without changes
|
{hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/sync_manager/extension.py
RENAMED
|
File without changes
|
{hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/sync_manager/extract.py
RENAMED
|
File without changes
|
{hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/sync_manager/profile.py
RENAMED
|
File without changes
|
{hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/sync_manager/scrape.py
RENAMED
|
File without changes
|
{hyperbrowser-0.34.0 → hyperbrowser-0.36.0}/hyperbrowser/client/managers/sync_manager/session.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|