Skip to content

Commit 89e9589

Browse files
Fix output for run-less prompts
* the output-handler was expecting maps but with just prompts it's a coll
1 parent fa0d673 commit 89e9589

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/prompts.clj

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,9 +296,16 @@
296296
[nil "--help" "print option summary"]])
297297

298298
(def output-handler (fn [x]
299-
(jsonrpc/notify :message {:content (json/generate-string (if (= "error" (:done x))
300-
(update x :messages last)
301-
(select-keys x [:done])))})))
299+
(jsonrpc/notify
300+
:message
301+
{:content
302+
(json/generate-string
303+
(if (map? x)
304+
(if (= "error" (:done x))
305+
(update x :messages last)
306+
(select-keys x [:done]))
307+
x))})))
308+
302309
(defn output-prompts [coll]
303310
(->> coll
304311
(mapcat (fn [{:keys [role content]}]

0 commit comments

Comments
 (0)