Skip to content

Commit 162dcbc

Browse files
author
colinmcneil
committed
GitHub Universe Demos
1 parent 7823f80 commit 162dcbc

File tree

8 files changed

+263
-2
lines changed

8 files changed

+263
-2
lines changed

prompts/compose-gen-2.md

Whitespace-only changes.

prompts/curl-repo.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
tools:
3+
- name: run-nslookup
4+
description: Run the nslookup command
5+
parameters:
6+
type: object
7+
properties:
8+
args:
9+
type: string
10+
description: The arguments to pass to nslookup
11+
container:
12+
image: jsha/dnsutils
13+
command:
14+
- "nslookup {{args|safe}}"
15+
---
16+
17+
# prompt system
18+
19+
You're an expert at using nslookup to fetch data from the web.
20+
21+
# prompt user
22+
23+
Run the nslookup command to lookup the IP address of github.com

prompts/grab-logo.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
functions:
3+
- name: bash-network-tools
4+
description: Run a bash script in the network utilities container.
5+
parameters:
6+
type: object
7+
properties:
8+
command:
9+
type: string
10+
description: The command to send to bash
11+
container:
12+
image: wbitt/network-multitool
13+
command:
14+
- "bash"
15+
- "-c"
16+
- "{{command|safe}}"
17+
- name: imagemagick
18+
description: runs imagemagick with a set of args
19+
parameters:
20+
type: object
21+
properties:
22+
args:
23+
type: string
24+
description: The args to send to imagemagick
25+
container:
26+
image: dpokidov/imagemagick
27+
command:
28+
- "{{args|safe}}"
29+
---
30+
31+
# prompt system
32+
33+
You are an expert at networking. You are given 2 containers, 1 to run bash, and 1 for imagemagick. Bash image has the following tools:
34+
35+
apk package manager
36+
Nginx Web Server (port 80, port 443) - with customizable ports!
37+
awk, cut, diff, find, grep, sed, vi editor, wc
38+
curl, wget
39+
dig, nslookup
40+
ip, ifconfig, route
41+
traceroute, tracepath, mtr, tcptraceroute (for layer 4 packet tracing)
42+
ping, arp, arping
43+
ps, netstat
44+
gzip, cpio, tar
45+
telnet client
46+
tcpdump
47+
jq
48+
bash
49+
50+
The other container is just imagemagick!
51+
52+
Generating logos with microlink api
53+
https://api.microlink.io/
54+
55+
The query params you need are url,palette,embed
56+
57+
url={URL}&palette=true&embed=logo.url
58+
59+
Note that URL expects a scheme like `https://`
60+
61+
The response will just be the logo itself, not a json.
62+
63+
First, check the `content-type` header to check what type of file it is to use the correct extension.
64+
65+
Then, download the file to the right place. You should also generate a name. Use imagick to do anythoing you need.
66+
67+
# prompt user
68+
69+
Can you grab the logo on hub.docker.com and save that logo to a file at `/thread/`?
70+
71+
Once you're done with that, tell me the file size and resolution
72+

prompts/monologue.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,3 @@ Tell me about my project.
1515
My project uses the following languages:
1616
{{project-facts.languages}}
1717

18-
My project has the following files:
19-
{{project-facts.files}}

prompts/networking.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
functions:
3+
- name: bash
4+
description: Run a bash script in the utilities container.
5+
parameters:
6+
type: object
7+
properties:
8+
command:
9+
type: string
10+
description: The command to send to bash
11+
container:
12+
image: wbitt/network-multitool
13+
command:
14+
- "bash"
15+
- "-c"
16+
- "{{command|safe}}"
17+
---
18+
19+
# prompt system
20+
21+
You are an expert at networking. You are given a container to run bash in with the following tools:
22+
23+
apk package manager
24+
Nginx Web Server (port 80, port 443) - with customizable ports!
25+
awk, cut, diff, find, grep, sed, vi editor, wc
26+
curl, wget
27+
dig, nslookup
28+
ip, ifconfig, route
29+
traceroute, tracepath, mtr, tcptraceroute (for layer 4 packet tracing)
30+
ping, arp, arping
31+
ps, netstat
32+
gzip, cpio, tar
33+
telnet client
34+
tcpdump
35+
jq
36+
bash
37+
38+
Use bash with these tools to run what is necessary to respond to the user.
39+
40+
# prompt user
41+
42+
What is the IP and response time for github.com?

prompts/python.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
functions:
3+
- name: run-python-code
4+
description: Run python code and get stdout
5+
parameters:
6+
type: object
7+
properties:
8+
code:
9+
type: string
10+
description: The Python code to execute.
11+
container:
12+
image: python:alpine
13+
command:
14+
- "python"
15+
- "-c"
16+
- "{{code|safe}}"
17+
---
18+
19+
# prompt system
20+
21+
You are an expert at python. You can run python code, and the stdout after running the code will be sent to you.
22+
23+
This environment has all of the default python libraries you need to do anything you need. Use the `http` lib for internet stuff.
24+
25+
Write some python which will answer the user query, then run it and report back.
26+
27+
You must use the standard libraries, as you cannot install anything else.
28+
29+
# prompt user
30+
31+
Can you tell me what the weather is in ontario?

prompts/screenshot.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
functions:
3+
- name: bash
4+
description: Run a bash script in the utilities container.
5+
parameters:
6+
type: object
7+
properties:
8+
command:
9+
type: string
10+
description: The command to send to bash
11+
container:
12+
image: wbitt/network-multitool
13+
command:
14+
- "bash"
15+
- "-c"
16+
- "{{command|safe}}"
17+
---
18+
19+
# prompt system
20+
21+
You are an expert at networking. You are given a container to run bash in with the following tools:
22+
23+
apk package manager
24+
Nginx Web Server (port 80, port 443) - with customizable ports!
25+
awk, cut, diff, find, grep, sed, vi editor, wc
26+
curl, wget
27+
dig, nslookup
28+
ip, ifconfig, route
29+
traceroute, tracepath, mtr, tcptraceroute (for layer 4 packet tracing)
30+
ping, arp, arping
31+
ps, netstat
32+
gzip, cpio, tar
33+
telnet client
34+
tcpdump
35+
jq
36+
bash
37+
38+
Use bash with these tools to run what is necessary to respond to the user.
39+
40+
# prompt user
41+
42+
We're using the Microlink API!
43+
https://api.microlink.io/
44+
45+
The query params you need are url,palette,embed
46+
47+
url={URL}&palette=true&embed=logo.url
48+
49+
Can you save that logo to a file at `/thread/file.extension`?
50+

prompts/telegram/telegram.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
functions:
3+
- name: write_files
4+
- name: run-node-script
5+
description: run the node script
6+
parameters:
7+
type: object
8+
properties:
9+
path:
10+
type: string
11+
description: the path to the node script
12+
container:
13+
image: vonwig/node-telegram-bot-api:latest
14+
command:
15+
- "{{path|safe}}"
16+
---
17+
18+
# prompt system
19+
20+
You are an expert at using the Telegram API.
21+
22+
The npm package `node-telegram-bot-api` is installed globally.
23+
24+
Example of how to use the global node modules:
25+
26+
```js
27+
const { execSync } = require("child_process");
28+
// get root folder of global node modules
29+
const root = execSync("npm root -g")
30+
.toString()
31+
.trim();
32+
// then we require global node modules as
33+
const package = require(`${root}/package-name`);
34+
```
35+
36+
37+
# prompt user
38+
39+
There is a telegram bot token at `/project/.telegram_token`. If you need it, you can use it by reading it with `fs.readFileSync('/project/.telegram_token', 'utf8')`.
40+
41+
Write a nodeJS script that echos any messages sent to the bot to `/thread/echo.txt`.
42+
43+
Use write_files to write the script to `telegram.js`.
44+
45+
Run the written script with run-node-script.

0 commit comments

Comments
 (0)