-
Notifications
You must be signed in to change notification settings - Fork 10
Adding initial support for LLM Customisation #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sanveer-osahan
wants to merge
1
commit into
browserbase:main
Choose a base branch
from
sanveer-osahan:sanveer/custom_llm
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ class StagehandConfig(BaseModel): | |
browserbase_session_create_params (Optional[BrowserbaseSessionCreateParams]): Browserbase session create params. | ||
browserbase_session_id (Optional[str]): Session ID for resuming Browserbase sessions. | ||
model_name (Optional[str]): Name of the model to use. | ||
model_api_key (Optional[str]): Model API key. | ||
model_client_options (Optional[dict[str, Any]]): Options for the model client. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rather than replace, lets add it as another option |
||
logger (Optional[Callable[[Any], None]]): Custom logging function. | ||
verbose (Optional[int]): Verbosity level for logs (1=minimal, 2=medium, 3=detailed). | ||
use_rich_logging (bool): Whether to use Rich for colorized logging. | ||
|
@@ -47,8 +47,8 @@ class StagehandConfig(BaseModel): | |
alias="apiUrl", | ||
description="Stagehand API URL", | ||
) | ||
model_api_key: Optional[str] = Field( | ||
None, alias="modelApiKey", description="Model API key" | ||
model_client_options: Optional[dict[str, Any]] = Field( | ||
None, alias="modelClientOptions", description="Configuration options for the language model client (i.e. apiKey, baseURL)", | ||
) | ||
verbose: Optional[int] = Field( | ||
1, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,10 @@ def __init__( | |
|
||
# Handle non-config parameters | ||
self.api_url = self.config.api_url | ||
self.model_api_key = self.config.model_api_key or os.getenv("MODEL_API_KEY") | ||
|
||
# Handle model-related settings | ||
self.model_client_options = self.config.model_client_options or {} | ||
self.model_api_key = self.model_client_options.get("apiKey") or os.getenv("MODEL_API_KEY") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. model_api_key supersedes the model_client_options apiKey, if defined |
||
self.model_name = self.config.model_name | ||
|
||
# Extract frequently used values from config for convenience | ||
|
@@ -89,11 +92,6 @@ def __init__( | |
self.config.local_browser_launch_options or {} | ||
) | ||
|
||
# Handle model-related settings | ||
self.model_client_options = {} | ||
if self.model_api_key and "apiKey" not in self.model_client_options: | ||
self.model_client_options["apiKey"] = self.model_api_key | ||
|
||
# Handle browserbase session create params | ||
self.browserbase_session_create_params = make_serializable( | ||
self.config.browserbase_session_create_params | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's revert the readme changes