mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 11:42:29 +08:00
fix: claude-3-5-sonnet-20240620 max token error (#6843)
This commit is contained in:
parent
77c071e26f
commit
df9bd36cab
|
@ -26,7 +26,6 @@ parameter_rules:
|
|||
required: false
|
||||
- name: max_tokens
|
||||
use_template: max_tokens
|
||||
required: true
|
||||
default: 8192
|
||||
min: 1
|
||||
max: 8192
|
||||
|
|
|
@ -116,7 +116,8 @@ class AnthropicLargeLanguageModel(LargeLanguageModel):
|
|||
# Add the new header for claude-3-5-sonnet-20240620 model
|
||||
extra_headers = {}
|
||||
if model == "claude-3-5-sonnet-20240620":
|
||||
extra_headers["anthropic-beta"] = "max-tokens-3-5-sonnet-2024-07-15"
|
||||
if model_parameters.get('max_tokens') > 4096:
|
||||
extra_headers["anthropic-beta"] = "max-tokens-3-5-sonnet-2024-07-15"
|
||||
|
||||
if tools:
|
||||
extra_model_kwargs['tools'] = [
|
||||
|
|
Loading…
Reference in New Issue
Block a user