Skip to content

Commit 9737823

Browse files
Document prebuilt tool wrapper validation contracts
Co-authored-by: Shri Sukhani <shrisukhani@users.noreply.github.com>
1 parent c55b026 commit 9737823

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,21 @@ with Hyperbrowser(api_key="your_api_key") as client:
177177
print(result.status, result.data)
178178
```
179179

180+
## Prebuilt tool wrappers
181+
182+
`hyperbrowser.tools` exposes prebuilt wrappers for common tool-calling flows (`WebsiteScrapeTool`, `WebsiteScreenshotTool`, `WebsiteCrawlTool`, `WebsiteExtractTool`, `BrowserUseTool`).
183+
184+
Input and output normalization guarantees:
185+
186+
- Tool params must be a mapping with **string keys** (no blank keys, no leading/trailing whitespace keys, no control characters in keys).
187+
- Extract tool `schema` accepts:
188+
- a JSON object mapping, or
189+
- a JSON string that decodes to a JSON object.
190+
- Extract `schema` mapping keys must be strings.
191+
- Tool response objects must expose a `data` field (attribute-based or mapping-based response wrappers are supported).
192+
- Text output fields support UTF-8 bytes-like values (`bytes`, `bytearray`, `memoryview`) and decode them to strings.
193+
- Invalid UTF-8 text payloads raise deterministic `HyperbrowserError` diagnostics.
194+
180195
## Error handling
181196

182197
SDK errors are raised as `HyperbrowserError`.

0 commit comments

Comments
 (0)