File tree Expand file tree Collapse file tree 9 files changed +173
-98
lines changed Expand file tree Collapse file tree 9 files changed +173
-98
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -16,3 +16,11 @@ functions:
16
16
image : vonwig/qrencode:latest
17
17
---
18
18
19
+ # Prompt user
20
+
21
+ Generate a QR code for the
22
+ url https://github.com/docker/labs-ai-tools-for-devs and write it to file ` qrcode.png ` .
23
+
24
+ # Result
25
+
26
+ This function generates a QR code for a URL. The QR code is saved as a PNG file.
Original file line number Diff line number Diff line change 6
6
bb -m prompts --help
7
7
```
8
8
9
+ ### run without --host-dir
10
+
11
+ ``` sh
12
+ bb -m prompts
13
+ ```
14
+
9
15
### Plain prompt Generation
10
16
11
17
``` sh
@@ -58,6 +64,8 @@ bb -m prompts run \
58
64
--url http://localhost:11434/v1/chat/completions
59
65
```
60
66
67
+ TODO - this should fail better because the prompts-dir is not valid.
68
+
61
69
``` sh
62
70
bb -m prompts run \
63
71
--host-dir /Users/slim/docker/labs-make-runbook \
@@ -133,6 +141,37 @@ bb -m prompts run \
133
141
--model " llama3-groq-tool-use:latest"
134
142
```
135
143
144
+ #### Test single file prompts
145
+
146
+ ``` sh
147
+ rm ~ /docker/labs-make-runbook/qrcode.png
148
+ ```
149
+
150
+ ``` sh
151
+ bb -m prompts run \
152
+ --host-dir /Users/slim/docker/labs-make-runbook \
153
+ --user jimclark106 \
154
+ --platform darwin \
155
+ --prompts-file prompts/qrencode/README.md
156
+ ```
157
+
158
+ ``` sh
159
+ open ~ /docker/labs-make-runbook/qrcode.png
160
+ ```
161
+
162
+ ``` sh
163
+ bb -m prompts run \
164
+ --host-dir /Users/slim/docker/labs-make-runbook \
165
+ --user jimclark106 \
166
+ --platform darwin \
167
+ --prompts-file prompts/qrencode/README.md \
168
+ --url http://localhost:11434/v1/chat/completions \
169
+ --model " llama3.1" \
170
+ --nostream \
171
+ --debug
172
+ ```
173
+
174
+
136
175
#### Using Containerized runner
137
176
138
177
``` sh
Original file line number Diff line number Diff line change 52
52
(fs/create-dirs default-dir )
53
53
default-dir ))))
54
54
55
- (defn prompt-dir
55
+ (defn prompt-file
56
56
" returns the path or nil if the github ref does not resolve
57
57
throws if the path in the repo does not exist or if the clone fails"
58
58
[ref]
85
85
(fs/create-dir prompts-cache)
86
86
(def x " github:docker/labs-make-runbook?ref=main&path=prompts/docker" )
87
87
(def git-ref (parse-github-ref x))
88
- (prompt-dir " github:docker/labs-make-runbook?ref=main&path=prompts/docker" )
88
+ (prompt-file " github:docker/labs-make-runbook?ref=main&path=prompts/docker" )
89
89
(parse-github-ref nil )
90
90
(parse-github-ref " " )
91
91
(parse-github-ref " github:docker/labs-make-runbook" )
Original file line number Diff line number Diff line change 54
54
(filter heading-1-section?)
55
55
(map (comp zip/node zip/up zip/up))
56
56
(filter (partial prompt-section? content))
57
- (map (partial node-content content))
58
- (pprint )))
57
+ (map (partial node-content content))))
59
58
60
59
(defn parse-markdown [content]
61
60
(let [x (docker/function-call-with-stdin
66
65
(docker/finish-call x)))]
67
66
(->> s
68
67
(edn/read-string )
69
- (extract-prompts content))))
68
+ (extract-prompts content)
69
+ (into []))))
70
70
71
71
(comment
72
+ (string/split content #"\n " )
72
73
73
- (def content (slurp " test .md" ))
74
+ (def content (slurp " prompts/qrencode/README .md" ))
74
75
(pprint (parse-markdown content))
75
76
76
77
(def t
You can’t perform that action at this time.
0 commit comments