File tree Expand file tree Collapse file tree 3 files changed +22
-4
lines changed
Expand file tree Collapse file tree 3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ - Fix openai reasoning not being included in messages.
6+
57## 0.23.0
68
79- Support parallel tool call.
Original file line number Diff line number Diff line change 252252 :id id
253253 :text text}))
254254 :finished (do
255- (add-to-history! {:role " reason" :content {:external-id external-id
255+ (add-to-history! {:role " reason" :content {:id id
256+ :external-id external-id
256257 :text @received-thinking*}})
257258 (send-content! chat-ctx :assistant
258259 {:type :reasonFinished
Original file line number Diff line number Diff line change 22 (:require
33 [cheshire.core :as json]
44 [clojure.java.io :as io]
5+ [clojure.string :as string]
56 [eca.llm-util :as llm-util]
67 [eca.logger :as logger]
78 [hato.client :as http]))
5152 {:type " function_call_output"
5253 :call_id (:id content)
5354 :output (llm-util/stringfy-tool-result content)}
54- ; ; TODO include reason blocks
55- " reason" nil
55+ " reason" {:type " reasoning"
56+ :id (:id content)
57+ :summary (if (string/blank? (:text content))
58+ []
59+ [{:type " summary_text"
60+ :text (:text content)}])
61+ :encrypted_content (:external-id content)}
5662 (update msg :content (fn [c]
5763 (if (string? c)
5864 c
7682 :parallel_tool_calls true
7783 :instructions instructions
7884 :tools tools
85+ :include (when reason?
86+ [" reasoning.encrypted_content" ])
87+ :store false
7988 :reasoning (when reason?
8089 {:effort " medium"
8190 :summary " detailed" })
101110 (case (:type (:item data))
102111 " reasoning" (on-reason {:status :finished
103112 :id (-> data :item :id )
104- :external-id (-> data :item :id )})
113+ :external-id (-> data :item :encrypted_content )})
105114 nil )
106115
107116 ; ; URL mentioned
166175 (swap! tool-call-by-item-id* dissoc (:item-id tool-call))))
167176 (on-message-received {:type :finish
168177 :finish-reason (-> data :response :status )})))
178+
179+ " response.failed" (do
180+ (when-let [error (-> data :response :error )]
181+ (on-error {:message (:message error)}))
182+ (on-message-received {:type :finish
183+ :finish-reason (-> data :response :status )}))
169184 nil ))]
170185 (base-completion-request!
171186 {:rid (llm-util/gen-rid )
You can’t perform that action at this time.
0 commit comments