Browser recording: events to blocks (#4195)

This commit is contained in:
Jonathan Dobson
2025-12-04 12:04:38 -05:00
committed by GitHub
parent bc8b20a742
commit b30f3b09c8
23 changed files with 1788 additions and 100 deletions

View File

@@ -0,0 +1,21 @@
Given a browser action, come up with a templated one-line prompt suitable for a browser agent, a block label, and a title.
The templated prompt should have one jinja variable in it. Come up with a good name for the variable that is
lower case, no spaces, underscores permitted.
Example: "Enter {{ address }} into the address field."
MAKE SURE YOU OUTPUT VALID JSON. No text before or after JSON, no trailing commas, no comments (//), no unnecessary quotes, etc.
Reply in JSON format with the following keys:
{
"prompt": str, // A templated, one-line prompt suitable for a browser agent describing the user action.
"title": str, // A descriptive and informative title for the goal. Use no more than 5 words
"block_label": str, // A label for the block. Lower case. Based off of the "title". Underscores are permitted.
"parameter_name": { "key": str } // The name of the parameter being input. Lower case, no spaces. Underscores are permitted.
}
User action:
```
{{ action }}
```

View File

@@ -0,0 +1,15 @@
Given a browser action, come up with a one-line prompt suitable for a browser agent, a block label, and a title.
MAKE SURE YOU OUTPUT VALID JSON. No text before or after JSON, no trailing commas, no comments (//), no unnecessary quotes, etc.
Reply in JSON format with the following keys:
{
"prompt": str, // A one-line prompt suitable for a browser agent describing the user action.
"title": str, // A descriptive and informative title for the goal. Use no more than 5 words
"block_label": str // A label for the block. Lower case. Based off of the "title". Underscores are permitted.
}
User action:
```
{{ action }}
```

View File

@@ -0,0 +1,13 @@
Given a "go to URL" action, come up with a block label suitable for a browser agent. It should include a short version of a url, if the url exists.
MAKE SURE YOU OUTPUT VALID JSON. No text before or after JSON, no trailing commas, no comments (//), no unnecessary quotes, etc.
Reply in JSON format with the following keys:
{
"block_label": str // A label for the block. Lower case. Underscores are permitted.
}
go to URL action:
```
{{ action }}
```

View File

@@ -0,0 +1,15 @@
Given a wait action, come up with a block label. It should include the duration in seconds, and a short version of a url, if the url exists.
If the duration for the wait action is in milliseconds, so be sure to convert to seconds.
MAKE SURE YOU OUTPUT VALID JSON. No text before or after JSON, no trailing commas, no comments (//), no unnecessary quotes, etc.
Reply in JSON format with the following keys:
{
"block_label": str // A label for the block. Lower case. Underscores are permitted.
}
Wait action:
```
{{ action }}
```