File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 117117 user-prompt message
118118 all-tools (f.tools/all-tools @db* config)
119119 received-msgs* (atom " " )
120+ tool-call-args-by-id* (atom {})
120121 add-to-history! (fn [msg]
121122 (swap! db* update-in [:chats chat-id :messages ] (fnil conj []) msg))]
122123 (messenger/chat-content-received
180181 (finish-chat-prompt! chat-id :idle messenger db*))))
181182 :on-prepare-tool-call (fn [{:keys [id name arguments-text]}]
182183 (assert-chat-not-stopped! chat-id db* messenger)
184+ (swap! tool-call-args-by-id* update id str arguments-text)
183185 (messenger/chat-content-received
184186 messenger
185187 {:chat-id chat-id
188190 :content {:type :toolCallPrepare
189191 :name name
190192 :origin (tool-name->origin name all-tools)
191- :arguments-text arguments-text
193+ :arguments-text ( get @tool-call-args-by-id* id)
192194 :id id
193195 :manual-approval false }}))
194196 :on-tool-called (fn [{:keys [id name arguments] :as tool-call}]
210212 (reset! received-msgs* " " ))
211213 (add-to-history! {:role " tool_call" :content tool-call})
212214 (add-to-history! {:role " tool_call_output" :content (assoc tool-call :output result)})
215+ (swap! tool-call-args-by-id* dissoc id)
213216 (messenger/chat-content-received
214217 messenger
215218 {:chat-id chat-id
You can’t perform that action at this time.
0 commit comments