1.添加了阿里千问模型,由于其不支持pydantic,补充了一些适配#254
Open
hairuchen wants to merge 3 commits intobrowserbase:mainfrom
Open
Conversation
2.添加了executable_path的配置项,用于提供给开发者选用本地浏览器引擎
There was a problem hiding this comment.
2 issues found across 4 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="stagehand/main.py">
<violation number="1" location="stagehand/main.py:33">
P0: Import path mismatch: the file is `qwenclient.py` (no underscore), but the import references `qwen_client`. This will cause an `ImportError` at runtime.</violation>
</file>
<file name="stagehand/llm/qwenclient.py">
<violation number="1" location="stagehand/llm/qwenclient.py:38">
P1: Constructor passes `model_api_key` but parent `LLMClient.__init__` expects `api_key`. This will cause the API key to be passed through `**kwargs` instead of the correct parameter, potentially breaking parent class initialization.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
stagehand/main.py
Outdated
| from .metrics import StagehandFunctionName, StagehandMetrics | ||
| from .page import StagehandPage | ||
| from .utils import get_download_path, make_serializable | ||
| from stagehand.llm.qwen_client import QwenClient # 导入千问客户端 |
There was a problem hiding this comment.
P0: Import path mismatch: the file is qwenclient.py (no underscore), but the import references qwen_client. This will cause an ImportError at runtime.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At stagehand/main.py, line 33:
<comment>Import path mismatch: the file is `qwenclient.py` (no underscore), but the import references `qwen_client`. This will cause an `ImportError` at runtime.</comment>
<file context>
@@ -30,6 +30,7 @@
from .metrics import StagehandFunctionName, StagehandMetrics
from .page import StagehandPage
from .utils import get_download_path, make_serializable
+from stagehand.llm.qwen_client import QwenClient # 导入千问客户端
load_dotenv()
</file context>
✅ Addressed in 6ac0808
There was a problem hiding this comment.
2 issues found across 2 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="stagehand/llm/qwenclient.py">
<violation number="1" location="stagehand/llm/qwenclient.py:41">
P0: This change renames the instance variable from `self.model_api_key` to `self.api_key`, but line 60 still references `self.model_api_key` in the Authorization header. This will cause an `AttributeError` at runtime when making API calls. The header construction needs to be updated to use `self.api_key`.</violation>
</file>
<file name="stagehand/main.py">
<violation number="1" location="stagehand/main.py:292">
P0: `self.api_key` is not defined in the `Stagehand` class. This will raise an `AttributeError` at runtime. The correct attribute is `self.model_api_key`, which is used for the `LLMClient` below.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
The original version does not support Alibaba Qwen model calls and flexible configuration of local browser executable paths.
What Changed
executable_pathconfiguration item to allow developers to specify local browser engines.Test Plan
executable_pathtakes effect when specified, and uses default browser path when not specified.Summary by cubic
Adds Alibaba Qwen model support in LOCAL mode and a new executable_path option to choose a local browser binary. This enables qwen-turbo/plus/max with JSON-safe responses and keeps metrics working.
Written for commit 036ed18. Summary will update automatically on new commits.