File tree Expand file tree Collapse file tree 8 files changed +47
-11
lines changed
docker_scout_tag_recommendation Expand file tree Collapse file tree 8 files changed +47
-11
lines changed Original file line number Diff line number Diff line change 19
19
(try
20
20
(let [repository (:repository (json/parse-string (second args) true ))]
21
21
(println
22
- ((comp recommendation-response recommendation-request) repository)))
22
+ #_((comp recommendation-response recommendation-request) repository)
23
+ " 22-slim" ))
23
24
(catch Throwable t
24
25
(binding [*out* *err*]
25
26
(println t))
Original file line number Diff line number Diff line change 7
7
(let [[json-string & args] *command-line-args*
8
8
{llm-args :args } (cheshire.core/parse-string json-string true )]
9
9
(println
10
- (-> (apply babashka.process/process
11
- {:out :string }
12
- " curl" args)
10
+ (-> (babashka.process/process
11
+ {:out :string }
12
+ ( str " curl " llm- args) )
13
13
(deref )
14
14
(babashka.process/check )
15
15
:out )))
Original file line number Diff line number Diff line change @@ -13,13 +13,13 @@ docker run --rm \
13
13
--mount type=bind,source=$PWD ,target=/project \
14
14
--entrypoint /app/result/bin/entrypoint \
15
15
--workdir /project \
16
- vonwig/curl:latest ' {}'
16
+ vonwig/curl:latest ' {"args": "--help" }'
17
17
```
18
18
19
19
## Build
20
20
21
21
``` sh
22
- docker build -t vonwig/fasttext :latest .
22
+ docker build -t vonwig/curl :latest .
23
23
```
24
24
25
25
``` sh
@@ -28,8 +28,8 @@ docker build -t vonwig/fasttext:latest .
28
28
docker buildx build \
29
29
--builder hydrobuild \
30
30
--platform linux/amd64,linux/arm64 \
31
- --tag vonwig/fasttext :latest \
31
+ --tag vonwig/curl :latest \
32
32
--file Dockerfile \
33
33
--push .
34
- docker pull vonwig/fasttext :latest
34
+ docker pull vonwig/curl :latest
35
35
```
Original file line number Diff line number Diff line change
1
+ Run the curl command to fetch https://www.example.com
2
+
3
+ If you get an error, run ` curl --help ` and use the output to try again.
Original file line number Diff line number Diff line change 1
1
---
2
2
extractors :
3
3
- name : linguist
4
- - name : docker-lsp
4
+ - name : project-facts
5
5
model : gpt-4
6
6
stream : true
7
7
functions :
Original file line number Diff line number Diff line change @@ -161,3 +161,26 @@ docker run --rm \
161
161
--thread-id " something" \
162
162
--save-thread-volume
163
163
```
164
+
165
+ # Test bad commands
166
+
167
+ 1 . remove the openai key
168
+ 2 . break the url with the --url flag
169
+ 3 . choose a bad prompts dir
170
+
171
+ ``` sh
172
+ docker run --rm \
173
+ -it \
174
+ -v /var/run/docker.sock:/var/run/docker.sock \
175
+ --mount type=volume,source=docker-prompts,target=/prompts \
176
+ --mount type=bind,source=$PWD ,target=/app/local \
177
+ --mount type=bind,source=$HOME /.openai-api-key,target=/root/.openai-api-key \
178
+ --workdir /app \
179
+ vonwig/prompts:local \
180
+ run \
181
+ --host-dir $PWD \
182
+ --user $USER \
183
+ --platform " $( uname -o) " \
184
+ --prompts-dir local/prompts/poem \
185
+ ```
186
+
Original file line number Diff line number Diff line change 23
23
:method method
24
24
:params params})
25
25
26
+ ; ; message({:debug ""}) - debug messages are often serialized edn but still meant to be streamed
27
+ ; ; message({:content ""}) - meant to be streamed
28
+ ; ; prompts({:messages [{:role "", :content ""}]})
29
+ ; ; functions("") - meant to be updated in place
30
+ ; ; functions-done("")
26
31
(defn -notify [{:keys [debug]} method params]
27
32
(case method
28
33
:message (write-message (io/output-stream System/out) (notification method params))
34
+ :prompts (write-message (io/output-stream System/out) (notification method params))
29
35
:functions (write-message (io/output-stream System/out) (notification method params))
30
36
:functions-done (write-message (io/output-stream System/out) (notification method params))))
31
37
36
42
(:content params) (do (print (:content params)) (flush ))
37
43
(and debug (:debug params)) (do (println " ### DEBUG\n " ) (println (:debug params))))
38
44
:functions (do (print " ." ) (flush ))
39
- :functions-done (println params)))
45
+ :functions-done (println params)
46
+ :prompts nil ))
40
47
41
48
(def ^:dynamic notify -notify )
42
49
Original file line number Diff line number Diff line change 231
231
; ; get-prompts can only use extractors - we can't refine
232
232
; ; them based on output from function calls that the LLM plans
233
233
(let [prompts (if (not (seq thread))
234
- (get-prompts opts)
234
+ (let [new-prompts (get-prompts opts)]
235
+ (jsonrpc/notify :prompts {:messages new-prompts})
236
+ new-prompts)
235
237
thread)
236
238
{:keys [messages finish-reason] :as m}
237
239
(async/<!! (run-prompts prompts opts))]
You can’t perform that action at this time.
0 commit comments