File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ - Fix laat word going after tool call for openai-chat API.
6+
57## 0.63.2
68
79- Fix retrocompatibility with some models not working with openai-chat like deepseek.
Original file line number Diff line number Diff line change 6060(defn ^:private base-request! [{:keys [rid extra-headers body api-url api-key on-error on-response]}]
6161 (let [url (str api-url chat-completions-path)]
6262 (llm-util/log-request logger-tag rid url body)
63- (logger/info " --------> " (json/generate-string body))
6463 (http/post
6564 url
6665 {:headers (merge {" Authorization" (str " Bearer " api-key)
368367
369368 ; ; Process tool calls if present
370369 (when (:tool_calls delta)
370+ ; ; Flush any leftover buffered content before finishing
371+ (let [buf @content-buffer*]
372+ (when (pos? (count buf))
373+ (if (= @reasoning-type* :tag )
374+ (on-reason {:status :thinking :id @current-reason-id* :text buf})
375+ (on-message-received {:type :text :text buf}))
376+ (reset! content-buffer* " " )))
371377 (doseq [tool-call (:tool_calls delta)]
372378 (let [{:keys [index id function]} tool-call
373379 {name :name args :arguments } function
You can’t perform that action at this time.
0 commit comments