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
* @phpstan-import-type OptionsShape from \Stagehand\Sessions\SessionNavigateParams\Options
29
32
* @phpstan-import-type BrowserShape from \Stagehand\Sessions\SessionStartParams\Browser
30
33
* @phpstan-import-type BrowserbaseSessionCreateParamsShape from \Stagehand\Sessions\SessionStartParams\BrowserbaseSessionCreateParams
34
+
* @phpstan-import-type ModelClientOptionsShape from \Stagehand\Sessions\SessionStartParams\ModelClientOptions
31
35
* @phpstan-import-type InputShape from \Stagehand\Sessions\SessionActParams\Input
32
36
* @phpstan-import-type OptionsShape from \Stagehand\Sessions\SessionActParams\Options as OptionsShape1
33
37
* @phpstan-import-type RequestOpts from \Stagehand\RequestOptions
@@ -285,6 +289,7 @@ public function replay(
285
289
* @param string $browserbaseSessionID Body param: Existing Browserbase session ID to resume
286
290
* @param float $domSettleTimeoutMs Body param: Timeout in ms to wait for DOM to settle
287
291
* @param bool $experimental Body param
292
+
* @param ModelClientOptionsShape $modelClientOptions Body param: Optional provider-specific configuration for the session model (for example Bedrock region and credentials)
288
293
* @param bool $selfHeal Body param: Enable self-healing for failed actions
289
294
* @param string $systemPrompt Body param: Custom system prompt for AI operations
* @phpstan-import-type OptionsShape from \Stagehand\Sessions\SessionNavigateParams\Options
32
35
* @phpstan-import-type BrowserShape from \Stagehand\Sessions\SessionStartParams\Browser
33
36
* @phpstan-import-type BrowserbaseSessionCreateParamsShape from \Stagehand\Sessions\SessionStartParams\BrowserbaseSessionCreateParams
37
+
* @phpstan-import-type ModelClientOptionsShape from \Stagehand\Sessions\SessionStartParams\ModelClientOptions
34
38
* @phpstan-import-type InputShape from \Stagehand\Sessions\SessionActParams\Input
35
39
* @phpstan-import-type OptionsShape from \Stagehand\Sessions\SessionActParams\Options as OptionsShape1
36
40
* @phpstan-import-type RequestOpts from \Stagehand\RequestOptions
@@ -462,6 +466,7 @@ public function replay(
462
466
* @param string $browserbaseSessionID Body param: Existing Browserbase session ID to resume
463
467
* @param float $domSettleTimeoutMs Body param: Timeout in ms to wait for DOM to settle
464
468
* @param bool $experimental Body param
469
+
* @param ModelClientOptionsShape $modelClientOptions Body param: Optional provider-specific configuration for the session model (for example Bedrock region and credentials)
465
470
* @param bool $selfHeal Body param: Enable self-healing for failed actions
466
471
* @param string $systemPrompt Body param: Custom system prompt for AI operations
* @phpstan-import-type ProviderOptionsVariants from \Stagehand\Sessions\ModelConfig\ProviderOptions
18
+
* @phpstan-import-type ProviderOptionsShape from \Stagehand\Sessions\ModelConfig\ProviderOptions
19
+
*
14
20
* @phpstan-type ModelConfigShape = array{
15
21
* modelName: string,
16
22
* apiKey?: string|null,
17
23
* baseURL?: string|null,
18
24
* headers?: array<string,string>|null,
19
25
* provider?: null|Provider|value-of<Provider>,
26
+
* providerOptions?: ProviderOptionsShape|null,
27
+
* skipAPIKeyFallback?: bool|null,
20
28
* }
21
29
*/
22
30
finalclass ModelConfig implements BaseModel
@@ -43,7 +51,7 @@ final class ModelConfig implements BaseModel
43
51
public ?string$baseURL;
44
52
45
53
/**
46
-
* Custom headers sent with every request to the model provider.
54
+
* Custom headers for the model provider.
47
55
*
48
56
* @var array<string,string>|null $headers
49
57
*/
@@ -58,6 +66,20 @@ final class ModelConfig implements BaseModel
58
66
#[Optional(enum: Provider::class)]
59
67
public ?string$provider;
60
68
69
+
/**
70
+
* Provider-specific options passed through to the AI SDK provider constructor. For Bedrock: { region, accessKeyId, secretAccessKey, sessionToken }. For Vertex: { project, location, googleAuthOptions }.
* When true, hosted sessions will not copy x-model-api-key into model.apiKey. Use this when auth is carried through providerOptions instead of an API key.
79
+
*/
80
+
#[Optional('skipApiKeyFallback')]
81
+
public ?bool$skipAPIKeyFallback;
82
+
61
83
/**
62
84
* `new ModelConfig()` is missing required properties by the API.
63
85
*
@@ -84,13 +106,16 @@ public function __construct()
@@ -138,7 +165,7 @@ public function withBaseURL(string $baseURL): self
138
165
}
139
166
140
167
/**
141
-
* Custom headers sent with every request to the model provider.
168
+
* Custom headers for the model provider.
142
169
*
143
170
* @param array<string,string> $headers
144
171
*/
@@ -162,4 +189,29 @@ public function withProvider(Provider|string $provider): self
162
189
163
190
return$self;
164
191
}
192
+
193
+
/**
194
+
* Provider-specific options passed through to the AI SDK provider constructor. For Bedrock: { region, accessKeyId, secretAccessKey, sessionToken }. For Vertex: { project, location, googleAuthOptions }.
* When true, hosted sessions will not copy x-model-api-key into model.apiKey. Use this when auth is carried through providerOptions instead of an API key.
* Provider-specific options passed through to the AI SDK provider constructor. For Bedrock: { region, accessKeyId, secretAccessKey, sessionToken }. For Vertex: { project, location, googleAuthOptions }.
16
+
*
17
+
* @phpstan-import-type BedrockAPIKeyProviderOptionsShape from \Stagehand\Sessions\ModelConfig\ProviderOptions\BedrockAPIKeyProviderOptions
18
+
* @phpstan-import-type BedrockAwsCredentialsProviderOptionsShape from \Stagehand\Sessions\ModelConfig\ProviderOptions\BedrockAwsCredentialsProviderOptions
19
+
* @phpstan-import-type GoogleVertexProviderOptionsShape from \Stagehand\Sessions\ModelConfig\ProviderOptions\GoogleVertexProviderOptions
0 commit comments