forked from phoenix/litellm-mirror
add cohere streaming
This commit is contained in:
parent
5b96906442
commit
a166af50d0
3 changed files with 45 additions and 6 deletions
|
@ -161,6 +161,16 @@ def get_optional_params(
|
|||
if top_p != 1:
|
||||
optional_params["top_p"] = top_p
|
||||
return optional_params
|
||||
elif model in litellm.cohere_models:
|
||||
# handle cohere params
|
||||
if stream:
|
||||
optional_params["stream"] = stream
|
||||
if temperature != 1:
|
||||
optional_params["temperature"] = temperature
|
||||
if max_tokens != float('inf'):
|
||||
optional_params["max_tokens"] = max_tokens
|
||||
return optional_params
|
||||
|
||||
else:# assume passing in params for openai/azure openai
|
||||
if functions != []:
|
||||
optional_params["functions"] = functions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue