Skip to content

Commit 902c59f

Browse files
author
colinmcneil
committed
Reduce chrome prompt's freedom
1 parent 53db5a2 commit 902c59f

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

prompts/chrome.md

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: Chrome web scraper
3-
model: claude-3-7-sonnet-latest
3+
model: gpt-4o
44
arguments:
55
- name: query
66
description: the question to answer
@@ -13,26 +13,23 @@ tools:
1313
parameters:
1414
type: object
1515
properties:
16-
url:
16+
endpoint:
1717
type: string
1818
description: The url of the websocket endpoint.
1919
message:
2020
type: string
2121
description: The message to send to websocat on stdin.
22-
websocat_args:
23-
type: string
24-
description: The arguments to pass to websocat.
2522
required:
26-
- url
23+
- endpoint
2724
- message
28-
- websocat_args
2925
container:
3026
image: vonwig/websocat:latest
3127
stdin:
32-
content: "{{message|safe}}"
28+
content: '{{message|safe}}'
3329
command:
34-
- "{{websocat_args}}"
35-
- "{{url|safe}}"
30+
- "-n1"
31+
- "-H=Host: localhost:9222"
32+
- '{{endpoint|safe}}'
3633
- name: curl
3734
description: Run a curl command.
3835
parameters:
@@ -89,11 +86,9 @@ Examples:
8986
curl -X PUT -H "Host: localhost:9222" -sg http://host.docker.internal:9222/json/new
9087

9188
# Navigate to a page
92-
# We are setting --jsonrpc mode, so the first word is the method name and the rest is the arguments.
93-
$MESSAGE='Page.navigate {"url":"https://www.docker.com"}'
89+
$MESSAGE='{...}'
9490

95-
# Again be sure to set the host header to be localhost:9222 due to chrome's default behavior to only allow localhost
96-
$MESSAGE | websocat -n1 --jsonrpc -H "Host: localhost:9222" --jsonrpc-omit-jsonrpc ws://localhost:9222/devtools/page/<PAGE_ID>
91+
$MESSAGE | websocat ws://host.docker.internal:9222/devtools/page/<PAGE_ID>
9792

9893
{"id":2,"result":{"frameId":"A331E56CCB8615EB4FCB720425A82259","loaderId":"EF5AAD19F2F8BB27FAF55F94FFB27DF9"}}
9994
```

0 commit comments

Comments
 (0)