mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix n=1 issue with langchain
This commit is contained in:
parent
29ab9b5463
commit
e834c063ff
5 changed files with 9 additions and 3 deletions
|
@ -980,7 +980,13 @@ def get_optional_params( # use the openai defaults
|
|||
print_verbose(f"checking params for {model}")
|
||||
print_verbose(f"params passed in {passed_params}")
|
||||
print_verbose(f"non-default params passed in {non_default_params}")
|
||||
unsupported_params = [k for k in non_default_params.keys() if k not in supported_params]
|
||||
unsupported_params = []
|
||||
for k in non_default_params.keys():
|
||||
if k not in supported_params:
|
||||
if k == "n" and n == 1: # langchain sends n=1 as a default value
|
||||
pass
|
||||
else:
|
||||
unsupported_params.append(k)
|
||||
if unsupported_params:
|
||||
raise ValueError("LiteLLM.Exception: Unsupported parameters passed: {}".format(', '.join(unsupported_params)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue