fix(utils.py): support openrouter streaming

Fixes https://github.com/BerriAI/litellm/issues/5080
This commit is contained in:
Krrish Dholakia 2024-08-21 08:46:55 -07:00
parent dc261dd07a
commit 1b6db8359a
2 changed files with 14 additions and 63 deletions

View file

@ -2896,7 +2896,7 @@ def get_optional_params(
unsupported_params = {}
for k in non_default_params.keys():
if k not in supported_params:
if k == "user" or k == "stream_options":
if k == "user" or k == "stream_options" or k == "stream":
continue
if k == "n" and n == 1: # langchain sends n=1 as a default value
continue # skip this param
@ -2908,8 +2908,8 @@ def get_optional_params(
else:
unsupported_params[k] = non_default_params[k]
if unsupported_params:
if litellm.drop_params == True or (
drop_params is not None and drop_params == True
if litellm.drop_params is True or (
drop_params is not None and drop_params is True
):
pass
else: