From 91e2aebe8c84d6c5ce54ddc17fcc7eada4764fa0 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Thu, 12 Oct 2023 21:24:22 -0700 Subject: [PATCH] (fix) ensure stop is always a list for anthropic --- litellm/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litellm/utils.py b/litellm/utils.py index 7d678aeb0..829053bee 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -1090,6 +1090,8 @@ def get_optional_params( # use the openai defaults if stream: optional_params["stream"] = stream if stop: + if type(stop) == str: + stop = [stop] # openai can accept str/list for stop optional_params["stop_sequences"] = stop if temperature: optional_params["temperature"] = temperature