TypedDict, so editors can autocomplete and validate top-level
and nested keys directly in dictionary literals.
Existing Pydantic request objects remain supported. You can upgrade first, then
migrate call sites incrementally.
Upgrade
Before and after
New and updated code should pass a dictionary:Named request annotations
Import requestTypedDict definitions from hyperbrowser.types when a named
variable is useful:
hyperbrowser.models refers to the legacy Pydantic request
class. Alias one of the imports if you need both:
What stays the same
- Use Pythonic
snake_caserequest keys. The SDK still translates its own fields to the API’s wire names. - Sync and async clients accept the same request shapes.
- Responses remain Pydantic models with methods such as
model_dump()andmodel_dump_json(). - Legacy Pydantic requests retain their constructors and validation behavior.
JSON Schema and open mappings
Fields such asschema and output_model_schema accept raw JSON Schema
dictionaries:
$defs,
$ref, property names such as product_name, or custom keywords. The same
preservation rule applies to environment variables, storage state, sensitive
data, and agent action payloads.
Endpoints that support boolean JSON Schemas also accept True and False
directly.
Where documented, you can also provide a Pydantic model class and the SDK will
generate its JSON Schema.
Migration checklist
- Upgrade and run your current test suite. Existing Pydantic request objects should continue to work.
- Prefer dictionaries in new and frequently edited request code.
- Import named request annotations from
hyperbrowser.types. - Continue importing responses and intentionally retained legacy request
classes from
hyperbrowser.models. - Run your type checker to catch invalid or misspelled nested keys.