You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+105-1Lines changed: 105 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ python simple_cua_loop.py
74
74
75
75
## Computer Environments
76
76
77
-
CUA can work with any `Computer` environment that can handle the [CUA actions](https://platform.openai.com/docs/api-reference/responses/object#responses/object-output):
77
+
CUA can work with any `Computer` environment that can handle the [CUA actions](https://platform.openai.com/docs/api-reference/responses/object#responses/object-output) (plus a few extra):
> If you've implemented a new computer, please add it to the "Contributed Computers" section of the README.md file. Clearly indicate any auth / signup requirements. See the [Contributing](#contributing) section for more details.
120
+
112
121
### Docker Setup
113
122
114
123
If you want to run the sample app with the `Docker` computer environment, you need to build and run a local Docker container.
@@ -152,3 +161,98 @@ However, if you pass in any `tools` that are also defined in your `Computer` met
152
161
This repository provides example implementations with basic safety measures in place.
153
162
154
163
We recommend reviewing the best practices outlined in our [guide](https://platform.openai.com/docs/guides/tools-computer-use#risks-and-safety), and making sure you understand the risks involved with using this tool.
164
+
165
+
# Contributing
166
+
167
+
## Computers
168
+
169
+
To contribute a new computer, you'll need to implement it, test it, and submit a PR. Please follow the steps below:
170
+
171
+
### 1. Implement your computer
172
+
173
+
You will create or modify the following files (and only these files):
| `computers/contrib/__init__.py` | Add to imports. |
179
+
| `computers/config.py` | Add to config. |
180
+
| `README.md` | Add to README. |
181
+
182
+
Create a new file in `computers/contrib/[your_computer_name].py` and define your computer class. Make sure to implement the methods defined in the `Computer` class – use the existing implementations as a reference.
183
+
184
+
```python
185
+
class YourComputerName:
186
+
def __init__(self):
187
+
pass
188
+
189
+
def screenshot(self):
190
+
# TODO: implement
191
+
pass
192
+
193
+
def click(self, x, y):
194
+
# TODO: implement
195
+
pass
196
+
197
+
# ... add other methods as needed
198
+
```
199
+
200
+
> [!NOTE]
201
+
> For playwright-based computers, make sure to subclass `BasePlaywrightComputer` in `computers/shared/base_playwright.py` – see `computers/default/browserbase.py` for an example.
202
+
203
+
Import your new computer in the `computers/contrib/__init__.py`:
204
+
205
+
```python
206
+
# ... existing computer imports
207
+
from .your_computer_name import YourComputerName
208
+
```
209
+
210
+
And add your new computer to the `computers_config` dictionary in `computers/config.py`:
211
+
212
+
```python
213
+
# ... existing computers_config
214
+
"your_computer_name": YourComputerName,
215
+
```
216
+
217
+
Feel free to add your new computer to the "Contributed Computers" section of the README.md file. Clearly indicate any auth / signup requirements.
218
+
219
+
### 2. Test your computer
220
+
221
+
Test your new computer (with the CLI). Make sure:
222
+
223
+
- Basic search / navigation works.
224
+
- Any setup / teardown is handled correctly.
225
+
- Test e2e with a few different tasks.
226
+
227
+
Potential gotchas (See `default` computers for reference):
0 commit comments