-
Notifications
You must be signed in to change notification settings - Fork 93
1.添加了阿里千问模型,由于其不支持pydantic,补充了一些适配 #254
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
base: main
Are you sure you want to change the base?
Conversation
2.添加了executable_path的配置项,用于提供给开发者选用本地浏览器引擎
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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.