瀏覽代碼

fix: claude-3-5-sonnet-20240620 max token error (#6843)

tags/0.6.16
Joe 1 年之前
父節點
當前提交
df9bd36cab
No account linked to committer's email address

+ 0
- 1
api/core/model_runtime/model_providers/anthropic/llm/claude-3-5-sonnet-20240620.yaml 查看文件

@@ -26,7 +26,6 @@ parameter_rules:
required: false
- name: max_tokens
use_template: max_tokens
required: true
default: 8192
min: 1
max: 8192

+ 2
- 1
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 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…
取消
儲存