Skip to content

Commit 80d04f2

Browse files
authored
Merge pull request #20 from openai/katia/updates
Small fixes
2 parents 82ec573 + 8fac701 commit 80d04f2

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ Run CLI to let CUA use a local browser window, using [playwright](https://playwr
2121
python cli.py --computer local-playwright
2222
```
2323

24+
> [!NOTE]
25+
> The first time you run this, if you haven't used Playwright before, you will be prompted to install dependencies. Execute the command suggested, which will depend on your OS.
26+
2427
Other included sample [computer environments](#computer-environments):
2528

2629
- [Docker](https://docker.com/) (containerized desktop)

cli.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ def main():
7373
)
7474
items = []
7575

76+
77+
if args.computer in ["browserbase", "local-playwright"]:
78+
if not args.start_url.startswith("http"):
79+
args.start_url = "https://" + args.start_url
80+
agent.computer.goto(args.start_url)
81+
7682
while True:
7783
user_input = args.input or input("> ")
7884
items.append({"role": "user", "content": user_input})

computers/local_playwright.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def _get_browser_and_page(self) -> tuple[Browser, Page]:
1616
chromium_sandbox=True,
1717
headless=self.headless,
1818
args=launch_args,
19-
env={}
19+
env={"DISPLAY": ":0"}
2020
)
2121
page = browser.new_page()
2222
page.set_viewport_size({"width": width, "height": height})

utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ def create_response(**kwargs):
5151
url = "https://api.openai.com/v1/responses"
5252
headers = {
5353
"Authorization": f"Bearer {os.getenv('OPENAI_API_KEY')}",
54-
"Content-Type": "application/json",
55-
# TODO: remove for launch
56-
"Openai-beta": "responses=v1",
54+
"Content-Type": "application/json"
5755
}
5856

5957
openai_org = os.getenv("OPENAI_ORG")

0 commit comments

Comments
 (0)