forked from phoenix/litellm-mirror
(feat) maintain anthropic text completion
This commit is contained in:
parent
9094be7fbd
commit
1183e5f2e5
4 changed files with 59 additions and 25 deletions
|
@ -4200,7 +4200,11 @@ def get_optional_params(
|
|||
if top_p is not None:
|
||||
optional_params["top_p"] = top_p
|
||||
if max_tokens is not None:
|
||||
optional_params["max_tokens"] = max_tokens
|
||||
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
|
||||
elif custom_llm_provider == "cohere":
|
||||
## check if unsupported param passed in
|
||||
supported_params = [
|
||||
|
@ -9704,4 +9708,4 @@ def _get_base_model_from_metadata(model_call_details=None):
|
|||
base_model = model_info.get("base_model", None)
|
||||
if base_model is not None:
|
||||
return base_model
|
||||
return None
|
||||
return None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue