branch: elpa/gptel
commit 6a000d64b97ce0933ed42136e52cb21f179fd1cb
Author: Karthik Chikmagalur <[email protected]>
Commit: Karthik Chikmagalur <[email protected]>
gptel-anthropic: Increase default max_tokens
* gptel-anthropic.el (gptel--request-data): The Anthropic API
requires max_tokens to always be specified. Increase the default
value from 1024 (which is causing responses to be truncated, #683)
to 4096. 4096 is the highest value compatible with all Anthropic
models.
---
gptel-anthropic.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gptel-anthropic.el b/gptel-anthropic.el
index dde7ab6cc5..9446b0237e 100644
--- a/gptel-anthropic.el
+++ b/gptel-anthropic.el
@@ -200,7 +200,7 @@ Mutate state INFO with response metadata."
(let ((prompts-plist
`(:model ,(gptel--model-name gptel-model)
:stream ,(or gptel-stream :json-false)
- :max_tokens ,(or gptel-max-tokens 1024)
+ :max_tokens ,(or gptel-max-tokens 4096)
:messages [,@prompts])))
(when gptel--system-message
(if (and (or (eq gptel-cache t) (memq 'system gptel-cache))