Skip to content

Commit 69285bd

Browse files
authored
Merge pull request #313 from djr7C4/deepseek-reasoner
Add DeepSeek reasoner
2 parents 8760b38 + d705931 commit 69285bd

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

chatgpt-shell-deepseek.el

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ VALIDATE-COMMAND and OTHER-PARAMS for `chatgpt-shell-openai-make-model'."
4646
(defun chatgpt-shell-deepseek-models ()
4747
"Build a list of DeepSeek LLM models."
4848
(list (chatgpt-shell-deepseek-make-model
49+
:version "deepseek-reasoner"
50+
:short-version "reasoner"
51+
:label "DeepSeek"
52+
;; See https://api-docs.deepseek.com/quick_start/token_usage
53+
:token-width 3
54+
;; See https://api-docs.deepseek.com/quick_start/pricing.
55+
:context-window 65536)
56+
(chatgpt-shell-deepseek-make-model
4957
:version "deepseek-chat"
5058
:short-version "chat"
5159
:label "DeepSeek"
@@ -95,9 +103,7 @@ If you use DeepSeek through a proxy service, change the URL base."
95103
:missing-key-msg "Your chatgpt-shell-deepseek-key is missing"))
96104

97105
(defun chatgpt-shell-deepseek--filter-output (raw-response)
98-
"Filter RAW-RESPONSE when processing responses are sent.
99-
100-
This occurs for example with OpenAI's o1 model through DeepSeek."
106+
"Filter RAW-RESPONSE when processing responses are sent."
101107
(chatgpt-shell-openai--filter-output raw-response))
102108

103109
(defun chatgpt-shell-deepseek--make-headers (&rest args)

chatgpt-shell-openai.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,10 @@ Otherwise:
241241
(let-alist obj
242242
(mapconcat (lambda (choice)
243243
(let-alist choice
244-
(or .delta.content
245-
.message.content)))
244+
(or (and (not (eq .delta.content :null))
245+
.delta.content)
246+
.message.content
247+
"")))
246248
.choices "")))))
247249
(unless (string-empty-p text)
248250
(setq response (concat response text)))

0 commit comments

Comments
 (0)