Skip to content

Conversation

@derekmeegan
Copy link
Contributor

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

@changeset-bot
Copy link

changeset-bot bot commented Oct 31, 2025

⚠️ No Changeset found

Latest commit: 60b028c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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: Fixed stagehand.agent() call to use keyword arguments instead of dict-style object input
  • packages/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
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

"options": {
"apiKey": os.getenv("ANTHROPIC_API_KEY"),
agent = stagehand.agent(
provider="anthropic",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

@miguelg719 miguelg719 merged commit da33c5a into main Oct 31, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants