Skip to content

Commit 051e88d

Browse files
committed
Fixed errors in :init-call-state and :init-arguments.
I was using the wrong update functions for the state.
1 parent 3a83e3d commit 051e88d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/eca/features/chat.clj

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -248,20 +248,20 @@
248248
true)
249249

250250
:init-tool-call-state
251-
(swap! db* assoc-in [:chats (:chat-id chat-ctx) :tool-calls tool-call-id]
252-
{;; :status is initialized by the state transition machinery
253-
;; :approval* is initialized by the :init-approval-promise action
254-
;; :arguments is initialized by the :init-arguments action
255-
;; :start-time is initialized by the :set-start-time action
256-
:name (:name event-data)
257-
:arguments (:arguments event-data)
258-
:origin (:origin event-data)
259-
:decision-reason {:code :none
260-
:text "No reason"}})
251+
(swap! db* update-in [:chats (:chat-id chat-ctx) :tool-calls tool-call-id] assoc
252+
;; :status is initialized by the state transition machinery
253+
;; :approval* is initialized by the :init-approval-promise action
254+
;; :arguments is initialized by the :init-arguments action
255+
;; :start-time is initialized by the :set-start-time action
256+
:name (:name event-data)
257+
:arguments (:arguments event-data)
258+
:origin (:origin event-data)
259+
:decision-reason {:code :none
260+
:text "No reason"})
261261

262262
:init-arguments
263-
(swap! db* assoc-in [:chats (:chat-id chat-ctx) :tool-calls tool-call-id]
264-
:arguments (:arguments event-data))
263+
(swap! db* assoc-in [:chats (:chat-id chat-ctx) :tool-calls tool-call-id :arguments]
264+
(:arguments event-data))
265265

266266
:set-decision-reason
267267
(swap! db* assoc-in [:chats (:chat-id chat-ctx) :tool-calls tool-call-id :decision-reason]

0 commit comments

Comments
 (0)