You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/api/class-page.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -712,23 +712,27 @@ Raw CSS content to be injected into frame.
712
712
## async method: Page.agent
713
713
* since: v1.58
714
714
* langs: js
715
+
* hidden
715
716
- returns: <[PageAgent]>
716
717
717
718
Initialize page agent with the llm provider and cache.
718
719
719
720
### option: Page.agent.cache
720
721
* since: v1.58
722
+
* hidden
721
723
-`cache` <[Object]>
722
724
-`cacheFile` ?<[string]> Cache file to use/generate code for performed actions into. Cache is not used if not specified (default).
723
725
-`cacheOutFile` ?<[string]> When specified, generated entries are written into the `cacheOutFile` instead of updating the `cacheFile`.
724
726
725
727
### option: Page.agent.expect
726
728
* since: v1.58
729
+
* hidden
727
730
-`expect` <[Object]>
728
731
-`timeout` ?<[int]> Default timeout for expect calls in milliseconds, defaults to 5000ms.
729
732
730
733
### option: Page.agent.limits
731
734
* since: v1.58
735
+
* hidden
732
736
-`limits` <[Object]>
733
737
-`maxTokens` ?<[int]> Maximum number of tokens to consume. The agentic loop will stop after input + output tokens exceed this value. Defaults to unlimited.
734
738
-`maxActions` ?<[int]> Maximum number of agentic actions to generate, defaults to 10.
@@ -738,6 +742,7 @@ Limits to use for the agentic loop.
738
742
739
743
### option: Page.agent.provider
740
744
* since: v1.58
745
+
* hidden
741
746
-`provider` <[Object]>
742
747
-`api` <[PageAgentAPI]<"openai"|"openai-compatible"|"anthropic"|"google">> API to use.
743
748
-`apiEndpoint` ?<[string]> Endpoint to use if different from default.
@@ -747,12 +752,14 @@ Limits to use for the agentic loop.
Copy file name to clipboardExpand all lines: docs/src/api/class-pageagent.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,11 @@
1
1
# class: PageAgent
2
2
* since: v1.58
3
3
* langs: js
4
+
* hidden
4
5
5
6
## event: PageAgent.turn
6
7
* since: v1.58
8
+
* hidden
7
9
- argument: <[Object]>
8
10
-`role` <[string]>
9
11
-`message` <[string]>
@@ -14,11 +16,13 @@
14
16
Emitted when the agent makes a turn.
15
17
16
18
## async method: PageAgent.dispose
19
+
* hidden
17
20
* since: v1.58
18
21
19
22
Dispose this agent.
20
23
21
24
## async method: PageAgent.expect
25
+
* hidden
22
26
* since: v1.58
23
27
24
28
Expect certain condition to be met.
@@ -31,12 +35,14 @@ await agent.expect('"0 items" to be reported');
31
35
32
36
### param: PageAgent.expect.expectation
33
37
* since: v1.58
38
+
* hidden
34
39
-`expectation` <[string]>
35
40
36
41
Expectation to assert.
37
42
38
43
### option: PageAgent.expect.timeout
39
44
* since: v1.58
45
+
* hidden
40
46
-`timeout` <[float]>
41
47
42
48
Expect timeout in milliseconds. Defaults to `5000`. The default value can be changed via `expect.timeout` option in the config, or by specifying the `expect` property of the [`option: Page.agent.expect`] option. Pass `0` to disable timeout.
@@ -46,6 +52,7 @@ Expect timeout in milliseconds. Defaults to `5000`. The default value can be cha
46
52
47
53
## async method: PageAgent.extract
48
54
* since: v1.58
55
+
* hidden
49
56
- returns: <[Object]>
50
57
-`result` <[any]>
51
58
-`usage` <[Object]>
@@ -66,16 +73,19 @@ await agent.extract('List of items in the cart', z.object({
66
73
67
74
### param: PageAgent.extract.query
68
75
* since: v1.58
76
+
* hidden
69
77
-`query` <[string]>
70
78
71
79
Task to perform using agentic loop.
72
80
73
81
### param: PageAgent.extract.schema
74
82
* since: v1.58
83
+
* hidden
75
84
-`schema` <[z.ZodSchema]>
76
85
77
86
### option: PageAgent.extract.timeout
78
87
* since: v1.58
88
+
* hidden
79
89
-`timeout` <[float]>
80
90
81
91
Extract timeout in milliseconds. Defaults to `5000`. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or
@@ -84,9 +94,9 @@ Extract timeout in milliseconds. Defaults to `5000`. The default value can be ch
Perform timeout in milliseconds. Defaults to `5000`. The default value can be changed via `actionTimeout` option in the config, or by using the [`method: BrowserContext.setDefaultTimeout`] or
115
127
[`method: Page.setDefaultTimeout`] methods. Pass `0` to disable timeout.
0 commit comments