-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix ref for python #1210
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
fix ref for python #1210
Conversation
|
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.
Greptile Overview
Greptile Summary
Corrects Python API documentation syntax from JavaScript-style object notation to proper Python kwargs
Changes:
packages/docs/v2/basics/agent.mdx: Fixedstagehand.agent()call to use keyword arguments instead of dict-style object inputpackages/docs/v2/references/agent.mdx: Updated type signature to use proper Python parameter syntax with colons
Impact:
- Users following the documentation will now see correct Python syntax
- Fixes potential confusion for Python developers seeing JavaScript-style object notation
Confidence Score: 5/5
- This PR is safe to merge with no risk - it only corrects documentation syntax
- Documentation-only change that fixes incorrect Python syntax examples. The changes are correct, consistent with other Python examples in the codebase, and follow Python conventions
- No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| packages/docs/v2/basics/agent.mdx | 5/5 | Fixed Python agent initialization from incorrect dict syntax to proper kwargs, correcting apiKey indentation |
| packages/docs/v2/references/agent.mdx | 5/5 | Updated Python type hints to use proper parameter syntax (:) instead of dict syntax ("") |
Sequence Diagram
sequenceDiagram
participant Dev as Developer
participant Docs as Documentation
participant User as Python User
Dev->>Docs: Identifies incorrect Python syntax
Note over Docs: Before: stagehand.agent({<br/>"provider": "anthropic"<br/>})
Dev->>Docs: Updates to kwargs syntax
Note over Docs: After: stagehand.agent(<br/>provider="anthropic"<br/>)
User->>Docs: Reads documentation
Docs->>User: Returns correct Python syntax
User->>User: Successfully implements agent
2 files reviewed, no comments
packages/docs/v2/basics/agent.mdx
Outdated
| "options": { | ||
| "apiKey": os.getenv("ANTHROPIC_API_KEY"), | ||
| agent = stagehand.agent( | ||
| provider="anthropic", |
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.
remove
why
the python ref is wrong, using object input instead of kwargs
what changed
fix the python ref to use kwargs
test plan
its docs