Skip to content

Commit 2748aea

Browse files
feat(api): manual updates
1 parent 7715406 commit 2748aea

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 7
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-349e1b0f6291eedd731c1660155a50adcb3424fb8cd9e17bbdc0939ff3bbffcd.yml
3-
openapi_spec_hash: 456b593ea71d72bc31a6338a25363e9f
4-
config_hash: 5f6b5ec6e84fb01932ba87c6a9623d9b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-e6a9dca1a93568e403ac72128d86f30c8c3f1336d4b67017d7e61b1836f10f47.yml
3+
openapi_spec_hash: ef01e0649bb0e283df0aa81c369649df
4+
config_hash: abc9d1eb9779bb5629eaed7074c42809

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ $client = new Client(
5555
modelAPIKey: getenv('MODEL_API_KEY') ?: 'My Model API Key',
5656
);
5757

58-
$response = $client->sessions->act('c4dbf3a9-9a58-4b22-8a1c-9f20f9f9e123');
58+
$response = $client->sessions->act(
59+
'c4dbf3a9-9a58-4b22-8a1c-9f20f9f9e123',
60+
input: 'click the first link on the page',
61+
);
5962

6063
var_dump($response->data);
6164
```
@@ -77,7 +80,7 @@ When the library is unable to connect to the API, or if the API returns a non-su
7780
use Stagehand\Core\Exceptions\APIConnectionException;
7881

7982
try {
80-
$response = $client->sessions->act('c4dbf3a9-9a58-4b22-8a1c-9f20f9f9e123');
83+
$response = $client->sessions->start(modelName: 'gpt-4o');
8184
} catch (APIConnectionException $e) {
8285
echo "The server could not be reached", PHP_EOL;
8386
var_dump($e->getPrevious());
@@ -123,9 +126,8 @@ use Stagehand\RequestOptions;
123126
$client = new Client(maxRetries: 0);
124127

125128
// Or, configure per-request:
126-
$result = $client->sessions->act(
127-
'c4dbf3a9-9a58-4b22-8a1c-9f20f9f9e123',
128-
requestOptions: RequestOptions::with(maxRetries: 5),
129+
$result = $client->sessions->start(
130+
modelName: 'gpt-4o', requestOptions: RequestOptions::with(maxRetries: 5)
129131
);
130132
```
131133

@@ -144,8 +146,8 @@ Note: the `extra*` parameters of the same name overrides the documented paramete
144146

145147
use Stagehand\RequestOptions;
146148

147-
$response = $client->sessions->act(
148-
'c4dbf3a9-9a58-4b22-8a1c-9f20f9f9e123',
149+
$response = $client->sessions->start(
150+
modelName: 'gpt-4o',
149151
requestOptions: RequestOptions::with(
150152
extraQueryParams: ['my_query_parameter' => 'value'],
151153
extraBodyParams: ['my_body_parameter' => 'value'],

0 commit comments

Comments
 (0)