docs: add docstrings to Computer and AsyncComputer abstract methods#2876
Closed
RudrenduPaul wants to merge 1 commit intoopenai:mainfrom
Closed
docs: add docstrings to Computer and AsyncComputer abstract methods#2876RudrenduPaul wants to merge 1 commit intoopenai:mainfrom
RudrenduPaul wants to merge 1 commit intoopenai:mainfrom
Conversation
The abstract methods on both Computer and AsyncComputer (screenshot, click, double_click, scroll, type, wait, move, keypress, drag) had no docstrings, leaving implementors without inline guidance on what each method should do. Add a one-line docstring to every abstract method so subclass authors and IDE tooltips have a clear contract description. Built by Rudrendu Paul, developed with Claude Code
Member
|
Thank you so much for sending this. This is resolved by #2877 |
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.
Summary
The abstract methods on
ComputerandAsyncComputerinsrc/agents/computer.pyhad no docstrings. Both classes are part of the public API (exported fromagents/__init__.py) and are intended to be subclassed by users who want to integrate custom computer-control backends with theComputerTool.Without docstrings, IDE tooltips and
help()show nothing for these methods, making the contract unclear for implementors.This PR adds a single-line docstring to each of the 9 abstract methods on both classes (18 methods total):
screenshot— describe return value (base64-encoded image data)click— describe coordinate and button parametersdouble_click— describe coordinate parametersscroll— describe coordinate and scroll-unit parameterstype— describe what text is typed and wherewait— describe purpose (signal readiness for next action)move— describe cursor movementkeypress— describe key list format (e.g.["ctrl", "c"])drag— describe waypoint path argumentTest plan
ruff format --check src/agents/computer.py— already formattedruff check src/agents/computer.py— no lint errors