Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: claude-3-5-sonnet-20240620 max token error (#6843)
Joedf9bd36caba8
diff --git a/api/core/model_runtime/model_providers/anthropic/llm/claude-3-5-sonnet-20240620.yaml b/api/core/model_runtime/model_providers/anthropic/llm/claude-3-5-sonnet-20240620.yamlindex e02c5517fe1..64ae3abf647 100644--- a/api/core/model_runtime/model_providers/anthropic/llm/claude-3-5-sonnet-20240620.yaml+++ b/api/core/model_runtime/model_providers/anthropic/llm/claude-3-5-sonnet-20240620.yaml@@ -26,7 +26,6 @@ parameter_rules:required: false- name: max_tokensuse_template: max_tokens- required: truedefault: 8192min: 1max: 8192diff --git a/api/core/model_runtime/model_providers/anthropic/llm/llm.py b/api/core/model_runtime/model_providers/anthropic/llm/llm.pyindex 107efe48678..19ce401999c 100644--- a/api/core/model_runtime/model_providers/anthropic/llm/llm.py+++ b/api/core/model_runtime/model_providers/anthropic/llm/llm.py@@ -116,7 +116,8 @@ class AnthropicLargeLanguageModel(LargeLanguageModel):# Add the new header for claude-3-5-sonnet-20240620 modelextra_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'] = [