@@ -57,7 +57,7 @@ StagehandClient client = StagehandOkHttpClient.fromEnv();
5757
5858SessionActParams params = SessionActParams . builder()
5959 .id(" c4dbf3a9-9a58-4b22-8a1c-9f20f9f9e123" )
60- .input(" Click the login button " )
60+ .input(" click the first link on the page " )
6161 .build();
6262SessionActResponse response = client. sessions(). act(params);
6363```
@@ -163,7 +163,7 @@ StagehandClient client = StagehandOkHttpClient.fromEnv();
163163
164164SessionActParams params = SessionActParams . builder()
165165 .id(" c4dbf3a9-9a58-4b22-8a1c-9f20f9f9e123" )
166- .input(" Click the login button " )
166+ .input(" click the first link on the page " )
167167 .build();
168168CompletableFuture<SessionActResponse > response = client. async(). sessions(). act(params);
169169```
@@ -183,7 +183,7 @@ StagehandClientAsync client = StagehandOkHttpClientAsync.fromEnv();
183183
184184SessionActParams params = SessionActParams . builder()
185185 .id(" c4dbf3a9-9a58-4b22-8a1c-9f20f9f9e123" )
186- .input(" Click the login button " )
186+ .input(" click the first link on the page " )
187187 .build();
188188CompletableFuture<SessionActResponse > response = client. sessions(). act(params);
189189```
@@ -199,14 +199,13 @@ To access this data, prefix any HTTP method call on a client or service with `wi
199199``` java
200200import com.browserbase.api.core.http.Headers ;
201201import com.browserbase.api.core.http.HttpResponseFor ;
202- import com.browserbase.api.models.sessions.SessionActParams ;
203- import com.browserbase.api.models.sessions.SessionActResponse ;
202+ import com.browserbase.api.models.sessions.SessionStartParams ;
203+ import com.browserbase.api.models.sessions.SessionStartResponse ;
204204
205- SessionActParams params = SessionActParams . builder()
206- .id(" c4dbf3a9-9a58-4b22-8a1c-9f20f9f9e123" )
207- .input(" Click the login button" )
205+ SessionStartParams params = SessionStartParams . builder()
206+ .modelName(" gpt-4o" )
208207 .build();
209- HttpResponseFor<SessionActResponse > response = client. sessions(). withRawResponse(). act (params);
208+ HttpResponseFor<SessionStartResponse > response = client. sessions(). withRawResponse(). start (params);
210209
211210int statusCode = response. statusCode();
212211Headers headers = response. headers();
@@ -215,9 +214,9 @@ Headers headers = response.headers();
215214You can still deserialize the response into an instance of a Java class if needed:
216215
217216``` java
218- import com.browserbase.api.models.sessions.SessionActResponse ;
217+ import com.browserbase.api.models.sessions.SessionStartResponse ;
219218
220- SessionActResponse parsedResponse = response. parse();
219+ SessionStartResponse parsedResponse = response. parse();
221220```
222221
223222## Error handling
@@ -313,9 +312,9 @@ Requests time out after 1 minute by default.
313312To set a custom timeout, configure the method call using the ` timeout ` method:
314313
315314``` java
316- import com.browserbase.api.models.sessions.SessionActResponse ;
315+ import com.browserbase.api.models.sessions.SessionStartResponse ;
317316
318- SessionActResponse response = client. sessions(). act (
317+ SessionStartResponse response = client. sessions(). start (
319318 params, RequestOptions . builder(). timeout(Duration . ofSeconds(30 )). build()
320319);
321320```
@@ -449,10 +448,11 @@ These properties can be accessed on the nested built object later using the `_ad
449448To set a documented parameter or property to an undocumented or not yet supported _ value_ , pass a [ ` JsonValue ` ] ( stagehand-java-core/src/main/kotlin/com/browserbase/api/core/Values.kt ) object to its setter:
450449
451450``` java
451+ import com.browserbase.api.core.JsonValue ;
452452import com.browserbase.api.models.sessions.SessionActParams ;
453453
454454SessionActParams params = SessionActParams . builder()
455- .input(" Click the login button " )
455+ .input(JsonValue . from( 42 ) )
456456 .build();
457457```
458458
0 commit comments