Skip to content
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

fix: loosen schema #170

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/helpers/rpc/performAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function createOperateTool(
console.log("operateTool", action);
switch (action.name) {
case "scroll":
await scroll(domActions, action.args.value);
await scroll(domActions, action?.args?.value ?? "down");
break;
case "wait":
await sleep(3000);
Expand Down
10 changes: 6 additions & 4 deletions src/helpers/vision-agent/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ export const scrollSchema = z.object({
'Scroll the page to see the other parts. Use "up" or "down" to scroll 2/3 of height of the window. Use "top" or "bottom" to quickly scroll to the top or bottom of the page.',
)
.optional(),
args: z.object({
value: z.string(),
}),
args: z
.object({
value: z.string(),
})
.optional(),
});

export const waitSchema = z.object({
Expand All @@ -67,7 +69,7 @@ export const waitSchema = z.object({
"Wait for 3 seconds before the next action. Useful when the page is loading.",
)
.optional(),
args: z.object({}),
args: z.object({}).optional(),
});

export const finishSchema = z.object({
Expand Down
Loading