File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1476,6 +1476,10 @@ interface RewriteStartedContent {
14761476 type: ' started' ;
14771477}
14781478
1479+ interface RewriteReasoningContent {
1480+ type: ' reasoning' ;
1481+ }
1482+
14791483interface RewriteTextContent {
14801484 type: ' text' ;
14811485
@@ -1488,6 +1492,7 @@ interface RewriteFinishedContent {
14881492
14891493type RewriteContent =
14901494 RewriteStartedContent
1495+ | RewriteReasoningContent
14911496 | RewriteTextContent
14921497 | RewriteFinishedContent ;
14931498
Original file line number Diff line number Diff line change 2525 [provider model] (string/split full-model #"/" 2 )
2626 model-capabilities (get-in db [:models full-model])
2727 full-text (when path (llm-api/refine-file-context path nil ))
28+ start-time (System/currentTimeMillis )
2829 instructions (f.prompt/build-rewrite-instructions text path full-text range config)
2930 ctx {:db* db*
3031 :config config
4849 :provider-auth (get-in db [:auth provider])
4950 :on-first-response-received (fn [& _]
5051 (send-content! ctx {:type :started }))
52+ :on-reason (fn [{:keys [status]}]
53+ (when (= :started status)
54+ (send-content! ctx {:type :reasoning })))
5155 :on-message-received (fn [{:keys [type] :as msg}]
5256 (case type
5357 :text (send-content! ctx {:type :text
5458 :text (:text msg)})
55- :finish (send-content! ctx {:type :finished })
59+ :finish (send-content! ctx {:type :finished
60+ :total-time-ms (- (System/currentTimeMillis ) start-time)})
5661 nil ))}))
5762 {:status " prompting"
58- :model model}))
63+ :model full- model}))
You can’t perform that action at this time.
0 commit comments