Skip to content

Commit

Permalink
Action dispatch for screen assistant.
Browse files Browse the repository at this point in the history
  • Loading branch information
whilo committed Feb 27, 2025
1 parent 4619813 commit aab54c2
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/is/simm/runtimes/ubuntu.clj
Original file line number Diff line number Diff line change
Expand Up @@ -511,14 +511,17 @@
{:type "image_url"
:image_url {:url (str "data:image/jpeg;base64," (encode-file last-screen))}}]}])))))
_ (debug "system output" output)
parsed (parse-json output {})]
(if parsed
(do
(d/transact! conn [{:assistant/output output
:event/created (java.util.Date.)
:event/role "developer"}])
#_(m/? (play-audio (m/? (<! (tts-1 statement))))))
(m/? (m/sleep 1000))))
actions (parse-json output {})]
(d/transact! conn [{:assistant/output output
:event/created (java.util.Date.)
:event/role "developer"}])
(doseq [{:keys [action keys duration button relative text] :as args} actions]
(case action
"statement" (m/? (play-audio (m/? (<! (tts-1 text)))))
"press-keys" (press-keys (map keyword keys) duration)
"mouse-move" (mouse-move relative)
"mouse-click" (mouse-click (keyword button) duration)
(prn "Not supported yet" action args))))
(m/? (m/sleep 1000))))
(recur)))))

Expand Down

0 comments on commit aab54c2

Please sign in to comment.