@@ -3,7 +3,7 @@ import { Stagehand, StagehandFunctionName } from "../index";
3
3
import { observe } from "../inference" ;
4
4
import { LLMClient } from "../llm/LLMClient" ;
5
5
import { StagehandPage } from "../StagehandPage" ;
6
- import { generateId , drawObserveOverlay } from "../utils" ;
6
+ import { drawObserveOverlay } from "../utils" ;
7
7
import {
8
8
getAccessibilityTree ,
9
9
getXPathByResolvedObjectId ,
@@ -14,12 +14,7 @@ export class StagehandObserveHandler {
14
14
private readonly stagehand : Stagehand ;
15
15
private readonly logger : ( logLine : LogLine ) => void ;
16
16
private readonly stagehandPage : StagehandPage ;
17
- private observations : {
18
- [ key : string ] : {
19
- result : { selector : string ; description : string } [ ] ;
20
- instruction : string ;
21
- } ;
22
- } ;
17
+
23
18
private readonly userProvidedInstructions ?: string ;
24
19
constructor ( {
25
20
stagehand,
@@ -36,18 +31,6 @@ export class StagehandObserveHandler {
36
31
this . logger = logger ;
37
32
this . stagehandPage = stagehandPage ;
38
33
this . userProvidedInstructions = userProvidedInstructions ;
39
- this . observations = { } ;
40
- }
41
-
42
- private async _recordObservation (
43
- instruction : string ,
44
- result : { selector : string ; description : string } [ ] ,
45
- ) : Promise < string > {
46
- const id = generateId ( instruction ) ;
47
-
48
- this . observations [ id ] = { result, instruction } ;
49
-
50
- return id ;
51
34
}
52
35
53
36
public async observe ( {
@@ -219,7 +202,6 @@ export class StagehandObserveHandler {
219
202
await drawObserveOverlay ( this . stagehandPage . page , elementsWithSelectors ) ;
220
203
}
221
204
222
- await this . _recordObservation ( instruction , elementsWithSelectors ) ;
223
205
return elementsWithSelectors ;
224
206
}
225
207
}
0 commit comments