Skip to content

Commit 96b1343

Browse files
feat(api): manual updates
1 parent 199fe34 commit 96b1343

5 files changed

Lines changed: 12 additions & 6 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 7
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-3607b588cab78536eb7de9f6acffe8ddda1d34aebe5910c2147421aa6c16bf22.yml
33
openapi_spec_hash: fb507e8d38b4978a5717fbb144197868
4-
config_hash: fc6606301b5142487a69d296f154b265
4+
config_hash: 9d54b9fd851ec7ac25b85f579be64425

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ See this table for the available options:
7878
| ---------------------- | ------------------------ | -------- | -------------------------------------------- |
7979
| `BrowserbaseAPIKey` | `BROWSERBASE_API_KEY` | true | - |
8080
| `BrowserbaseProjectID` | `BROWSERBASE_PROJECT_ID` | true | - |
81-
| `ModelAPIKey` | `MODEL_API_KEY` | false | - |
81+
| `ModelAPIKey` | `MODEL_API_KEY` | true | - |
8282
| `BaseUrl` | `STAGEHAND_BASE_URL` | true | `"https://api.stagehand.browserbase.com/v1"` |
8383

8484
### Modifying configuration

src/Stagehand/Core/ClientOptions.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,14 @@ public string BrowserbaseProjectID
105105
set { _browserbaseProjectID = new(() => value); }
106106
}
107107

108-
Lazy<string?> _modelAPIKey = new(() => Environment.GetEnvironmentVariable("MODEL_API_KEY"));
109-
public string? ModelAPIKey
108+
Lazy<string> _modelAPIKey = new(() =>
109+
Environment.GetEnvironmentVariable("MODEL_API_KEY")
110+
?? throw new StagehandInvalidDataException(
111+
string.Format("{0} cannot be null", nameof(ModelAPIKey)),
112+
new ArgumentNullException(nameof(ModelAPIKey))
113+
)
114+
);
115+
public string ModelAPIKey
110116
{
111117
readonly get { return _modelAPIKey.Value; }
112118
set { _modelAPIKey = new(() => value); }

src/Stagehand/IStagehandClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public interface IStagehandClient
7777

7878
string BrowserbaseProjectID { get; init; }
7979

80-
string? ModelAPIKey { get; init; }
80+
string ModelAPIKey { get; init; }
8181

8282
/// <summary>
8383
/// Returns a view of this service with the given option modifications applied.

src/Stagehand/StagehandClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public string BrowserbaseProjectID
7373
}
7474

7575
/// <inheritdoc/>
76-
public string? ModelAPIKey
76+
public string ModelAPIKey
7777
{
7878
get { return this._options.ModelAPIKey; }
7979
init { this._options.ModelAPIKey = value; }

0 commit comments

Comments
 (0)