Skip to content

Commit 6fe32ae

Browse files
authored
Merge pull request #55 from editor-code-assistant/feature/add-deepseek-reasoning
Make reasoning parsing in openai-chat more robust
2 parents bd4b4de + 1a0a22f commit 6fe32ae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/eca/llm_providers/openai_chat.clj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@
217217
(on-message-received {:type :text :text (:content delta)}))
218218

219219
;; Process reasoning if present (o1 models and compatible providers)
220-
(when-let [reasoning-text (:reasoning delta)]
220+
(when-let [reasoning-text (or (:reasoning delta)
221+
(:reasoning_content delta))]
221222
(when on-reason
222223
(when-not @reasoning-started*
223224
;; Generate new reason-id for each thinking block
@@ -232,6 +233,7 @@
232233
;; Check if reasoning just stopped (was active, now nil, and we have content)
233234
(when (and @reasoning-started*
234235
(nil? (:reasoning delta))
236+
(nil? (:reasoning_content delta))
235237
(:content delta)
236238
on-reason)
237239
(on-reason {:status :finished :id @current-reason-id*})

0 commit comments

Comments
 (0)