Merge branch 'main' into litellm_claude_3_bedrock_access

This commit is contained in:
Krish Dholakia 2024-03-05 07:10:45 -08:00 committed by GitHub
commit 5b3459d759
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 529 additions and 70 deletions

View file

@ -4216,6 +4216,11 @@ def get_optional_params(
if top_p is not None:
optional_params["top_p"] = top_p
if max_tokens is not None:
if (model == "claude-2") or (model == "claude-instant-1"):
# these models use antropic_text.py which only accepts max_tokens_to_sample
optional_params["max_tokens_to_sample"] = max_tokens
else:
optional_params["max_tokens"] = max_tokens
optional_params["max_tokens"] = max_tokens
if tools is not None:
optional_params["tools"] = tools