-
Notifications
You must be signed in to change notification settings - Fork 3
ts-cua sample added #33
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
base: main
Are you sure you want to change the base?
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.
Left some comments!
@@ -0,0 +1,4 @@ | |||
{ |
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.
Could we update this (this is what we're using in other repos)?
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 100,
"tabWidth": 2
}
@@ -0,0 +1,110 @@ | |||
// @ts-nocheck |
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 and update type errors as needed
@@ -0,0 +1,223 @@ | |||
// @ts-nocheck |
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 and update
@@ -0,0 +1,199 @@ | |||
// @ts-nocheck |
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.
Remote and update
/**Handle each item; may cause a computer action + screenshot.*/ | ||
if (item.type === "message") { | ||
if (this.print_steps) { | ||
console.log(item.content![0].text); |
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.
console.log(item.content?.[0]?.text);
to prevent a runtime error
} | ||
}; | ||
|
||
await this._page!.route("**/*", handleRoute); |
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.
Could we use a type guard method to assert the presence of _page instead of this._page! everywhere
|
||
// start agent run | ||
const response = await agent.runFullTurn( | ||
[ |
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.
Would prefer runFullTurn to accept an obj with named vars
} | ||
|
||
app.action<CuaInput, CuaOutput>( | ||
"agent-run", |
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.
Rename to "cua-task" to conform to other examples
@@ -0,0 +1,2 @@ | |||
node_modules |
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.
Rename the folder /cua-sample/ to just /cua/
so it matches other examples
@raiden-staging could you also add a gitignore file that is named _gitignore? When we publish the package, npm excludes actual gitignores. When our CLI copies over _gitignore, it renames it to .gitignore on the user's copy |
templates/python/browser-use/main.py
Outdated
|
||
|
||
# Define a subclass of BrowserSession that overrides _setup_viewports (which mishandles resizeing on connecting via cdp) | ||
class BrowserSessionCustomResize(BrowserSession): |
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.
Thanks for this! Can you move it to a separate file so we can keep main.py nice and clean?
Kernel
,Playwright
,OpenAI SDK