Multi-Page actions
Last updated
Last updated
HyperAgent is built around playwright, and offers a natural way to extend the functionality of playwright to also perform tasks like an independent web-agent.
This can be done simply by using the .ai()
method available on all page objects.
Here is a simple example showing how to do this:
Each page can act as a separate web-agent by itself.
All page.ai
calls can take in two parameters:
task
: A string describing the task to be completed on this page
params
(Optional): An object containing the parameters of the task. A list of accepted parameters can be found in the
HyperAgent also offers a quick method of extracting information from a page using the .extract()
method
All page.extract
calls can take in two parameters:
task
: A string describing what needs to be extracted from the current page
outputSchema
(optional): A zod object describing the schema of the output expected.